summaryrefslogtreecommitdiff
path: root/mysql-test/suite/vcol
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-10-18 15:14:39 +0200
committerSergei Golubchik <serg@mariadb.org>2017-10-18 15:14:39 +0200
commitda4503e956ee067947e504c6e73052d9d906742c (patch)
treea70bbc33f0411ef29c347a570d8253445d8013e4 /mysql-test/suite/vcol
parentbabbf8c6fc6da92cd1b2bb23f04e996f84b0ca1a (diff)
parentb000e169562697aa072600695d4f0c0412f94f4f (diff)
downloadmariadb-git-da4503e956ee067947e504c6e73052d9d906742c.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysql-test/suite/vcol')
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result19
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test20
2 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 699b6d4efe3..0a8d87dc2f7 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -337,3 +337,22 @@ tsv timestamp as (adddate(ts, interval 1 day)) virtual
);
drop table t1;
set sql_mode=default;
+#
+# MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value
+#
+SET sql_mode='NO_ZERO_IN_DATE';
+CREATE TABLE t1
+(
+a datetime DEFAULT NULL,
+b datetime DEFAULT NULL,
+c time GENERATED ALWAYS AS (timediff(`a`,`b`)) VIRTUAL
+);
+INSERT INTO t1 VALUES ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',DEFAULT);
+SELECT * FROM t1;
+a b c
+2008-12-31 23:59:59 2008-12-30 01:01:01 46:58:58
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 80a36d9c623..1ac0b4f80b7 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -301,3 +301,23 @@ create table t1 (
);
drop table t1;
set sql_mode=default;
+
+--echo #
+--echo # MDEV-11819 NO_ZERO_IN_DATE: Incorrect generated column value
+--echo #
+
+SET sql_mode='NO_ZERO_IN_DATE';
+CREATE TABLE t1
+(
+ a datetime DEFAULT NULL,
+ b datetime DEFAULT NULL,
+ c time GENERATED ALWAYS AS (timediff(`a`,`b`)) VIRTUAL
+);
+INSERT INTO t1 VALUES ('2008-12-31 23:59:59.000001','2008-12-30 01:01:01.000002',DEFAULT);
+SELECT * FROM t1;
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+
+--echo #
+--echo # End of 5.5 tests
+--echo #