Subject Re: [firebird-support] Identifier max length and char encoding - bug in fbclient or Firebird?
Author Kjell Rilbe
I just tried this with isql and connection charset DOS_850 which is
single-byte. it fails in exactly the same way as FlameRobin and
connection charset UTF-8. I checked that my OS is set to codepage 850 in
the command prompt. Here's a transcript (copy/paste) of my session:

------------------------------------------------------------
C:\Program Files\Firebird\Firebird_2_1\bin>isql
c:\datadia\diamonds\diamonds.fdb -u sysdba -p masterkey -ch DOS_850
Database: c:\datadia\diamonds\diamonds.fdb, User: sysdba
SQL> create table "X234567890123456789012345678901" ("Dummy" int);
SQL> create table "X2345678901234567890123456789012" ("Dummy" int);
Statement failed, SQLCODE = -607
unsuccessful metadata update
-Name longer than database column size
SQL> create table "�234567890123456789012345678901" ("Dummy" int);
Statement failed, SQLCODE = -802
arithmetic exception, numeric overflow, or string truncation
SQL> create table "�23456789012345678901234567890" ("Dummy" int);
SQL> commit;
SQL> quit;

C:\Program Files\Firebird\Firebird_2_1\bin>
------------------------------------------------------------

This has to be a bug somewhere in Firebird, doesn't it?

Note that it give different error messages for
"X2345678901234567890123456789012" and
"�234567890123456789012345678901", which also looks suspicious.

Furthermore, I noticed that if I neglect to specify a connection
charset, I have various other strange problems:

------------------------------------------------------------
C:\Program Files\Firebird\Firebird_2_1\bin>isql
c:\datadia\diamonds\diamonds.fdb -u sysdba -p masterkey
Database: c:\datadia\diamonds\diamonds.fdb, User: sysdba
SQL> create table "X234567890123456789012345678901" ("Dummy" int);
SQL> create table "X2345678901234567890123456789012" ("Dummy" int);
Statement failed, SQLCODE = -607
unsuccessful metadata update
-Name longer than database column size
SQL> create table "�234567890123456789012345678901" ("Dummy" int);
SQL> create table "�23456789012345678901234567890" ("Dummy" int);
SQL> commit;
SQL> select rdb$relation_name from rdb$relations where rdb$relation_name
like '%2345%';

RDB$RELATION_NAME

===============================================================================

X234567890123456789012345678901

Statement failed, SQLCODE = -802
arithmetic exception, numeric overflow, or string truncation
-Cannot transliterate character between character sets
SQL> commit;
SQL> drop table "X234567890123456789012345678901";
SQL> drop table "�234567890123456789012345678901";
SQL> drop table "�23456789012345678901234567890";
SQL> commit;
SQL> select rdb$relation_name from rdb$relations where rdb$relation_name
like '%2345%';
SQL> commit;
SQL> quit;

C:\Program Files\Firebird\Firebird_2_1\bin>
------------------------------------------------------------

With these last "�..." tables, I am unable to connect to the DB with FR
and UTF-8. It reports:
------------------------------------------------------------
SQL Message: -802
Arithmetic overflow or division by zero has occurred.

Engine Code: 335544321
Engine Message:
arithmetic exception, numeric overflow, or string truncation
Cannot transliterate character between character sets
------------------------------------------------------------

So, apparently in this case FB succeeds in storing the identifiers but
it cannot read them. Transliteration to UTF-8 shouldn't be able to fail,
I think, since it should support *ANY* unicode string. This same problem
occurs for short identifiers too, by the way. I had the same problem
with table name "ST�R".

Now, can one of you guru's or someone else please confirm that this is
not just me seing ghosts?

Regards,
Kjell

--
------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64


[Non-text portions of this message have been removed]