Subject Identifier max length and char encoding - bug in fbclient or Firebird?
Author Kjell Rilbe

Taking this into a new thread since I kind-of hijacked Roberto Carlos' one.

Hellen Borrie stated that identifiers are stored in UNICODE_FSS and max
31 such characters (31 * 3 byte f�r the actual char data).

Now, when I enter a statement in FlameRobin (FR) with a UTF-8
connection, FR and IBPP encodes the statement into UTF-8 before passing
it to fbclient, unless I misunderstood what Michael Hieke wrote in the
flamerobin-devel list.

But then something goes wrong, because I can successfully execute this:

-- 31 single-char characters.
create table "X234567890123456789012345678901" (
"X234567890123456789012345678901" int
-- No errors here.

But this fails:

-- 31 characters, one of which requires 2 byte in UTF-8.
create table "�234567890123456789012345678901" (
"�234567890123456789012345678901" int

Error: *** IBPP::SQLException ***
Context: Statement::Execute( create table
"��234567890123456789012345678901" (
"��234567890123456789012345678901" int
Message: isc_dsql_execute2 failed

SQL Message : -607
This operation is not defined for system tables.

Engine Code : 335544351
Engine Message :
unsuccessful metadata update
Name longer than database column size

As an additional check, this works:

-- 30 characters, one of which requires 2 byte in UTF-8.
create table "�23456789012345678901234567890" (
"�23456789012345678901234567890" int
-- No errors here.

So, it seems to me that somewhere in fbclient or "beyond", the
identifier is not correctly transliterated from UTF-8 to UNICODE-FSS.

Can someone with a bit more insight than me confirm this?

Where is it going wrong?

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

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