mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
d4a3d50170
"SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: Check that a binary collation adds 'binary' suffix into a char() column definition in mysql40 and mysql2323 modes. This allows not to lose the column's case sensitivity when loading the dump in pre-4.1 servers. mysql-test/t/sql_mode.test: "SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: mysql-test/r/sql_mode.result: "SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: Check that a binary collation adds 'binary' suffix into a char() column definition in mysql40 and mysql2323 modes. This allows not to lose the column's case sensitivity when loading the dump in pre-4.1 servers. sql/field.cc: "SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: Check that a binary collation adds 'binary' suffix into a char() column definition in mysql40 and mysql2323 modes. This allows not to lose the column's case sensitivity when loading the dump in pre-4.1 servers.
82 lines
2.3 KiB
Text
82 lines
2.3 KiB
Text
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
CREATE TABLE `t1` (
|
|
a int not null auto_increment,
|
|
`pseudo` varchar(35) character set latin2 NOT NULL default '',
|
|
`email` varchar(60) character set latin2 NOT NULL default '',
|
|
PRIMARY KEY (a),
|
|
UNIQUE KEY `email` USING BTREE (`email`)
|
|
) ENGINE=HEAP CHARSET=latin1 ROW_FORMAT DYNAMIC;
|
|
set @@sql_mode="";
|
|
show variables like 'sql_mode';
|
|
show create table t1;
|
|
set @@sql_mode="ansi_quotes";
|
|
show variables like 'sql_mode';
|
|
show create table t1;
|
|
set @@sql_mode="no_table_options";
|
|
show variables like 'sql_mode';
|
|
show create table t1;
|
|
set @@sql_mode="no_key_options";
|
|
show variables like 'sql_mode';
|
|
show create table t1;
|
|
set @@sql_mode="no_field_options,mysql323,mysql40";
|
|
show variables like 'sql_mode';
|
|
show create table t1;
|
|
set sql_mode="postgresql,oracle,mssql,db2,maxdb";
|
|
select @@sql_mode;
|
|
show create table t1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Check that a binary collation adds 'binary'
|
|
# suffix into a char() column definition in
|
|
# mysql40 and mysql2323 modes. This allows
|
|
# not to lose the column's case sensitivity
|
|
# when loading the dump in pre-4.1 servers.
|
|
#
|
|
# Thus, in 4.0 and 3.23 modes we dump:
|
|
#
|
|
# 'char(10) collate xxx_bin' as 'char(10) binary'
|
|
# 'binary(10)' as 'binary(10)'
|
|
#
|
|
# In mysql-4.1 these types are different, and they will
|
|
# be recreated differently.
|
|
#
|
|
# In mysqld-4.0 the the above two types were the same,
|
|
# so it will create a 'char(10) binary' column for both definitions.
|
|
#
|
|
CREATE TABLE t1 (
|
|
a char(10),
|
|
b char(10) collate latin1_bin,
|
|
c binary(10)
|
|
) character set latin1;
|
|
set @@sql_mode="";
|
|
show create table t1;
|
|
set @@sql_mode="mysql323";
|
|
show create table t1;
|
|
set @@sql_mode="mysql40";
|
|
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 ;
|
|
|