Maximal length of user attribute (first-, middle- and lastname) can not exceed 
32 OCTETS (rather than CHARACTERS) on FB-3, 31 octets on FB 2.5
----------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-5079
                 URL: http://tracker.firebirdsql.org/browse/CORE-5079
             Project: Firebird Core
          Issue Type: Bug
          Components: Charsets/Collation, Engine, Security
    Affects Versions: 2.5.5, 3.0 RC1
            Reporter: Pavel Zotov


Consider following script:
####################
shell del C:\MIX\firebird\QA\fbt-repo\c0856.fdb 2>nul;
set names utf8;
create database 'localhost/3333:C:\MIX\firebird\QA\fbt-repo\c0856.fdb' user 
'SYSDBA' password 'masterke';
-- show table sec$users;
commit;

set echo on;
create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3è' -- octet_length = 32
;

create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3∑'-- octet_length = 33
;


create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3.è' -- octet_length = 33
;
####################

Its running will issue:

1) on  WI-V2.5.6.26963:
===
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-unknown ISC error 335545033
After line 3 in file c0856.sql
Command error: show table sec$users
create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3è' -- octet_length = 32
;

create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3∑'-- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error

create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3.è' -- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error
===

2) on WI-V3.0.0.32281:
===
create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3è' -- octet_length = 32
;

create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3∑'-- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error

create or alter user tmp$c0856 password '123' 
firstname '....:....1....:....2....:....3.è' -- octet_length = 33
;
Statement failed, SQLSTATE = HY000
modify record error
===

But:

1) on 2.5:
SQL> show table rdb$users;

RDB$USER_NAME                   (RDB$USER_NAME) VARCHAR(128) CHARACTER SET 
UNICODE_FSS Not Null
. . .
RDB$FIRST_NAME                  (RDB$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable DEFAULT _UNICODE_FSS ''
RDB$MIDDLE_NAME                 (RDB$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable DEFAULT _UNICODE_FSS ''
RDB$LAST_NAME                   (RDB$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable DEFAULT _UNICODE_FSS ''
. . .

2) on 3.0:

SQL> show table sec$users;

SEC$USER_NAME                   (RDB$USER) CHAR(31) CHARACTER SET UNICODE_FSS 
Nullable 
SEC$FIRST_NAME                  (SEC$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable 
SEC$MIDDLE_NAME                 (SEC$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable 
SEC$LAST_NAME                   (SEC$NAME_PART) VARCHAR(32) CHARACTER SET 
UNICODE_FSS Nullable 
. . .


PS. As reference. 
Each of following characters requires:

1) čřžéèêάëïüäöüêŝçęđøłŲĖŪґůőűčž    --  two bytes for symbol;

2) ∑∫≈    -- three bytes for symbol.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to