The problem occurs when SQL is generated, and is illustrated by this
codesample:
query = new BasicSearchQuery(true);
step1 = query.addStep(images);
FieldDefs imagesNumber = images.getField("number");
BasicAggregatedField field1a = query.addAggregatedField(
step1, imagesNumber, AggregatedField.AGGREGATION_TYPE_COUNT);
field1a.setAlias("numberCount");
This result in the following query:
SELECT COUNT(number) AS numbercount
FROM <basename>_images images
Note that the alias, originally set to "numberCount" has been converted
to "numbercount" in the generated query.
This conversion is not appropriate.
My unittests indicated that this issue was introduced by modifications
outside of the dbsq (query) classes. My guess is it's in the storage
classes. The dbsq classes do rely on storage code when generating SQL
statements.
Rob van Maris
Technical Consultant
Quantiq
xmedia & communication solutions
Koninginneweg 11-13
1217 KP Hilversum
T +31 (0)356257211
M +31 (0)651444006
E [EMAIL PROTECTED]
W http://www.quantiq.com
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Pierre van Rooden
> Sent: donderdag 22 juli 2004 11:49
> To: [EMAIL PROTECTED]
> Subject: #6254 Fieldaliases converted to lowercase in result
> of aggregating query.
>
>
> From the bug description:
>
> "When executing an aggregating query, the fieldaliases are
> used to name
> the fields in the result (ResultNode).
> However the fieldnames in the result are not identical to the
> fieldaliases, but the fieldaliases converted to lowercase.
> Apparently fieldnames are converted to lowercase by the
> database layer,
> but this behaviour is not justified and not documented."
>
>
> I din't understand this bug. It is, as far as I can see, not
> the storage
> layer (as the searchqueries do not use the storage layer).
> Otoh I also can't find any code that 'changes' aliasses or
> lower-cases
> fieldnames.
> Is this a database specific problem? I.e. a database returns
> resultsets
> with different alias names than given in the query sent?
> And what are the exact errors (as in: where do things
> actually go wrong?)
>
> --
> Pierre van Rooden
> Mediapark, C 107 tel. +31 (0)35 6772815
> "Never summon anything bigger than your head."
>
>