summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/have_openssl_1.inc2
-rw-r--r--mysql-test/mysql-test-run.sh23
-rw-r--r--mysql-test/r/auto_increment.result10
-rw-r--r--mysql-test/r/create.result7
-rw-r--r--mysql-test/r/ctype_latin1_de.result210
-rw-r--r--mysql-test/r/delete.result15
-rw-r--r--mysql-test/r/func_like.result10
-rw-r--r--mysql-test/r/group_by.result5
-rw-r--r--mysql-test/r/have_openssl_1.require2
-rw-r--r--mysql-test/r/innodb.result17
-rw-r--r--mysql-test/r/join.result23
-rw-r--r--mysql-test/r/lock_multi.result9
-rw-r--r--mysql-test/r/openssl_1.result34
-rw-r--r--mysql-test/r/rpl000001.result2
-rw-r--r--mysql-test/r/rpl_loaddatalocal.result14
-rw-r--r--mysql-test/r/select.result11
-rw-r--r--mysql-test/r/type_datetime.result6
-rw-r--r--mysql-test/r/type_timestamp.result20
-rw-r--r--mysql-test/t/analyse.test5
-rw-r--r--mysql-test/t/auto_increment.test8
-rwxr-xr-xmysql-test/t/backup-master.sh5
-rw-r--r--mysql-test/t/backup.test31
-rw-r--r--mysql-test/t/create.test8
-rw-r--r--mysql-test/t/ctype_latin1_de.test4
-rw-r--r--mysql-test/t/delete.test19
-rw-r--r--mysql-test/t/func_like.test11
-rw-r--r--mysql-test/t/group_by.test11
-rw-r--r--mysql-test/t/innodb.test11
-rw-r--r--mysql-test/t/join.test24
-rw-r--r--mysql-test/t/lock_multi.test21
-rw-r--r--mysql-test/t/openssl_1.test45
-rw-r--r--mysql-test/t/rpl_loaddatalocal.test36
-rw-r--r--mysql-test/t/select.test16
-rw-r--r--mysql-test/t/type_datetime.test5
-rw-r--r--mysql-test/t/type_timestamp.test14
35 files changed, 551 insertions, 143 deletions
diff --git a/mysql-test/include/have_openssl_1.inc b/mysql-test/include/have_openssl_1.inc
index 4d3646abdc2..887309c7e23 100644
--- a/mysql-test/include/have_openssl_1.inc
+++ b/mysql-test/include/have_openssl_1.inc
@@ -1,4 +1,4 @@
-- require r/have_openssl_1.require
disable_query_log;
-show variables like "have_openssl";
+SHOW STATUS LIKE 'Ssl_cipher';
enable_query_log;
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index db1fab7a50d..8e0490f441e 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -208,6 +208,7 @@ DBUSER=""
START_WAIT_TIMEOUT=10
STOP_WAIT_TIMEOUT=10
TEST_REPLICATION=0
+MYSQL_TEST_SSL_OPTS=""
while test $# -gt 0; do
case "$1" in
@@ -238,7 +239,10 @@ while test $# -gt 0; do
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
--ssl-ca=$BASEDIR/SSL/cacert.pem \
--ssl-cert=$BASEDIR/SSL/server-cert.pem \
- --ssl-key=$BASEDIR/SSL/server-key.pem" ;;
+ --ssl-key=$BASEDIR/SSL/server-key.pem"
+ MYSQL_TEST_SSL_OPTS="--ssl-ca=$BASEDIR/SSL/cacert.pem \
+ --ssl-cert=$BASEDIR/SSL/client-cert.pem \
+ --ssl-key=$BASEDIR/SSL/client-key.pem" ;;
--no-manager | --skip-manager) USE_MANAGER=0 ;;
--manager)
USE_MANAGER=1
@@ -330,7 +334,7 @@ while test $# -gt 0; do
USE_RUNNING_SERVER=""
;;
--valgrind)
- VALGRIND="valgrind --alignment=8 --leak-check=yes"
+ VALGRIND="valgrind --alignment=8 --leak-check=yes --num-callers=16"
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc"
SLEEP_TIME_AFTER_RESTART=10
@@ -353,7 +357,8 @@ while test $# -gt 0; do
--debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
--debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace"
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT --debug"
+ EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \
+ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace"
;;
--fast)
FAST_START=1
@@ -493,7 +498,7 @@ fi
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
- --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT"
+ --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS"
MYSQL_TEST_BIN=$MYSQL_TEST
MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS"
GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client
@@ -812,8 +817,8 @@ start_master()
fi
# Remove stale binary logs
$RM -f $MYSQL_TEST_DIR/var/log/master-bin.*
- # Remove old master.info files
- $RM -f $MYSQL_TEST_DIR/var/master-data/master.info
+ # Remove old master.info and relay-log.info files
+ $RM -f $MYSQL_TEST_DIR/var/master-data/master.info $MYSQL_TEST_DIR/var/master-data/relay-log.info
#run master initialization shell script if one exists
@@ -917,7 +922,7 @@ start_slave()
slave_port=`expr $SLAVE_MYPORT + $1`
slave_log="$SLAVE_MYLOG.$1"
slave_err="$SLAVE_MYERR.$1"
- slave_datadir="var/$slave_ident-data/"
+ slave_datadir="$SLAVE_MYDDIR/../$slave_ident-data/"
slave_pid="$MYRUN_DIR/mysqld-$slave_ident.pid"
slave_sock="$SLAVE_MYSOCK-$1"
else
@@ -932,7 +937,7 @@ start_slave()
fi
# Remove stale binary logs and old master.info files
$RM -f $MYSQL_TEST_DIR/var/log/$slave_ident-*bin.*
- $RM -f $MYSQL_TEST_DIR/$slave_datadir/master.info
+ $RM -f $slave_datadir/master.info $slave_datadir/relay-log.info
#run slave initialization shell script if one exists
if [ -f "$slave_init_script" ] ;
@@ -1161,7 +1166,7 @@ run_testcase ()
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
start_master
else
- if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] ;
+ if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || [ -f $master_init_script ]
then
EXTRA_MASTER_OPT=""
stop_master
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 66efd2ba567..e79e6aab56b 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -84,6 +84,16 @@ ordid ord
3 sdj
1 zzz
drop table t1;
+create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id));
+create table t2 (sid char(20), id int(2));
+insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL);
+insert into t1 select * from t2;
+select * from t1;
+sid id
+skr 1
+skr 2
+test 1
+drop table t1,t2;
create table t1 (a int not null primary key auto_increment);
insert into t1 values (0);
update t1 set a=0;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 5228ae50a83..2ec2759ad7a 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -62,6 +62,13 @@ a$1 $b c$
create table test_$1.test2$ (a int);
drop table test_$1.test2$;
drop database test_$1;
+create table `` (a int);
+Incorrect table name ''
+drop table if exists ``;
+Incorrect table name ''
+create table t1 (`` int);
+Incorrect column name ''
+drop table if exists t1;
create table t1 (a int auto_increment not null primary key, B CHAR(20));
insert into t1 (b) values ("hello"),("my"),("world");
create table t2 (key (b)) select * from t1;
diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result
index e5ae6f249ee..b79bc67138c 100644
--- a/mysql-test/r/ctype_latin1_de.result
+++ b/mysql-test/r/ctype_latin1_de.result
@@ -1,93 +1,95 @@
drop table if exists t1;
-create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b));
+create table t1 (a char (20) not null, b int not null auto_increment, index (a,b));
insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb');
insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf');
insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb');
insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa');
insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae');
-insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É');
+insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a');
select a,b from t1 order by a,b;
a b
-a 35
-ac 2
-ad 4
+a 1
+a 2
+ac 1
+ad 1
ä 1
-ae 3
-ää 31
-aeae 33
-ääa 32
-aeb 6
-Äc 5
-é 38
-É 39
-eä 28
-o 37
-oc 15
-od 18
-ö 14
-oe 17
-Öa 16
-oeb 20
-Öc 19
-öo 30
-q 34
-s 21
-ss 22
-ß 23
-ssa 25
-ßa 27
-ßb 24
-ssc 26
-u 36
-uc 8
-ud 10
-ue 9
-Ü 11
-ueb 12
-üc 7
-uf 13
-uü 29
+ae 2
+ää 1
+aeae 2
+ääa 1
+aeb 1
+Äc 1
+é 1
+É 2
+eä 1
+o 1
+oc 1
+od 1
+ö 1
+oe 2
+Öa 1
+oeb 1
+Öc 1
+öo 1
+q 1
+s 1
+ss 1
+ß 2
+ssa 1
+ßa 2
+ßb 1
+ssc 1
+u 1
+uc 1
+ud 1
+ue 1
+Ü 2
+ueb 1
+üc 1
+uf 1
+uü 1
select a,b from t1 order by upper(a),b;
a b
-a 35
-ac 2
-ad 4
+a 1
+a 2
+ac 1
+ad 1
ä 1
-ae 3
-ää 31
-aeae 33
-ääa 32
-aeb 6
-Äc 5
-é 38
-É 39
-eä 28
-o 37
-oc 15
-od 18
-ö 14
-oe 17
-Öa 16
-oeb 20
-Öc 19
-öo 30
-q 34
-s 21
-ss 22
-ß 23
-ssa 25
-ßa 27
-ßb 24
-ssc 26
-u 36
-uc 8
-ud 10
-ue 9
-Ü 11
-ueb 12
-üc 7
-uf 13
-uü 29
+ae 2
+ää 1
+aeae 2
+ääa 1
+aeb 1
+Äc 1
+é 1
+É 2
+eä 1
+o 1
+oc 1
+od 1
+ö 1
+oe 2
+Öa 1
+oeb 1
+Öc 1
+öo 1
+q 1
+s 1
+ss 1
+ß 2
+ssa 1
+ßa 2
+ßb 1
+ssc 1
+u 1
+uc 1
+ud 1
+ue 1
+Ü 2
+ueb 1
+üc 1
+uf 1
+uü 1
select a from t1 order by a desc;
a
@@ -129,44 +131,46 @@ ae
ad
ac
a
+a
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1 where a like "ö%";
a b
-ö 14
-Öa 16
-Öc 19
-öo 30
+ö 1
+Öa 1
+Öc 1
+öo 1
select * from t1 where a like binary "%É%";
a b
-É 39
+É 2
select * from t1 where a like "%Á%";
a b
-a 35
-ac 2
-ad 4
-ae 3
-aeae 33
-ääa 32
-aeb 6
-Öa 16
-ssa 25
-ßa 27
+a 1
+a 2
+ac 1
+ad 1
+ae 2
+aeae 2
+ääa 1
+aeb 1
+Öa 1
+ssa 1
+ßa 2
select * from t1 where a like "%U%";
a b
-u 36
-uc 8
-ud 10
-ue 9
-ueb 12
-uf 13
-uü 29
+u 1
+uc 1
+ud 1
+ue 1
+ueb 1
+uf 1
+uü 1
select * from t1 where a like "%ss%";
a b
-ss 22
-ssa 25
-ssc 26
+ss 1
+ssa 1
+ssc 1
drop table t1;
select strcmp('ä','ae'),strcmp('ae','ä'),strcmp('aeq','äq'),strcmp('äq','aeq');
strcmp('ä','ae') strcmp('ae','ä') strcmp('aeq','äq') strcmp('äq','aeq')
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 4fa85ea9cbc..ee0c3ce1219 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -32,3 +32,18 @@ PRIMARY KEY (`i`)
DELETE FROM t USING t WHERE post='1';
Unknown column 'post' in 'where clause'
drop table if exists t;
+CREATE TABLE t1 (
+bool char(0) default NULL,
+not_null varchar(20) binary NOT NULL default '',
+misc integer not null,
+PRIMARY KEY (not_null)
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
+select * from t1 where misc > 5 and bool is null;
+bool not_null misc
+NULL c 6
+NULL d 7
+delete from t1 where misc > 5 and bool is null;
+select * from t1 where misc > 5 and bool is null;
+bool not_null misc
+drop table t1;
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index c2085ba12da..f923c16b2ac 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -1,10 +1,20 @@
drop table if exists t1;
create table t1 (a varchar(10), key(a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+table type possible_keys key key_len ref rows Extra
+t1 range a a 11 NULL 1 Using where; Using index
+explain select * from t1 where a like concat('abc','%');
+table type possible_keys key key_len ref rows Extra
+t1 range a a 11 NULL 1 Using where; Using index
select * from t1 where a like "abc%";
a
abc
abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
select * from t1 where a like "ABC%";
a
abc
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index e6f3256d779..d13f31d6bef 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -305,6 +305,11 @@ score count(*)
2 1
1 2
drop table t1;
+create table t1 (a date default null, b date default null);
+insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01');
+select a,min(b) c,count(distinct rand()) from t1 group by a having c<a + interval 1 day;
+a c count(distinct rand())
+drop table t1;
CREATE TABLE t1 (a char(1));
INSERT INTO t1 VALUES ('A'),('B'),('A'),('B'),('A'),('B'),(NULL),('a'),('b'),(NULL),('A'),('B'),(NULL);
SELECT a FROM t1 GROUP BY a;
diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require
index dae48a472b5..032b60d544a 100644
--- a/mysql-test/r/have_openssl_1.require
+++ b/mysql-test/r/have_openssl_1.require
@@ -1,2 +1,2 @@
Variable_name Value
-have_openssl YES
+Ssl_cipher EDH-RSA-DES-CBC3-SHA
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 5bc21501eca..0021be10d85 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1073,3 +1073,20 @@ id
select * from t2;
id t1_id
drop table t1,t2;
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
+CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(1, 1);
+SELECT * from t1;
+id
+1
+UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
+SELECT * from t1;
+id
+2
+UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
+SELECT * from t1;
+id
+3
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 274a4dec85d..09b819888eb 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -251,3 +251,26 @@ t1_id t2_id type cost_unit min_value max_value t3_id item_id id name
22 1 Percent Cost 100 -1 6 291 1 s1
23 1 Percent Cost 100 -1 21 291 1 s1
drop table t1,t2;
+CREATE TABLE t1 (
+siteid varchar(25) NOT NULL default '',
+emp_id varchar(30) NOT NULL default '',
+rate_code varchar(10) default NULL,
+UNIQUE KEY site_emp (siteid,emp_id),
+KEY siteid (siteid)
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust');
+CREATE TABLE t2 (
+siteid varchar(25) NOT NULL default '',
+rate_code varchar(10) NOT NULL default '',
+base_rate float NOT NULL default '0',
+PRIMARY KEY (siteid,rate_code),
+FULLTEXT KEY rate_code (rate_code)
+) TYPE=MyISAM;
+INSERT INTO t2 VALUES ('rivercats','cust',20);
+SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats';
+rate_code base_rate
+cust 20
+SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith';
+rate_code base_rate
+cust 20
+drop table t1,t2;
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 20bc9b9572f..b808fca0acf 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1(n int);
insert into t1 values (1);
lock tables t1 write;
@@ -17,3 +17,10 @@ unlock tables;
n
1
drop table t1;
+create table t1 (a int);
+create table t2 (a int);
+lock table t1 write, t2 write;
+ insert t1 select * from t2;
+drop table t2;
+Table 'test.t2' doesn't exist
+drop table t1;
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index b5c67dfbcb0..65b882c0a9b 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -1,2 +1,32 @@
-SHOW STATUS LIKE 'SSL%';
-Variable_name Value
+drop table if exists t1;
+create table t1(f1 int);
+insert into t1 values (5);
+grant select on test.* to ssl_user1@localhost require SSL;
+grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
+grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com";
+grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com";
+flush privileges;
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user1@localhost' to database 'test'
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user2@localhost' to database 'test'
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user3@localhost' to database 'test'
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user4@localhost' to database 'test'
+delete from mysql.user where user='ssl_user%';
+delete from mysql.db where user='ssl_user%';
+flush privileges;
+drop table t1;
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index cc3df4730f2..8aa667df063 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -31,7 +31,7 @@ n
2
select sum(length(word)) from t1;
sum(length(word))
-1021
+1022
drop table t1,t3;
reset master;
stop slave;
diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/r/rpl_loaddatalocal.result
new file mode 100644
index 00000000000..dc98b1b5bfb
--- /dev/null
+++ b/mysql-test/r/rpl_loaddatalocal.result
@@ -0,0 +1,14 @@
+slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+slave start;
+create table t1(a int);
+select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1;
+select a,count(*) from t1 group by a;
+a count(*)
+1 10000
+drop table t1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 9ed54f7c253..a2bf24cad54 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3242,6 +3242,17 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
drop table t4, t3, t2, t1;
DO 1;
DO benchmark(100,1+1),1,1;
+CREATE TABLE t1 (
+id mediumint(8) unsigned NOT NULL auto_increment,
+pseudo varchar(35) NOT NULL default '',
+PRIMARY KEY (id),
+UNIQUE KEY pseudo (pseudo)
+);
+INSERT INTO t1 (pseudo) VALUES ('test');
+INSERT INTO t1 (pseudo) VALUES ('test1');
+SELECT 1 as rnd1 from t1 where rand() > 2;
+rnd1
+DROP TABLE t1;
CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) TYPE=MyISAM;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index cac8cd3d71e..5a9a8699d06 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -78,3 +78,9 @@ EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref expedition expedition 8 const 1 Using where
drop table t1;
+create table t1 (a datetime not null, b datetime not null);
+insert into t1 values (now(), now());
+insert into t1 values (now(), now());
+select * from t1 where a is null or b is null;
+a b
+drop table t1;
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 26dedf544c4..959c69ff6e7 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -84,3 +84,23 @@ date date_time time_stamp
2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00
2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00
drop table t1;
+show variables like 'new';
+Variable_name Value
+new OFF
+create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
+t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
+t14 timestamp(14));
+insert t1 values (0,0,0,0,0,0,0),
+("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
+"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
+"1997-12-31 23:47:59");
+select * from t1;
+t2 t4 t6 t8 t10 t12 t14
+00 0000 000000 00000000 0000000000 000000000000 00000000000000
+97 9712 971231 19971231 9712312347 971231234759 19971231234759
+set new=1;
+select * from t1;
+t2 t4 t6 t8 t10 t12 t14
+0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
+1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
+drop table t1;
diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test
index 117ca40ce54..6aca345b282 100644
--- a/mysql-test/t/analyse.test
+++ b/mysql-test/t/analyse.test
@@ -5,10 +5,11 @@
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
-create table t1 (i int, j int);
-insert into t1 values (1,2), (3,4), (5,6), (7,8);
+create table t1 (i int, j int, empty_string char(10), bool char(1), d date);
+insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05");
select count(*) from t1 procedure analyse();
select * from t1 procedure analyse();
+select * from t1 procedure analyse(2);
create table t2 select * from t1 procedure analyse();
select * from t2;
drop table t1,t2;
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 30979202bd7..d7f67fe80d4 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -54,6 +54,13 @@ insert into t1 values (NULL,'sdj'),(NULL,'sdj'),(NULL,"abc"),(NULL,'abc'),(NULL,
select * from t1;
drop table t1;
+create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id));
+create table t2 (sid char(20), id int(2));
+insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL);
+insert into t1 select * from t2;
+select * from t1;
+drop table t1,t2;
+
#
# Test of auto_increment columns when they are set to 0
#
@@ -64,3 +71,4 @@ update t1 set a=0;
select * from t1;
check table t1;
drop table t1;
+
diff --git a/mysql-test/t/backup-master.sh b/mysql-test/t/backup-master.sh
new file mode 100755
index 00000000000..99da5857afe
--- /dev/null
+++ b/mysql-test/t/backup-master.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+if [ "$MYSQL_TEST_DIR" ]
+then
+ rm -f $MYSQL_TEST_DIR/var/tmp/*.frm $MYSQL_TEST_DIR/var/tmp/*.MY?
+fi
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index 02ef72ef66d..a66c07fd27f 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -1,3 +1,7 @@
+#
+# This test is a bit tricky as we can't use backup table to overwrite an old
+# table
+#
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
@@ -5,13 +9,17 @@ set SQL_LOG_BIN=0;
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
+create table t4(n int);
+--replace_result "errno: 2" "errno: X" "errno: 22" "errno: X" "errno: 23" "errno: X"
+backup table t4 to '../bogus';
+backup table t4 to '../tmp';
+--replace_result "errno: 17" "errno: X"
+backup table t4 to '../tmp';
+drop table t4;
+restore table t4 from '../tmp';
+select count(*) from t4;
+
create table t1(n int);
---replace_result "errno = 1" "errno = X" "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X"
-backup table t1 to '../bogus';
-backup table t1 to '../tmp';
-drop table t1;
-restore table t1 from '../tmp';
-select count(*) from t1;
insert into t1 values (23),(45),(67);
backup table t1 to '../tmp';
drop table t1;
@@ -22,23 +30,24 @@ create table t2(m int not null primary key);
create table t3(k int not null primary key);
insert into t2 values (123),(145),(167);
insert into t3 values (223),(245),(267);
-backup table t1,t2,t3 to '../tmp';
+backup table t2,t3 to '../tmp';
drop table t1,t2,t3;
restore table t1,t2,t3 from '../tmp';
select n from t1;
select m from t2;
select k from t3;
-drop table t1,t2,t3;
+drop table t1,t2,t3,t4;
restore table t1 from '../tmp';
connection con2;
+rename table t1 to t5;
--send
-lock tables t1 write;
+lock tables t5 write;
connection con1;
--send
-backup table t1 to '../tmp';
+backup table t5 to '../tmp';
connection con2;
reap;
unlock tables;
connection con1;
reap;
-drop table t1;
+drop table t5;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 70a589c4be6..98d76bf2883 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -58,6 +58,14 @@ create table test_$1.test2$ (a int);
drop table test_$1.test2$;
drop database test_$1;
+--error 1103
+create table `` (a int);
+--error 1103
+drop table if exists ``;
+--error 1166
+create table t1 (`` int);
+drop table if exists t1;
+
#
# Test of CREATE ... SELECT with indexes
#
diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test
index a4b4b816ec4..e0591913f68 100644
--- a/mysql-test/t/ctype_latin1_de.test
+++ b/mysql-test/t/ctype_latin1_de.test
@@ -4,13 +4,13 @@
--disable_warnings
drop table if exists t1;
--enable_warnings
-create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b));
+create table t1 (a char (20) not null, b int not null auto_increment, index (a,b));
insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb');
insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf');
insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb');
insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa');
insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae');
-insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É');
+insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a');
select a,b from t1 order by a,b;
select a,b from t1 order by upper(a),b;
select a from t1 order by a desc;
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 57321739bfb..af047db04bd 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -46,3 +46,22 @@ CREATE TABLE `t` (
-- error 1054
DELETE FROM t USING t WHERE post='1';
drop table if exists t;
+
+#
+# CHAR(0) bug - not actually DELETE bug, but anyway...
+#
+
+CREATE TABLE t1 (
+ bool char(0) default NULL,
+ not_null varchar(20) binary NOT NULL default '',
+ misc integer not null,
+ PRIMARY KEY (not_null)
+) TYPE=MyISAM;
+
+INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
+
+select * from t1 where misc > 5 and bool is null;
+delete from t1 where misc > 5 and bool is null;
+select * from t1 where misc > 5 and bool is null;
+
+drop table t1;
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index 47590ae7559..90b376e34df 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -8,10 +8,13 @@ drop table if exists t1;
create table t1 (a varchar(10), key(a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
-select * from t1 where a like "abc%";
-select * from t1 where a like "ABC%";
-select * from t1 where a like "test%";
-select * from t1 where a like "te_t";
+explain select * from t1 where a like 'abc%';
+explain select * from t1 where a like concat('abc','%');
+select * from t1 where a like "abc%";
+select * from t1 where a like concat("abc","%");
+select * from t1 where a like "ABC%";
+select * from t1 where a like "test%";
+select * from t1 where a like "te_t";
#
# The following will test the Turbo Boyer-Moore code
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index dfcf72eb2c3..85ec680b3a2 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -78,7 +78,8 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (1,'1970-01-01','1997-10-17 00:00:00',2529,1,21000,11886,'check',0,'F',16200,6);
-!$1056 SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000 AS IsNew FROM t1 AS P JOIN t1 as PP WHERE P.URID = PP.URID GROUP BY method,IsNew;
+--error 1056
+SELECT COUNT(P.URID),SUM(P.amount),P.method, MIN(PP.recdate+0) > 19980501000000 AS IsNew FROM t1 AS P JOIN t1 as PP WHERE P.URID = PP.URID GROUP BY method,IsNew;
drop table t1;
@@ -265,6 +266,14 @@ select sql_big_result score,count(*) from t1 group by score desc;
drop table t1;
#
+
+# not purely group_by bug, but group_by is involved...
+
+create table t1 (a date default null, b date default null);
+insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01');
+select a,min(b) c,count(distinct rand()) from t1 group by a having c<a + interval 1 day;
+drop table t1;
+
# Compare with hash keys
#
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index b8ba55d9230..95a690e56b7 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -717,3 +717,14 @@ delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
select * from t1;
select * from t2;
drop table t1,t2;
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
+CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(1, 1);
+SELECT * from t1;
+UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
+SELECT * from t1;
+UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
+SELECT * from t1;
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index 59c0c37e40d..7840e128ac7 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -248,3 +248,27 @@ CREATE TABLE t2 (
INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5');
select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2;
drop table t1,t2;
+
+#
+# Bug in range optimiser with MAYBE_KEY
+#
+
+CREATE TABLE t1 (
+ siteid varchar(25) NOT NULL default '',
+ emp_id varchar(30) NOT NULL default '',
+ rate_code varchar(10) default NULL,
+ UNIQUE KEY site_emp (siteid,emp_id),
+ KEY siteid (siteid)
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust');
+CREATE TABLE t2 (
+ siteid varchar(25) NOT NULL default '',
+ rate_code varchar(10) NOT NULL default '',
+ base_rate float NOT NULL default '0',
+ PRIMARY KEY (siteid,rate_code),
+ FULLTEXT KEY rate_code (rate_code)
+) TYPE=MyISAM;
+INSERT INTO t2 VALUES ('rivercats','cust',20);
+SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats';
+SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith';
+drop table t1,t2;
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 0c6c59d0444..fa095275182 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -7,7 +7,7 @@
-- source include/not_embedded.inc
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
--enable_warnings
# Test to see if select will get the lock ahead of low priority update
@@ -51,3 +51,22 @@ reap;
connection reader;
reap;
drop table t1;
+
+#
+# Test problem when using locks on many tables and droping a table that
+# is to-be-locked by another thread
+#
+
+connection locker;
+create table t1 (a int);
+create table t2 (a int);
+lock table t1 write, t2 write;
+connection reader;
+send insert t1 select * from t2;
+connection locker;
+drop table t2;
+connection reader;
+--error 1146
+reap;
+connection locker;
+drop table t1;
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 8dfd0d8c2f9..3af7406cef3 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -1,6 +1,43 @@
-# We test openssl. Result set is optimized to be compiled with --with-openssl but
-# SSL is swithced off in some reason
--- source include/have_openssl_2.inc
+# We test openssl. Result set is optimized to be compiled with --with-openssl.
+# Use mysql-test-run with --with-openssl option.
+-- source include/have_openssl_1.inc
-SHOW STATUS LIKE 'SSL%';
+drop table if exists t1;
+create table t1(f1 int);
+insert into t1 values (5);
+grant select on test.* to ssl_user1@localhost require SSL;
+grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
+grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com";
+grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com";
+flush privileges;
+connect (con1,localhost,ssl_user1,,);
+connect (con2,localhost,ssl_user2,,);
+connect (con3,localhost,ssl_user3,,);
+connect (con4,localhost,ssl_user4,,);
+
+connection con1;
+select * from t1;
+--error 1044;
+delete from t1;
+
+connection con2;
+select * from t1;
+--error 1044;
+delete from t1;
+
+connection con3;
+select * from t1;
+--error 1044;
+delete from t1;
+
+connection con4;
+select * from t1;
+--error 1044;
+delete from t1;
+
+connection default;
+delete from mysql.user where user='ssl_user%';
+delete from mysql.db where user='ssl_user%';
+flush privileges;
+drop table t1;
diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/t/rpl_loaddatalocal.test
new file mode 100644
index 00000000000..70f4ab96b6a
--- /dev/null
+++ b/mysql-test/t/rpl_loaddatalocal.test
@@ -0,0 +1,36 @@
+# See if "LOAD DATA LOCAL INFILE" is well replicated
+# (LOAD DATA LOCAL INFILE is not written to the binlog
+# the same way as LOAD DATA INFILE : Append_blocks are smaller).
+# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE :
+# - the loaded file was not written entirely to the master's binlog,
+# only the first 4KB, 8KB or 16KB usually.
+# - the loaded file's first line was not written entirely to the
+# master's binlog (1st char was absent)
+source include/master-slave.inc;
+
+create table t1(a int);
+let $1=10000;
+disable_query_log;
+set SQL_LOG_BIN=0;
+while ($1)
+{
+#eval means expand $ expressions
+ eval insert into t1 values(1);
+ dec $1;
+}
+set SQL_LOG_BIN=1;
+enable_query_log;
+select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1;
+#This will generate a 20KB file, now test LOAD DATA LOCAL
+truncate table t1;
+load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1;
+system rm ./var/master-data/rpl_loaddatalocal.select_outfile ;
+save_master_pos;
+connection slave;
+sync_with_master;
+select a,count(*) from t1 group by a;
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index d4effd2026c..3c26cf1903b 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1722,11 +1722,27 @@ drop table t4, t3, t2, t1;
#
# Test of DO
+#
DO 1;
DO benchmark(100,1+1),1,1;
#
+# random in WHERE clause
+#
+
+CREATE TABLE t1 (
+ id mediumint(8) unsigned NOT NULL auto_increment,
+ pseudo varchar(35) NOT NULL default '',
+ PRIMARY KEY (id),
+ UNIQUE KEY pseudo (pseudo)
+);
+INSERT INTO t1 (pseudo) VALUES ('test');
+INSERT INTO t1 (pseudo) VALUES ('test1');
+SELECT 1 as rnd1 from t1 where rand() > 2;
+DROP TABLE t1;
+
+#
# Test of bug with SUM(CASE...)
#
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index f791cd76d34..e9c45b2908f 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -62,3 +62,8 @@ INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00');
SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
drop table t1;
+create table t1 (a datetime not null, b datetime not null);
+insert into t1 values (now(), now());
+insert into t1 values (now(), now());
+select * from t1 where a is null or b is null;
+drop table t1;
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 1c9275ecd0a..cd76dbe6ab0 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -58,3 +58,17 @@ INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000);
#INSERT INTO t1 VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000);
SELECT * FROM t1;
drop table t1;
+
+show variables like 'new';
+create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
+ t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
+ t14 timestamp(14));
+insert t1 values (0,0,0,0,0,0,0),
+("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
+"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
+"1997-12-31 23:47:59");
+select * from t1;
+set new=1;
+select * from t1;
+drop table t1;
+