SmartClient Version: SNAPSHOT_v13.0d_2021-09-17/PowerEdition Deployment (built 2021-09-17)
and also in version
SmartClient Version: SNAPSHOT_v13.0d_2022-01-15/PowerEdition Deployment (built 2022-01-15)
Using GWT 2.9.0
We have a simple DataSource that has been working for years in SmartGWT 6.x , and 12.x
The DataSource is associated with a ListGrid.
In the two releases of 13.0 in which I have tested this problem, the sort field is modified in the ORDER by clause by adding the primary key of the main table, but this PK is NOT a member of the group clause (just doesn't make sense) and we see a SQL failure that the PK is invalid.
The ListGrid defaults to sort the results by the field called 'Block_Name'
Here is the DataSource fetch definition:
The Developer console shows the RPCRequest as the following, it is the same for 12.1 and, both versions of 13.0 (2022-01-15 and 2021-09-17):
In 12.1 the ORDER BY clause is simply : "ORDER BY Block_Name ". Works fine.
In the version SmartClient Version: SNAPSHOT_v13.0d_2021-09-17/PowerEdition Deployment (built 2021-09-17), it generates this SQL:
In this version of smartGWT the SQL error is: Invalid column name 'PK_Block_Instance'.
In the version SmartClient Version: SNAPSHOT_v13.0d_2022-01-15/PowerEdition Deployment (built 2022-01-15), it generates this SQL:
In this second case the SQL reports that: the Column "Block_Instance.PK_Block_Instance" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause.
Obviously something has changed between versions. I'm not saying that the problem lies within the Framework. It is probably more likely that we have to change our code, but I don't understand why.
We could remove the "blocksGrid.setSortField("Block_Name");" from the ListGrid, or we could add a field of the PK_Block_Instance to the "blocksGrid.setFields (.... grid field definitons.. ) or even remove the .setFields and rely on the field defintions of the DataSource.
What do you recommend and do you have an explanation for why this is happening, i.e why the PK_Block_Instance is getting added to the sort order?
The Datasource defines the the field of PK_Block_Instance as in:
Aside: I know I have to suppress asm-8.0.1.jar in the build path to get 13.0 to run successfully, from prior email exchanges, but I can't find the documentation online with that troubleshooting tip for 13.x. Where can I find it? Tried Google and Forum searches for this information, in case I missed something else.
and also in version
SmartClient Version: SNAPSHOT_v13.0d_2022-01-15/PowerEdition Deployment (built 2022-01-15)
Using GWT 2.9.0
We have a simple DataSource that has been working for years in SmartGWT 6.x , and 12.x
The DataSource is associated with a ListGrid.
In the two releases of 13.0 in which I have tested this problem, the sort field is modified in the ORDER by clause by adding the primary key of the main table, but this PK is NOT a member of the group clause (just doesn't make sense) and we see a SQL failure that the PK is invalid.
The ListGrid defaults to sort the results by the field called 'Block_Name'
Here is the DataSource fetch definition:
Code:
<operationBinding operationType="fetch"> <tableClause> $defaultTableClause JOIN BLOCK_PROPS_REAL_USERS ON Block_Instance.FK_Block_Props = BLOCK_PROPS_REAL_USERS.idBlock_Props JOIN Project as Source ON BLOCK_PROPS_REAL_USERS.FK_idProject = Source.PK_Project JOIN Project ON Block_Instance.FK_idProject = Project.PK_Project </tableClause> </operationBinding>
Code:
{ "actionURL":"http://10.75.224.44:8815/beer/sc/IDACall", "showPrompt":true, "prompt":"Finding Records that match your criteria...", "transport":"xmlHttpRequest", "promptStyle":null, "bypassCache":true, "data":{ "criteria":{ "FK_idProject":878 }, "operationConfig":{ "dataSource":"Block_Instance", "repo":null, "operationType":"fetch", "textMatchStyle":"exact" }, "startRow":0, "endRow":75, "sortBy":[ "Block_Name" ], "componentId":"isc_BCMProjectBlocks_1_0", "groupBy":[ "Block_Name", "Macro", "CoreLead", "SynthLead", "BackendLead", "FK_CoreLead", "FK_SynthLead", "FK_BackendLead" ], "appID":"builtinApplication", "operation":"Block_Instance_fetch", "oldValues":{ "FK_idProject":878 } } }
In the version SmartClient Version: SNAPSHOT_v13.0d_2021-09-17/PowerEdition Deployment (built 2021-09-17), it generates this SQL:
Code:
SELECT * FROM (SELECT *, ROW_NUMBER() OVER ( ORDER BY PK_Block_Instance) AS rowID FROM (SELECT TOP 100 PERCENT Block_Instance.Macro, BLOCK_PROPS_REAL_USERS.CoreLead AS CoreLead, BLOCK_PROPS_REAL_USERS.SynthLead AS SynthLead, BLOCK_PROPS_REAL_USERS.BackendLead AS BackendLead, BLOCK_PROPS_REAL_USERS.FK_BackendLead AS FK_BackendLead, BLOCK_PROPS_REAL_USERS.FK_CoreLead AS FK_CoreLead, BLOCK_PROPS_REAL_USERS.FK_SynthLead AS FK_SynthLead FROM Block_Instance JOIN BLOCK_PROPS_REAL_USERS ON Block_Instance.FK_Block_Props = BLOCK_PROPS_REAL_USERS.idBlock_Props JOIN Project as Source ON BLOCK_PROPS_REAL_USERS.FK_idProject = Source.PK_Project JOIN Project ON Block_Instance.FK_idProject = Project.PK_Project WHERE ( Block_Instance.FK_idProject=867 ) GROUP BY Block_Instance.Macro, BLOCK_PROPS_REAL_USERS.CoreLead, BLOCK_PROPS_REAL_USERS.SynthLead, BLOCK_PROPS_REAL_USERS.BackendLead, BLOCK_PROPS_REAL_USERS.FK_BackendLead, BLOCK_PROPS_REAL_USERS.FK_CoreLead, BLOCK_PROPS_REAL_USERS.FK_SynthLead) x) y WHERE y.rowID BETWEEN 1 AND 75
In the version SmartClient Version: SNAPSHOT_v13.0d_2022-01-15/PowerEdition Deployment (built 2022-01-15), it generates this SQL:
Code:
SELECT Block_Instance.Macro, BLOCK_PROPS_REAL_USERS.CoreLead AS CoreLead, BLOCK_PROPS_REAL_USERS.SynthLead AS SynthLead, BLOCK_PROPS_REAL_USERS.BackendLead AS BackendLead, BLOCK_PROPS_REAL_USERS.FK_BackendLead AS FK_BackendLead, BLOCK_PROPS_REAL_USERS.FK_CoreLead AS FK_CoreLead, BLOCK_PROPS_REAL_USERS.FK_SynthLead AS FK_SynthLead, Block_Name.Block_Name FROM Block_Instance --Block_Instance JOIN BLOCK_PROPS_REAL_USERS ON Block_Instance.FK_Block_Props = BLOCK_PROPS_REAL_USERS.idBlock_Props JOIN Project as Source ON BLOCK_PROPS_REAL_USERS.FK_idProject = Source.PK_Project JOIN Project ON Block_Instance.FK_idProject = Project.PK_Project JOIN Block_Name ON Block_Instance.Block_Name_PK_Block_Name = Block_Name.PK_Block_Name WHERE ( Block_Instance.FK_idProject=867 ) GROUP BY Block_Instance.Macro, BLOCK_PROPS_REAL_USERS.CoreLead, BLOCK_PROPS_REAL_USERS.SynthLead, BLOCK_PROPS_REAL_USERS.BackendLead, BLOCK_PROPS_REAL_USERS.FK_BackendLead, BLOCK_PROPS_REAL_USERS.FK_CoreLead, BLOCK_PROPS_REAL_USERS.FK_SynthLead, Block_Name.Block_Name ORDER BY Block_Name, PK_Block_Instance OFFSET 0 ROWS FETCH NEXT 75 ROWS ONLY
Obviously something has changed between versions. I'm not saying that the problem lies within the Framework. It is probably more likely that we have to change our code, but I don't understand why.
We could remove the "blocksGrid.setSortField("Block_Name");" from the ListGrid, or we could add a field of the PK_Block_Instance to the "blocksGrid.setFields (.... grid field definitons.. ) or even remove the .setFields and rely on the field defintions of the DataSource.
What do you recommend and do you have an explanation for why this is happening, i.e why the PK_Block_Instance is getting added to the sort order?
The Datasource defines the the field of PK_Block_Instance as in:
Code:
<DataSource ID="Block_Instance" serverType="sql" tableName="Block_Instance" dropExtraFields="false"> <fields> <field name="PK_Block_Instance" type="sequence" primaryKey="true" hidden="true" /> <field name="FK_idProject" type="integer" foreignKey="Project.PK_Project" hidden="true" /> ..... etc.
Aside: I know I have to suppress asm-8.0.1.jar in the build path to get 13.0 to run successfully, from prior email exchanges, but I can't find the documentation online with that troubleshooting tip for 13.x. Where can I find it? Tried Google and Forum searches for this information, in case I missed something else.
Comment