summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/parser.result15
-rw-r--r--mysql-test/main/parser.test16
2 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index 34c119a322e..2e2342161fc 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1770,3 +1770,18 @@ ERROR HY000: Unknown system variable 'password'
SELECT @@GLOBAL.role;
ERROR HY000: Unknown system variable 'role'
End of 10.3 tests
+#
+# MDEV-19540: 10.4 allow lock options with SELECT in brackets
+# which previous version do not
+#
+create table t1 (a int);
+(select * from t1) for update;
+ERROR HY000: Incorrect usage of lock options and SELECT in brackets
+(select * from t1) union (select * from t1) for update;
+ERROR HY000: Incorrect usage of lock options and SELECT in brackets
+(select * from t1 for update);
+a
+select * from t1 for update;
+a
+drop table t1;
+# End of 10.4 tests
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 3a7c4f6467e..35a2334eec2 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1537,3 +1537,19 @@ SELECT @@GLOBAL.password;
SELECT @@GLOBAL.role;
--echo End of 10.3 tests
+
+--echo #
+--echo # MDEV-19540: 10.4 allow lock options with SELECT in brackets
+--echo # which previous version do not
+--echo #
+
+create table t1 (a int);
+--error ER_WRONG_USAGE
+(select * from t1) for update;
+--error ER_WRONG_USAGE
+(select * from t1) union (select * from t1) for update;
+(select * from t1 for update);
+select * from t1 for update;
+drop table t1;
+
+--echo # End of 10.4 tests