Sherman,

This fix is bogus. It's crazy that we disable identifier quoting in the
DB2 dialect then override to enable it for aliases. (And by the way, the
algorithm you've used to quote identifiers is incorrect, if the
identifier contains double-quotes.)

We quote identifiers for two reasons - so that they can contain
spaces/punctuation, and to deal with case sensitivity. The first of
these is as valid for DB2 as for any database. Several of the databases
we use are case sensitity, and we just require that people type
tables/columns in the correct case.

I think you should back out this change, make the DB2 dialect quote all
identifiers, and get people to fix case-sensitivity issues in their
schemas.

Julian

> -----Original Message-----
> From: Sherman Wood [mailto:sgwood (AT) users (DOT) sf.net]
> Sent: Friday, April 13, 2007 7:30 AM
> To: Andreas Voss; Bart Pappyn; Julian Hyde; John V. Sichi;
> Matt Campbell; Sam Birney
> Subject: Eigenbase perforce change 9104 for review
>
> http://p4web.eigenbase.org/@md=d&c=6PU@//9104?ac=10
>
> Change 9104 by sgwood@SWOOD on 2007/04/13 07:28:30
>
> MONDRIAN: Fix DB2 drill through
>
> Affected files ...
>
> ... //open/mondrian/src/main/mondrian/rolap/sql/SqlQuery.java#75 edit
>
> Differences ...
>
> ====
> //open/mondrian/src/main/mondrian/rolap/sql/SqlQuery.java#75
> (ktext) ====
>
> 2c2
> < // $Id:
> //open/mondrian/src/main/mondrian/rolap/sql/SqlQuery.java#74 $
> ---
> > // $Id:

> //open/mondrian/src/main/mondrian/rolap/sql/SqlQuery.java#75 $
> 80c80
> < * @version $Id:
> //open/mondrian/src/main/mondrian/rolap/sql/SqlQuery.java#74 $
> ---
> > * @version $Id:

> //open/mondrian/src/main/mondrian/rolap/sql/SqlQuery.java#75 $
> 382c382,389
> < dialect.quoteIdentifier(alias, buf);
> ---
> > // If DB2, we normally don't quote identifiers

> in the queries because DB2 is
> > // case sensitive. In this case, though, we

> need to quote the column alias
> > // because it can be a name from the schema

> with spaces in it.
> > if (dialect.isDB2()) {
> > dialect.quoteIdentifier("\"" + alias + "\"", buf);
> > } else {
> > dialect.quoteIdentifier(alias, buf);
> > }

>


_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian