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
It is possible to store string with lenght 31 chars into column varchar(25) [CORE3373] #3739
Comments
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Alpha 1 [ 10331 ] |
Modified by: @asfernandes |
Commented by: @pavel-zotov This ticket has been marked as 'fixed' too early. Also, its no matter how table field is defined: direct definition or via domain. Consider the following script (correct port=3330 and path = 'C:\MIX\firebird\QA\fbt-repo\tmp\c3373-30.fdb' to yours): -------------- start ---------------- --set names utf8; -- ::: NB ::: this line is *** COMMENTED *** in order to have connection charset = NONE show version; set width connection_cset 20; select c.rdb$character_set_name as connection_cset, r.rdb$character_set_name as db_default_cset --recreate table t1(c varchar(25) character set utf8); set term ^; create domain dm_vc25 varchar(25) character set utf8; set width t1_c 32; set count on; insert into t1(c) values ('1234567890123456789012345xxxxxx'); select c as t1_c, char_length(c) t1_charlen, octet_length(c) t1_octlen from t1; insert into t2(c) values ('1234567890123456789012345xxxxxx'); insert into t1 select * from t2; ----------- finish --------------- Run it:C:\MIX\firebird\fb30sc\isql.exe -q -i c3373-30.sql 1>c3373-30.none.log 2>&1 Result:ISQL Version: WI-T3.0.0.31767 Firebird 3.0 Beta 2 CONNECTION_CSET DB_DEFAULT_CSET show table t1; insert into t1(c) values ('1234567890123456789012345xxxxxx'); select c as t1_c, char_length(c) t1_charlen, octet_length(c) t1_octlen from t1; T1_C T1_CHARLEN T1_OCTLEN Records affected: 2 insert into t2(c) values ('1234567890123456789012345xxxxxx'); T2_C T2_CHARLEN T2_OCTLEN Records affected: 2 insert into t1 select * from t2; T1_C T1_CHARLEN T1_OCTLEN Records affected: 4 PS. Good news: if UNCOMMENT line "--set names utf8; " then all OK, no such oddities. |
Commented by: @asfernandes Looks like you mean: "the very simple original test case is failing again", right? |
Modified by: @asfernandesFix Version: 3.0 Alpha 1 [ 10331 ] => |
Commented by: @pavel-zotov > Looks like you mean: "the very simple original test case is failing again", right? Yes, but only when charset of connection is not specified (i.e. = 'NONE'). |
Modified by: @asfernandesstatus: Reopened [ 4 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Beta 2 [ 10586 ] |
Commented by: @pavel-zotov Adriano, is it possibleto backport fix for this ticket into 2.5.5 ? ISQL Version: WI-V2.5.5.26878 Firebird 2.5 CONNECTION_CSET DB_DEFAULT_CSET show table t1; insert into t1(c) values ('1234567890123456789012345xxxxxx'); select c as t1_c, char_length(c) t1_charlen, octet_length(c) t1_octlen from t1; T1_C T1_CHARLEN T1_OCTLEN Records affected: 2 insert into t2(c) values ('1234567890123456789012345xxxxxx'); T2_C T2_CHARLEN T2_OCTLEN Records affected: 2 insert into t1 select * from t2; T1_C T1_CHARLEN T1_OCTLEN Records affected: 4 |
Commented by: @asfernandes It's risky. Recently second fix for this broke tests, and then required changes to gpre and epp preprocessing. This changes many things that could not just be completely checked, but just guessing it's now correct. 3.0 was very bad on this, and I didn't look in 2.5. Linux and Windows were working differently after initial build. And after changes and rebuild in Linux, things works different than initial build. |
Commented by: @pcisar Test created. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Eurosoftware (eurosoftware)
Is duplicated by CORE3669
Is duplicated by CORE3828
Is related to QA560
Test case:
SQL> CREATE DATABASE 'localhost:d:\temp\test1.fdb' user 'sysdba' password 'masterkey' default character set UTF8;
SQL> create table t (c varchar(25));
SQL> insert into t(c) values ('1234567890123456789012345xxxxxx');
SQL> select * from t;
C
1234567890123456789012345xxxxxx
Commits: a1a745b c7ea4a1 FirebirdSQL/fbt-repository@326962a
The text was updated successfully, but these errors were encountered: