summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2004-04-27 03:44:41 +0400
committerunknown <sergefp@mysql.com>2004-04-27 03:44:41 +0400
commit978ba8f47ef6adf41c5a9eb75cc927c3aa1b8e69 (patch)
treee26205820dce9563bbb1bde4b6d57634a9e288cf /sql/sql_lex.cc
parentc41919f3583aa40645cc10571718b39091980c25 (diff)
downloadmariadb-git-978ba8f47ef6adf41c5a9eb75cc927c3aa1b8e69.tar.gz
Fix for BUG#3567: Disallow several SQL statements inside a Prepared Statement.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index d16e1f87085..66e2782dd84 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -882,10 +882,12 @@ int yylex(void *arg, void *yythd)
case MY_LEX_COLON: // optional line terminator
if (yyPeek())
{
- if (((THD *)yythd)->client_capabilities & CLIENT_MULTI_STATEMENTS)
+ THD* thd= (THD*)yythd;
+ if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) &&
+ (thd->command != COM_PREPARE))
{
lex->found_colon=(char*)lex->ptr;
- ((THD *)yythd)->server_status |= SERVER_MORE_RESULTS_EXISTS;
+ thd->server_status |= SERVER_MORE_RESULTS_EXISTS;
lex->next_state=MY_LEX_END;
return(END_OF_INPUT);
}