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

Hex number used at end of statement (for exame with CREATE DOMAIN ... DEFAULT) may read invalid memory and produce wrong values or exceptions [CORE6290] #6532

Closed
firebird-automations opened this issue Apr 23, 2020 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Run this script:

set echo on;
shell del c:\temp\tmp4test.fdb 2>nul;
create database 'localhost:c:\temp\tmp4test.fdb' user sysdba password 'masterkey';

create domain dm_test_a as double precision default 99999999;
create domain dm_test_b as bigint default 0xf0000000;
----------------------------------------------------------------
create domain dm_test_c as double precision default 100000000;
create domain dm_test_d as bigint default 0xf0000000;
----------------------------------------------------------------
create domain dm_test_e as int default 1;
create domain dm_test_f as bigint default 0xf0000000;

commit;
show domain;

Output in WI-V3.0.6.33288 and WI-T4.0.0.1926 is the same (except show domain elements position):

#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠
create domain dm_test_a as double precision default 99999999;

create domain dm_test_b as bigint default 0xf0000000;

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

create domain dm_test_c as double precision default 100000000;

create domain dm_test_d as bigint default 0xf0000000;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 44
-xf0000000
At line 12 in file dd.sql

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

create domain dm_test_e as int default 1;

create domain dm_test_f as bigint default 0xf0000000;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 44
-xf0000000
At line 18 in file dd.sql

commit;
show domain;
DM_TEST_A DM_TEST_B
DM_TEST_C DM_TEST_E
#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠#⁠

Commits: c2f132a df23e50

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 3.0.5 [ 10885 ]

Version: 4.0 Beta 1 [ 10750 ]

summary: CREATE DOMAIN can not use DEFAULT clause with HEX literal if another domain has been created before this statement => Hex number used at end of statement (for exame with CREATE DOMAIN ... DEFAULT) may read invalid memory and produce wrong values or exceptions

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

Fix Version: 3.0.6 [ 10889 ]

@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