summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ps.result6
-rw-r--r--mysql-test/t/ps.test11
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 14af3c32292..d16f24b34c6 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -83,4 +83,10 @@ NULL
NULL
NULL
NULL
+prepare stmt6 from 'select 1; select2';
+ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
+prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1
+explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1
drop table t1;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index ab698174161..dc9f054da0d 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -75,5 +75,16 @@ execute stmt5 using @nullvar;
set @nullvar2=NULL;
execute stmt5 using @nullvar2;
+# Check that multiple SQL statements are disabled inside PREPARE
+--error 1064
+prepare stmt6 from 'select 1; select2';
+
+--error 1064
+prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+
+# This shouldn't parse
+--error 1064
+explain prepare stmt6 from 'insert into t1 values (5,"five"); select2';
+
drop table t1;