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

Field name max length check wrongly if national characters specified [CORE5802] #6064

Closed
firebird-automations opened this issue Apr 19, 2018 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @livius2

Database WIN1250 (if matter)

---------------------OK------------------------------

SELECT 1 AS "Suma wszystkich INSP_ID rosnącoo" FROM RDB$DATABASE

---------------------------------------------------
SQL error code = -104

Name longer than database column size. =>

-----------------------WRONG----------------------------

SELECT 1 AS "Suma wszystkich INSP_ID rosnąco" FROM RDB$DATABASE

---------------------------------------------------

arithmetic exception, numeric overflow, or string truncation

string right truncation

expected length 31, actual 31.

---------------------------------------------------

Commits: 1d5f6b4

@firebird-automations
Copy link
Collaborator Author

Modified by: @livius2

summary: Field name length check wrongly on max bound if national characters specified => Field name max length check wrongly if national characters specified

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Please test FB 4 snapshot.

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

it looks ok under current FB4 snapshot

//this run ok
SELECT 1 AS "Suma wszystkich INSP_ID rosnącooooooooooooooooooooooooooooooooo" FROM RDB$DATABASE

//Name longer than database column size
//At line 1, column 13
SELECT 1 AS "Suma wszystkich INSP_ID rosnącoooooooooooooooooooooooooooooooooo" FROM RDB$DATABASE

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Any progress with fix this bug in 3.0.x ?
I see that it still has a problem:
1. Create .sql:

set names win1251;
shell del c:\temp\tmp4test.fdb 2>nul;
create database 'localhost:c:\temp\tmp4test.fdb' user 'SYSDBA' password 'masterkey' default character set win1251;
show version;
set list on;
set sqlda_display on;
set echo on;
select 1 as "СъешьЖеЕщёЭтихМягкихФранкоБулок" from rdb$database;

2. Run cmd.exe, change there code page to 1251

3. Run script two times:
3.1. On 2.5:

C:\FBTESTING\qa\misc>C:\FB\25sC\bin\isql -q -i c5802.sql
ISQL Version: WI-V2.5.9.27149 Firebird 2.5
Server version:
Firebird/x86-64/Windows NT (access method), version "WI-V2.5.9.27149 Firebird 2.5"
Firebird/x86-64/Windows NT (remote server), version "WI-V2.5.9.27149 Firebird 2.5/tcp (Image-PC1)/P12"
Firebird/x86-64/Windows NT (remote interface), version "WI-V2.5.9.27149 Firebird 2.5/tcp (Image-PC1)/P12"
on disk structure version 11.2
select 1 as "СъешьЖеЕщёЭтихМягкихФранкоБулок" from rdb$database;

INPUT SQLDA version: 1 sqln: 10 sqld: 0

OUTPUT SQLDA version: 1 sqln: 20 sqld: 1
01: sqltype: 496 LONG sqlscale: 0 sqlsubtype: 0 sqllen: 4
: name: (8)CONSTANT alias: (31)СъешьЖеЕщёЭтихМягкихФранкоБулок
: table: (0) owner: (0)

СъешьЖеЕщёЭтихМягкихФранкоБулок 1

3.2. On 3.0.x:

C:\FBTESTING\qa\misc>C:\FB\30ss\isql -q -i c5802.sql
ISQL Version: WI-V3.0.5.33215 Firebird 3.0
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-V3.0.5.33215 Firebird 3.0"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-V3.0.5.33215 Firebird 3.0/tcp (Image-PC1)/P15"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-V3.0.5.33215 Firebird 3.0/tcp (Image-PC1)/P15"
on disk structure version 12.0
select 1 as "СъешьЖеЕщёЭтихМягкихФранкоБулок" from rdb$database;
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 31, actual 31 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ???
After line 7 in file c5802.sql

So, the question is: whether it is allowed in FB 3.x to use columns with len = 31 and being encoded in single-byte codepage like win-1251 ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

It cannot be fixed in v3, but I now improved the error message to both be "Name longer than database column size".

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

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