summaryrefslogtreecommitdiff
path: root/mysql-test/r/type_timestamp.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/type_timestamp.result')
-rw-r--r--mysql-test/r/type_timestamp.result41
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 38838e72e96..1ec2dfc565f 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -690,4 +690,45 @@ drop table t1;
drop function f1;
set timestamp=0;
SET time_zone=DEFAULT;
+#
+# MDEV-7778 impossible create copy of table, if table contain default value for timestamp field
+#
+SET sql_mode="NO_ZERO_DATE";
+CREATE TABLE t1 (
+ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+CREATE TABLE t2 AS SELECT * from t1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
+SET sql_mode=DEFAULT;
+#
+# MDEV-8082 ON UPDATE is not preserved by CREATE TABLE .. SELECT
+#
+CREATE TABLE t1 (
+vc VARCHAR(10) NOT NULL DEFAULT 'test',
+ts timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
+);
+CREATE TABLE t2 AS SELECT * FROM t1 LIMIT 0;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `vc` varchar(10) NOT NULL DEFAULT 'test',
+ `ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `vc` varchar(10) NOT NULL DEFAULT 'test',
+ `ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
End of 10.0 tests