summaryrefslogtreecommitdiff
path: root/mysql-test/t/default.test
diff options
context:
space:
mode:
authorJacob Mathew <jacob.mathew@mariadb.com>2017-04-18 17:36:05 -0700
committerJacob Mathew <jacob.mathew@mariadb.com>2017-04-18 17:36:05 -0700
commit0b52b28b91eac1018d865f2f918b83c416565f2f (patch)
tree1c6be57c366715e0aa134e225e60c1604029eecc /mysql-test/t/default.test
parent38af34bb2143f2a7ce82d2e241d8995f419a7f29 (diff)
downloadmariadb-git-bb-10.2-MDEV-10355.tar.gz
MDEV-10355 Weird error message upon CREATE TABLE with DEFAULTbb-10.2-MDEV-10355
Fixed handling of default values with cached temporal functions so that the CREATE TABLE statement now succeeds. Fixed virtual column session cleanup. Fixed the error message. Added quoting of date/time values in cases when this was omitted. Added a test case in default.test. Updated test result files.
Diffstat (limited to 'mysql-test/t/default.test')
-rw-r--r--mysql-test/t/default.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test
index 85f99806fc9..84ef620de04 100644
--- a/mysql-test/t/default.test
+++ b/mysql-test/t/default.test
@@ -1289,6 +1289,20 @@ INSERT INTO t1 (a,b) VALUES ('2003-02-01','2003-05-01 12:05:55');
SELECT * FROM t1;
DROP TABLE t1;
+#
+# MDEV-10355 Weird error message upon CREATE TABLE with DEFAULT
+#
+# Column default value expression that includes a temporal function
+#
+CREATE OR REPLACE TABLE t1 ( col INT DEFAULT ( 1 LIKE ( NOW() BETWEEN '2000-01-01' AND '2012-12-12' ) ) );
+SHOW CREATE TABLE t1;
+SET timestamp = UNIX_TIMESTAMP( '2004-04-04' );
+INSERT INTO t1 VALUES( DEFAULT );
+SET timestamp = DEFAULT;
+INSERT INTO t1 VALUES( DEFAULT );
+SELECT * FROM t1;
+DROP TABLE t1;
+
--echo #
--echo # Hybrid type functions