summaryrefslogtreecommitdiff
path: root/mysql-test/t/check_constraint.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-04-01 15:58:29 +0200
committerSergei Golubchik <serg@mariadb.org>2017-04-01 18:59:29 +0200
commit22d8bb27066fa841548d57b6d110162093be535a (patch)
tree64e6fa8f28d7dfb692506a319cc196afc1b16289 /mysql-test/t/check_constraint.test
parent6315426565590982b096344df61cae4b64ab2eb0 (diff)
downloadmariadb-git-22d8bb27066fa841548d57b6d110162093be535a.tar.gz
MDEV-12421 Check constraint with query crashes server and renders DB unusable
parse CHECK constraint *before* Column_definition validity checks
Diffstat (limited to 'mysql-test/t/check_constraint.test')
-rw-r--r--mysql-test/t/check_constraint.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/t/check_constraint.test b/mysql-test/t/check_constraint.test
index 7c5d30b6cd3..437463ee457 100644
--- a/mysql-test/t/check_constraint.test
+++ b/mysql-test/t/check_constraint.test
@@ -86,3 +86,11 @@ create table t1 (a int, b int, check(a>0));
--error ER_BAD_FIELD_ERROR
alter table t1 drop column a;
drop table t1;
+
+#
+# MDEV-12421 Check constraint with query crashes server and renders DB unusable
+#
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a int check (@b in (select user from mysql.user)));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a int check (a > @b));