Issue Details (XML | Word | Printable)

Key: CORE-4782
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Pavel Zotov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Command `SHOW TABLE` fails when the table contains field with unicode collationin its DDL

Created: 06/May/15 01:31 PM   Updated: 27/May/15 06:51 PM
Component/s: Charsets/Collation
Affects Version/s: None
Fix Version/s: 3.0 Beta 2

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


 Description  « Hide
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 ?

 All   Comments   Change History   Subversion Commits      Sort Order: Descending order - Click to sort in ascending order
Dmitry Yemanov added a comment - 06/May/15 06:27 PM
This is known and being debugged.

Pavel Zotov added a comment - 06/May/15 06:18 PM
PS. Results of running test core_1402.fbt show that something was broken on build 3.0.0.31768, date = 03-apr-2015.

Pavel Zotov added a comment - 06/May/15 05:59 PM
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>