On 04-06-2023 02:46, Luciano Rodrigues Nunes Mendes wrote:
> How should I describe the firebird API issue for not supporting
> collation when creating a database?
> Could you help me describe this issue?
I don't think that will be changed. The API only has the information
which must be known when creating the database. Even the parser of
`CREATE DATABASE` just executes the equivalent of `ALTER CHARACTER SET
<db-charset> SET DEFAULT COLLATION <db-collation>` after it successfully
created the database.
In fact, even the default database character set is not really part of
the API to create a database, but it is exposed as a DPB item for
historic reasons (changing the database character set wasn't originally
part of ALTER DATABASE, so the isc_dpb_set_* options was needed to
change it).
Looking through the Firebird 5.0 source code, create database happens in
two parts:
1) fbclient.dll intercepts the `CREATE DATABASE` statement, collects the
minimum necessary information to create the database (page size,
username, password, role, and *connection* character set), and then
creates the database,
2) it then executes the `CREATE DATABASE` statement on the newly created
database, which takes care of the rest of the initialization of the
database (it ignores the parts which were already used in the first step).
Mark
--
Mark Rotteveel