Subject Re: [firebird-support] Upper case behaviour
Author Ann W. Harrison
Eugen.Konkov@... wrote:

>> Sure. You do this:
>> create table BigTable (BigField varchar (20000));
>> The metadata is stored preserving case. A portable tool does a
>> show tables to get its table list and sees
>> ...
>> BigTable
>> ...
>> It then generates a query
>> select * from "BigTable";
>> Which fails because "BigTable" is not the same as BigTable under
>> the ISO SQL Standard.
>
> Why are those not the same?

Because the standard says that regular identifiers are compared
to other identifiers by converting each lower case letter in the
identifier to its upper case equivalent(s). Thus the regular
identifier BigTable is compared with other identifers by replacing
the lower case i with an upper case I and the lower case g with
an upper case G, and the a with an A, and the b with a B and the
l with an L and the e with an E. BIGTABLE. "BigTable" is a
delimited identifier and the standards says it is to be compared
exactly as presented, after stripping the delimiter characters.
BIGTABLE is not the same as BigTable.


>
> Another question: SQL says that object names must not be case sensetive

No it doesn't. It says that object names are identifiers and there are
two types of identifier: delimited and regular.
> so
> 'create table a (...)' will seccess and second 'create table A (...)' must fail
> because of you can not create object with name of object which is already in database
> So that is a BUG when FireBird allow to create two objects 'a' and 'A' in the same database

I'm not sure what you're getting at. Identifiers must be unique in
their scope. You can have a table A and a field A and a procedure A
and a constraint A. They're all different scopes.
>
> Other cases:
> 'create table a (...)' will create table 'a' in database

No, it creates a table with the regular identifier A as its name. That
is the same as the regular identifier a.

> so
> 'create table A (...)" must fail because of there is the object 'a' in database

Right, bur for the wrong reason. There is a table with the regular
identifier A as its name.

> 'create table "a" (...)" must fail because of there is the object 'a' in database

Wrong. A delimited identifier "a" is different from a regular
identifier A.

> 'create table "A" (...)" must fail because of there is the object 'a' in database

Right, for the wrong reason. There is already a table whose name
exactly matches "A".

>
>


> FireBird just return names AS IS and tools must show names AS IS so there will not any ambigious

We don't control the tools and we're very happy that the tool builds
support Firebird. Making arbitrary and non-standard changes that break
their tools will not improve the general adoption of Firebird. IMHO.


Best regards,


Ann