summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/innodb-alter.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-07-31 13:51:28 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-07-31 13:51:28 +0300
commit66ec3a770f7854f500ece66c78f3c87c9cd6da15 (patch)
tree0777df9a8dc587b70851c1edc0cfe96895928717 /mysql-test/suite/innodb/t/innodb-alter.test
parent6053eb1ce278ac1f566cd74498506bf457d6d048 (diff)
parentf35d1721039f8f115fc55e8f4b4d2bb4012161d1 (diff)
downloadmariadb-git-66ec3a770f7854f500ece66c78f3c87c9cd6da15.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/suite/innodb/t/innodb-alter.test')
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index 554ae0e3041..df2cd1707dc 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -668,6 +668,28 @@ ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-
SELECT * FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-18042 Server crashes in mysql_alter_table upon adding a non-null
+--echo # date column under NO_ZERO_DATE with ALGORITHM=INPLACE
+--echo #
+
+SET @OLD_SQL_MODE= @@SQL_MODE;
+SET @@SQL_MODE= 'NO_ZERO_DATE';
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=MyISAM;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE;
+
+CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t1 ADD d DATETIME NOT NULL CHECK (f <= 0), ALGORITHM=COPY;
+
+CREATE OR REPLACE TABLE t1 (a int) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN b DATETIME NOT NULL, LOCK=NONE;
+
+--echo # Cleanup
+SET @@SQL_MODE= @OLD_SQL_MODE;
+DROP TABLE t1;
+
#
# End of 10.2 tests
#