Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Minor bug with ServerSummaries: outputs amended with group by column

$
0
0
Hi Isomorphic,

please see this .ds.xml (using v10.0p_2015-05-21, it is about the fetchZipcodeCount-operationBinding):
Code:

<DataSource dbName="Oracle" tableName="MV_ZIPCODE" ID="MV_ZIPCODE" serverType="sql"
        serverConstructor="com.lmscompany.lms.server.LMSSQLDataSource" allowedClientOperationTypes="fetch">
        <fields>
                <field hidden="true" name="TENANT_ID" type="integer" canEdit="false" />
                <field name="COUNTRY_ID" title="COUNTRY_ID" type="integer" />
                <field name="COUNTRY_SHORTNAME_DE" title="COUNTRY_SHORTNAME_DE" length="40" type="text" escapeHTML="true" />
                <field name="COUNTRY_SHORTNAME_EN" title="COUNTRY_SHORTNAME_EN" length="40" type="text" escapeHTML="true" />
                <field name="ADMINAREA" title="ADMINAREA" length="100" type="text" escapeHTML="true" />
                <field name="ZIPCODE" title="ZIPCODE" length="10" type="text" escapeHTML="true" />
                <field name="LATITUDE" title="LATITUDE" type="integer" />
                <field name="LONGITUDE" title="LONGITUDE" type="integer" />
                <field name="ORTSVORSCHLAG" title="ORTSVORSCHLAG" length="100" type="text" escapeHTML="true" />

                <!-- Data fields -->
                <field name="ZIPCODE_COUNT" type="integer" customSQL="true" customSelectExpression="DISTINCT ZIPCODE" nativeName="ZIPCODE" />
        </fields>
        <operationBindings>
                <operationBinding operationType="fetch" operationId="fetchZipcodeCount" outputs="ZIPCODE_COUNT">
                        <customFields>ZIPCODE_COUNT</customFields>
                        <summaryFunctions>
                                <ZIPCODE_COUNT>count</ZIPCODE_COUNT>
                        </summaryFunctions>
                        <groupBy>COUNTRY_IDs</groupBy>
                </operationBinding>
        </operationBindings>
</DataSource>

This is the request sent by the client (correct):
Code:

{
    dataSource:"MV_ZIPCODE",
    operationType:"fetch",
    operationId:"fetchZipcodeCount",
    data:{
        operator:"equals",
        fieldName:"COUNTRY_ID",
        value:"1466"
    },
    textMatchStyle:"exact",
    showPrompt:true,
    oldValues:{
        operator:"equals",
        fieldName:"COUNTRY_ID",
        value:"1466"
    },
    requestId:"MV_ZIPCODE$62726",
    fallbackToEval:false,
    lastClientEventThreadCode:"IFCS3",
    bypassCache:true
}

This is the SQL generated:
Code:

SELECT MV_ZIPCODE.COUNTRY_ID, COUNT(DISTINCT ZIPCODE) AS ZIPCODE_COUNT FROM MV_ZIPCODE WHERE ((MV_ZIPCODE.TENANT_ID = 8 AND MV_ZIPCODE.TENANT_ID IS NOT NULL) AND (MV_ZIPCODE.COUNTRY_ID = 1466 AND MV_ZIPCODE.COUNTRY_ID IS NOT NULL)) GROUP BY MV_ZIPCODE.COUNTRY_ID
I would not expect the MV_ZIPCODE.COUNTRY_ID column to be in the SELECT-list because it is not in the operationBinding's outputs="ZIPCODE_COUNT".
It's presence results in 0 rows returned instead the correct and expected 1 row with ZIPCODE_COUNT:0.

This is minor and can be handled on the client side, which I do now. Therefore it has no priority for me, but I nevertheless think the behaviour is not correct here.

Best regards
Blama

Viewing all articles
Browse latest Browse all 4756

Trending Articles