You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inserting a too-long string value using an input parameter, with UTF8 client character set encoding, produces silent truncation. Should produce a truncation error. Confirmed by Adriano.
I'm connecting to database using client character set of UTF8. I have one
table, TEST, created like this:
CREATE TABLE test (c CHAR(10) CHARACTER SET UTF8);
I prepare this statement:
INSERT INTO test VALUES (?)
I attempt to insert a value of '012345679012345' into the column. There are
15 characters, so I expect a truncation error and no data inserted.
If I connect with client character set of NONE, I get the error, as I
expect.
If I connect with client character set of UTF8, then I get no error. But the
data *is* truncated. Why no error? That does not seem right, but maybe it is
something I forget to do??
arithmetic exception, numeric overflow, or string truncation
-string right truncation
bb04s6401:/r/sanyo.unx.sas.com/vol/vol10/u101/bioliv> isql fbtest.fdb
Database: fbtest.fdb
SQL> select * from test;
SQL>
To reproduce this, (1) create a database "fbtest.fdb" in current directory,
(2) create table test as above, (3) run "utftest UTF8" for UTF8 encoding,
and "utftest NONE" for NONE.
Here is my compilation line on S64
CC -g -m64 -I/u/bioliv/firebird2h1/gen/firebird/include
tftest.cpp -L$FIREBIRD/lib -lfbembed -o utftest
Submitted by: Bill Oliver (verbguy)
Is related to QA415
Attachments:
utftest.cpp
Inserting a too-long string value using an input parameter, with UTF8 client character set encoding, produces silent truncation. Should produce a truncation error. Confirmed by Adriano.
I'm connecting to database using client character set of UTF8. I have one
table, TEST, created like this:
CREATE TABLE test (c CHAR(10) CHARACTER SET UTF8);
I prepare this statement:
INSERT INTO test VALUES (?)
I attempt to insert a value of '012345679012345' into the column. There are
15 characters, so I expect a truncation error and no data inserted.
If I connect with client character set of NONE, I get the error, as I
expect.
If I connect with client character set of UTF8, then I get no error. But the
data *is* truncated. Why no error? That does not seem right, but maybe it is
something I forget to do??
Here is problem using encoding of UTF8
bb04s6401:/r/sanyo.unx.sas.com/vol/vol10/u101/bioliv> ./utftest UTF8
beginning test ./utftest..., encoding is UTF8
done!
bb04s6401:/r/sanyo.unx.sas.com/vol/vol10/u101/bioliv> isql fbtest.fdb
Database: fbtest.fdb
SQL> select * from test;
C
1234567890
SQL>
Here it is with encoding of NONE (no records are inserted)
bb04s6401:/r/sanyo.unx.sas.com/vol/vol10/u101/bioliv> ./utftest NONE
beginning test ./utftest..., encoding is NONE
arithmetic exception, numeric overflow, or string truncation
-string right truncation
bb04s6401:/r/sanyo.unx.sas.com/vol/vol10/u101/bioliv> isql fbtest.fdb
Database: fbtest.fdb
SQL> select * from test;
SQL>
To reproduce this, (1) create a database "fbtest.fdb" in current directory,
(2) create table test as above, (3) run "utftest UTF8" for UTF8 encoding,
and "utftest NONE" for NONE.
Here is my compilation line on S64
CC -g -m64 -I/u/bioliv/firebird2h1/gen/firebird/include
tftest.cpp -L$FIREBIRD/lib -lfbembed -o utftest
test case attached.
Commits: c8a6620
The text was updated successfully, but these errors were encountered: