mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT.
Added a check to recover from IGNORE_SPACE in this situation: <ident-character(s)><space><dot><ident-character(s)> The ignored space led to the false identification of the dot as an ident separator (like "db.table"). mysql-test/r/sql_mode.result: BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT. Added the test results. mysql-test/t/sql_mode.test: BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT. Added new tests for the bug. sql/sql_lex.cc: BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT. Added code to recover from skipped spaces in mode IGNORE_SPACES, when testing for an ident separator (which happens to be a dot).
This commit is contained in:
@ -28,3 +28,24 @@ set sql_mode="postgresql,oracle,mssql,db2,maxdb";
|
||||
select @@sql_mode;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT
|
||||
#
|
||||
# Force the usage of the default
|
||||
set session sql_mode = '';
|
||||
# statement for comparison, value starts with '.'
|
||||
create table t1 ( min_num dec(6,6) default .000001);
|
||||
show create table t1;
|
||||
drop table t1 ;
|
||||
#
|
||||
set session sql_mode = 'IGNORE_SPACE';
|
||||
# statement for comparison, value starts with '0'
|
||||
create table t1 ( min_num dec(6,6) default 0.000001);
|
||||
show create table t1;
|
||||
drop table t1 ;
|
||||
# This statement fails, value starts with '.'
|
||||
create table t1 ( min_num dec(6,6) default .000001);
|
||||
show create table t1;
|
||||
drop table t1 ;
|
||||
|
||||
|
Reference in New Issue
Block a user