Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b993de89
Commit
b993de89
authored
Sep 14, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1
into mysql.com:/home/mydev/mysql-4.1-bug5318
parents
92cca4f0
efba2225
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
+48
-2
mysql-test/r/sql_mode.result
mysql-test/r/sql_mode.result
+23
-0
mysql-test/t/sql_mode.test
mysql-test/t/sql_mode.test
+21
-0
sql/sql_lex.cc
sql/sql_lex.cc
+4
-2
No files found.
mysql-test/r/sql_mode.result
View file @
b993de89
...
...
@@ -85,3 +85,26 @@ t1 CREATE TABLE "t1" (
UNIQUE KEY "email" ("email")
)
drop table t1;
set session sql_mode = '';
create table t1 ( min_num dec(6,6) default .000001);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`min_num` decimal(7,6) default '0.000001'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1 ;
set session sql_mode = 'IGNORE_SPACE';
create table t1 ( min_num dec(6,6) default 0.000001);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`min_num` decimal(7,6) default '0.000001'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1 ;
create table t1 ( min_num dec(6,6) default .000001);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`min_num` decimal(7,6) default '0.000001'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1 ;
mysql-test/t/sql_mode.test
View file @
b993de89
...
...
@@ -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
;
sql/sql_lex.cc
View file @
b993de89
...
...
@@ -454,6 +454,7 @@ inline static uint int_token(const char *str,uint length)
int
yylex
(
void
*
arg
,
void
*
yythd
)
{
reg1
uchar
c
;
bool
space_ignored
;
int
tokval
,
result_state
;
uint
length
;
enum
my_lex_states
state
;
...
...
@@ -572,11 +573,12 @@ int yylex(void *arg, void *yythd)
result_state
=
result_state
&
0x80
?
IDENT_QUOTED
:
IDENT
;
}
length
=
(
uint
)
(
lex
->
ptr
-
lex
->
tok_start
)
-
1
;
space_ignored
=
FALSE
;
if
(
lex
->
ignore_space
)
{
for
(;
state_map
[
c
]
==
MY_LEX_SKIP
;
c
=
yyGet
());
for
(;
state_map
[
c
]
==
MY_LEX_SKIP
;
space_ignored
=
TRUE
,
c
=
yyGet
());
}
if
(
c
==
'.'
&&
ident_map
[
yyPeek
()])
if
(
!
space_ignored
&&
c
==
'.'
&&
ident_map
[
yyPeek
()])
lex
->
next_state
=
MY_LEX_IDENT_SEP
;
else
{
// '(' must follow directly if function
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment