SQLTables error where table name is over 31 characters
faridzidan opened this issue · 4 comments
Windows x64
ANSI app code page UTF-8
Firebird 06.03.2496 WI-V Firebird 4.0, OdbcFb 02.00.0156
1 create table with name greater than 31 characters. Example,
create table TEST_IN_SYNC_DBMS_COLUMN_CODE_longVARCHAR (
DBMS_CD CHAR(8) not null,
OBJECT_TYPE_CD CHAR(8) not null,
SQL_TYPE_CD CHAR(8) not null,
COLUMN_NAME VARCHAR(128) not null,
CODE BLOB SUB_TYPE TEXT not null,
DESCRIPTION VARCHAR(60) not null,
IMAGE_ID VARCHAR(30),
IMAGE_ID_SMALL VARCHAR(30),
CTRL_INS_DTM TIMESTAMP default CURRENT_TIMESTAMP not null,
CTRL_UPD_DTM TIMESTAMP not null,
CTRL_USR_ID VARCHAR(256) not null,
constraint PK_TEST_IN_SYNC_DBMS_COLUMN_CODE_longVARCHAR primary key (DBMS_CD, OBJECT_TYPE_CD, SQL_TYPE_CD, COLUMN_NAME/, CODE/)
);
-- table is created successfully
2 Execute ODBC API function SQLTables with parameters to get list of all user tables in the database:
SQLRETURN rc = ::SQLTables(
hstmt,,
(SQLCHAR *) NULL,
(SQLSMALLINT) 0,
(SQLCHAR *) NULL,
(SQLSMALLINT) 0,
(SQLCHAR *) NULL,
(SQLSMALLINT) 0,
(SQLCHAR *) "TABLE",
(SQLSMALLINT) 5);
3 I get this error:
SQL Error. Native Code: -802, SQLState: HY000, Return Code: -1
[ODBC Firebird Driver][Firebird]arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 31, actual 63
Works fine if database does not contain a user table with name greater than 31 characters.
There is a PR for this in #206
Please note that this issue has been completely resolved (not only with the table name, but for all metadata IDs) in the new version of the ODBC driver - https://github.com/FirebirdSQL/firebird-odbc-driver/wiki.
Will appreciate if you take part in testing
Regards
Up!
Closed.
You may re-open it if any issues occure.