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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0af6e68a
Commit
0af6e68a
authored
Sep 29, 2005
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1-4100
into mysql.com:/home/mydev/mysql-5.0-5000
parents
36edcbf4
5c93e799
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
11 deletions
+45
-11
mysql-test/r/merge.result
mysql-test/r/merge.result
+3
-3
mysql-test/r/sql_mode.result
mysql-test/r/sql_mode.result
+23
-3
mysql-test/t/merge.test
mysql-test/t/merge.test
+1
-1
mysql-test/t/sql_mode.test
mysql-test/t/sql_mode.test
+12
-0
sql/sql_show.cc
sql/sql_show.cc
+6
-4
No files found.
mysql-test/r/merge.result
View file @
0af6e68a
...
...
@@ -669,15 +669,15 @@ b varchar(10),
index (a,b)
) engine=myisam;
insert into t2 values ( null, '');
insert into t2 values ( 9999999999.999
9
, '');
insert into t2 values ( 9999999999.999, '');
insert into t3 select * from t2;
select min(a), max(a) from t1;
min(a) max(a)
9999999999.999
9 9999999999.9999
9999999999.999
0 9999999999.9990
flush tables;
select min(a), max(a) from t1;
min(a) max(a)
9999999999.999
9 9999999999.9999
9999999999.999
0 9999999999.9990
drop table t1, t2, t3;
create table t1 (a int,b int,c int, index (a,b,c));
create table t2 (a int,b int,c int, index (a,b,c));
...
...
mysql-test/r/sql_mode.result
View file @
0af6e68a
...
...
@@ -65,7 +65,7 @@ sql_mode NO_FIELD_OPTIONS,MYSQL323,MYSQL40,HIGH_NOT_PRECEDENCE
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
auto_increment
,
`a` int(11) NOT NULL,
`pseudo` varchar(35) NOT NULL default '',
`email` varchar(60) NOT NULL default '',
PRIMARY KEY (`a`),
...
...
@@ -79,8 +79,8 @@ show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"a" int(11) NOT NULL,
"pseudo" varchar(35) NOT NULL default '',
"email" varchar(60) NOT NULL default '',
"pseudo" varchar(35)
character set latin2
NOT NULL default '',
"email" varchar(60)
character set latin2
NOT NULL default '',
PRIMARY KEY ("a"),
UNIQUE KEY "email" ("email")
)
...
...
@@ -140,6 +140,26 @@ t1 CREATE TABLE `t1` (
drop table t1 ;
set @@SQL_MODE=NULL;
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL'
set session sql_mode=ansi;
create table t1
(f1 integer auto_increment primary key,
f2 timestamp default current_timestamp on update current_timestamp);
show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"f1" int(11) NOT NULL auto_increment,
"f2" timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY ("f1")
)
set session sql_mode=no_field_options;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`f1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='';
show local variables like 'SQL_MODE';
Variable_name Value
...
...
mysql-test/t/merge.test
View file @
0af6e68a
...
...
@@ -314,7 +314,7 @@ create table t3 (
)
engine
=
myisam
;
insert
into
t2
values
(
null
,
''
);
insert
into
t2
values
(
9999999999.999
9
,
''
);
insert
into
t2
values
(
9999999999.999
,
''
);
insert
into
t3
select
*
from
t2
;
select
min
(
a
),
max
(
a
)
from
t1
;
flush
tables
;
...
...
mysql-test/t/sql_mode.test
View file @
0af6e68a
...
...
@@ -86,6 +86,18 @@ drop table t1 ;
--
error
1231
set
@@
SQL_MODE
=
NULL
;
#
# Bug #797: in sql_mode=ANSI, show create table ignores auto_increment
#
set
session
sql_mode
=
ansi
;
create
table
t1
(
f1
integer
auto_increment
primary
key
,
f2
timestamp
default
current_timestamp
on
update
current_timestamp
);
show
create
table
t1
;
set
session
sql_mode
=
no_field_options
;
show
create
table
t1
;
drop
table
t1
;
# End of 4.1 tests
#
...
...
sql/sql_show.cc
View file @
0af6e68a
...
...
@@ -794,7 +794,8 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
field
->
sql_type
(
type
);
packet
->
append
(
type
.
ptr
(),
type
.
length
(),
system_charset_info
);
if
(
field
->
has_charset
()
&&
!
limited_mysql_mode
&&
!
foreign_db_mode
)
if
(
field
->
has_charset
()
&&
!
(
thd
->
variables
.
sql_mode
&
(
MODE_MYSQL323
|
MODE_MYSQL40
)))
{
if
(
field
->
charset
()
!=
share
->
table_charset
)
{
...
...
@@ -833,7 +834,7 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
has_default
=
(
field
->
type
()
!=
FIELD_TYPE_BLOB
&&
!
(
field
->
flags
&
NO_DEFAULT_VALUE_FLAG
)
&&
field
->
unireg_check
!=
Field
::
NEXT_NUMBER
&&
!
((
foreign_db_mode
||
limited_mysql_mode
)
&&
!
((
thd
->
variables
.
sql_mode
&
(
MODE_MYSQL323
|
MODE_MYSQL40
)
)
&&
has_now_default
));
if
(
has_default
)
...
...
@@ -863,12 +864,13 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
packet
->
append
(
tmp
);
}
if
(
!
foreign_db_mode
&&
!
limited_mysql_mode
&&
if
(
!
(
thd
->
variables
.
sql_mode
&
MODE_NO_FIELD_OPTIONS
)
&&
table
->
timestamp_field
==
field
&&
field
->
unireg_check
!=
Field
::
TIMESTAMP_DN_FIELD
)
packet
->
append
(
" on update CURRENT_TIMESTAMP"
,
28
);
if
(
field
->
unireg_check
==
Field
::
NEXT_NUMBER
&&
!
foreign_db_mode
)
if
(
field
->
unireg_check
==
Field
::
NEXT_NUMBER
&&
!
(
thd
->
variables
.
sql_mode
&
MODE_NO_FIELD_OPTIONS
))
packet
->
append
(
" auto_increment"
,
15
);
if
(
field
->
comment
.
length
)
...
...
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