Subject Re: [firebird-support] Re: Firebird 2.5 maximum length for each type of identifier
Author Kjell Rilbe
Helen Borrie skriver:
> >tomkrej skriver:
> >> Hi, all max.lengths for firebird are 31 characters.
> At 09:56 PM 12/11/2010, Kjell Rilbe wrote:
> >If I'm not mistaken, they are max 32 *byte*.
> You are mistaken, unfortunately. 31 *characters* is correct.
> Furthermore, I believe it was demonstrated at some point that the
> identifiers of triggers (and possibly also stored procedures) will
> overflow if defined as 28 characters or more.
> >If you use UTF-8 and some
> >chars are multi-byte, the max number of characters goes down in
> >proportion to the number of extra bytes used by multi-byte chars.
> Identifiers (including user names) are stored in UNICODE_FSS, three
> bytes per character, no variability.

OK, but then please explain this:

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

-- 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

This was executed over a UTF-8 connection, so maybe it's FlameRobin or
IBPP that transliterates from UTF-8 to iso-8859-1 or whatever, resulting
in 32 characters, that are later transliterated to UNICODE-FSS resulting
in 32 * 3 byte.

Seems convoluted. Does fbclient expect identifiers to be passed already
encoded in UNICODE-FSS or what char encoding does it expect? Is it the
connection charset that determines this? If so, then fbclient seems to
fail in transliterating the above strings directly to UNICODE-FSS.

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]