summaryrefslogtreecommitdiff
path: root/mysql-test/main/constraints.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-29 08:41:53 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-29 12:00:12 +0300
commit1a3c36595320bd4cf94ba5ab6c5127129269af67 (patch)
tree72954842785e24025db2b2638940251993142989 /mysql-test/main/constraints.test
parente41eb044f19e3ee9b881344565924dd6b9d20e1a (diff)
parent5e9b34191e395ced03fbbbe6aedc07b0a7293984 (diff)
downloadmariadb-git-1a3c36595320bd4cf94ba5ab6c5127129269af67.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/constraints.test')
-rw-r--r--mysql-test/main/constraints.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/main/constraints.test b/mysql-test/main/constraints.test
index d7a5b41d708..2f4dadcee9d 100644
--- a/mysql-test/main/constraints.test
+++ b/mysql-test/main/constraints.test
@@ -116,6 +116,43 @@ SHOW CREATE TABLE t;
DROP table test.t;
SET @@SQL_MODE=@OLD_SQL_MODE;
+--echo #
+--echo # MDEV-16932 - ASAN heap-use-after-free in my_charlen_utf8 /
+--echo # my_well_formed_char_length_utf8 on 2nd execution of SP with
+--echo # ALTER trying to add bad CHECK
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+show create table t1;
+alter table t1 add column b int;
+CALL sp;
+show create table t1;
+CALL sp;
+show create table t1;
+# Cleanup
+DROP PROCEDURE sp;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE sp() ALTER TABLE t1 ADD CONSTRAINT CHECK (b > 0);
+--error ER_BAD_FIELD_ERROR
+CALL sp;
+alter table t1 add column b int, add constraint check (b < 10);
+CALL sp;
+show create table t1;
+# Cleanup
+DROP PROCEDURE sp;
+DROP TABLE t1;
+
+--echo # End of 10.2 tests
+
#
# Check that we don't lose constraints as part of CREATE ... SELECT
#