Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command SHOW TABLE fails when the table contains field with unicode collationin its DDL [CORE4782] #5081

Closed
firebird-automations opened this issue May 6, 2015 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Script (correct your host/port and filename):

shell del c:\temp\c2826.fdb 2>nul;
set names utf8;
--create database 'localhost/3254:c:\temp\c2826.fdb' default character set utf8;
create database 'localhost/3333:c:\temp\c2826.fdb' default character set utf8;
show version;
create collation test_coll for utf8 from unicode;
commit;
recreate table test_utf8(f01 varchar(100) character set utf8 collate test_coll);
commit;
show table test_utf8;

1. Result on Windows (use XP SP3, FB 32 bit, reproduced both on 2.5 and 3.0):

1.1 STDOUT:

<version info>, then:
F01 VARCHAR(100) CHARACTER SET UTF8 Nullable

1.2 STDERR

1.2.1) on WI-V2.5.5.26861:

Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-unknown ISC error 335545033

1.2.2) on WI-T3.0.0.31825:

Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 7, actual 9

2. Result on Linux (64 bit FB, LI-T3.0.0.31822):

STDOUT:

<version info>, then:
F01 VARCHAR(100) CHARACTER SET UTF8 Nullable
COLLATE TEST_COLL

STDERR: empty.

PS.
Note that on LINUX command 'show table' displays COLLATE and its name (at the 2nd line, after field 'F01' info), rather than on Windows - and maybe this is the reason of trouble on windows ?

Commits: 050d5b8 FirebirdSQL/fbt-repository@b62d4cd

====== Test Details ======

It was connection charset = UTF8 that causes error, title of ticket should be changed.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Seems that it is connection charset = UTF8 that causes error, and not only show table but also SHOW VIEW command:

Run #⁠1

C:\MIX>isql -q
SQL> create database 'localhost/3333:c:\temp\c1402b.fdb';
SQL> create view v_test as select d.rdb$relation_id from rdb$database d;
SQL> commit;
SQL> show view v_test;
RDB$RELATION_ID (RDB$RELATION_ID) SMALLINT Nullable
View Source:
==== ======
select d.rdb$relation_id from rdb$database d
SQL> quit;

Run #⁠2

C:\MIX>isql -q
SQL> create database 'localhost/3333:c:\temp\c1402u.fdb' default character set utf8;
SQL> create view v_test as select d.rdb$relation_id from rdb$database d;
SQL> commit;
SQL> show view v_test;
RDB$RELATION_ID (RDB$RELATION_ID) SMALLINT Nullable
View Source:
==== ======
select d.rdb$relation_id from rdb$database d

Run #⁠3

SQL> set names utf8; --- ::: NB :::

SQL> create database 'localhost/3333:c:\temp\c1402u.fdb' default character set utf8;
SQL> create view v_test as select d.rdb$relation_id from rdb$database d;
SQL> commit;
SQL> show view v_test;
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 7, actual 15
Command error: show view v_test
SQL>

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PS. Results of running test core_1402.fbt show that something was broken on build 3.0.0.31768, date = 03-apr-2015.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

This is known and being debugged.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

Test Details: It was connection charset = UTF8 that causes error, title of ticket should be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants