Commit 47322bf9 authored by unknown's avatar unknown

WL#1622 "SQL Syntax for Prepared Statements" - cosmetic code review fixes


mysql-test/r/ps.result:
  Added check if multiple SQL statements inside a PS are disabled
mysql-test/t/ps.test:
  Added check if multiple SQL statements inside a PS are disabled
parent 85f85a85
......@@ -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;
......@@ -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;
......@@ -1282,7 +1282,7 @@ static void delete_statement_as_hash_key(void *key)
delete (Statement *) key;
}
byte *get_stmt_name_hash_key(Statement *entry, uint *length,
static byte *get_stmt_name_hash_key(Statement *entry, uint *length,
my_bool not_used __attribute__((unused)))
{
*length=(uint) entry->name.length;
......
......@@ -830,7 +830,6 @@ prepare:
lex->prepared_stmt_code= $4;
};
execute:
EXECUTE_SYM ident
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment