summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorsergefp@mysql.com <>2004-05-21 04:27:50 +0400
committersergefp@mysql.com <>2004-05-21 04:27:50 +0400
commitfb17025b3ea4983feec4498ab1f807b22a95d099 (patch)
treea744f3804c5f4a55fabbc3344ef1ec8b1c9e3b52 /mysql-test
parent3711c98b2ad162ff3f4694c6cedfd2d7c2c22aab (diff)
downloadmariadb-git-fb17025b3ea4983feec4498ab1f807b22a95d099.tar.gz
WL#1622 "SQL Syntax for Prepared Statements": Post-review fixes (1 of 2)
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ps.result16
-rw-r--r--mysql-test/t/ps.test17
2 files changed, 32 insertions, 1 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index fc82645840c..6c228327b8d 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -21,7 +21,7 @@ a b
2 two
3 three
deallocate prepare no_such_statement;
-ERROR HY000: Undefined prepared statement
+ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEALLOCATE PREPARE
execute stmt1;
ERROR HY000: Wrong arguments to mysql_execute
prepare stmt2 from 'prepare nested_stmt from "select 1"';
@@ -98,4 +98,18 @@ set @arg00=NULL ;
prepare stmt1 from 'select 1 FROM t2 where a=?' ;
execute stmt1 using @arg00 ;
1
+prepare stmt1 from @nosuchvar;
+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 'NULL' at line 1
+set @ivar= 1234;
+prepare stmt1 from @ivar;
+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 '1234' at line 1
+set @fvar= 123.4567;
+prepare stmt1 from @fvar;
+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 '123.4567' at line 1
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using ucs2);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+?
+1234
drop table t1,t2;
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 989dc6026fe..d9e0f0852c5 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -98,5 +98,22 @@ set @arg00=NULL ;
prepare stmt1 from 'select 1 FROM t2 where a=?' ;
execute stmt1 using @arg00 ;
+# prepare using variables:
+--error 1064
+prepare stmt1 from @nosuchvar;
+
+set @ivar= 1234;
+--error 1064
+prepare stmt1 from @ivar;
+
+set @fvar= 123.4567;
+--error 1064
+prepare stmt1 from @fvar;
+
+set @str1 = 'select ?';
+set @str2 = convert(@str1 using ucs2);
+prepare stmt1 from @str2;
+execute stmt1 using @ivar;
+
drop table t1,t2;