diff options
author | unknown <bell@sanja.is.com.ua> | 2004-02-12 11:12:16 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-02-12 11:12:16 +0200 |
commit | 0f0ca5e35bdd97602f6fbf912737823200835c25 (patch) | |
tree | 392565075b89db4af8addc318bdbdbf2349ebce8 /sql/sql_prepare.cc | |
parent | 4b37cf65f7d9d83005fd73dc05fae39639303f24 (diff) | |
parent | f2753fe9ac04edac1e8b968d29e77178b4e8c0a5 (diff) | |
download | mariadb-git-0f0ca5e35bdd97602f6fbf912737823200835c25.tar.gz |
merge
sql/item.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 2cc90601052..34ccb67cda9 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -926,7 +926,15 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length) lex->safe_to_cache_query= 0; lex->param_count= 0; - if (yyparse((void *)thd) || thd->is_fatal_error || send_prepare_results(stmt)) + if (yyparse((void *)thd) || thd->is_fatal_error || + /* + Check for wrong (too big) length passed to mysql_prepare() resulting in + garbage at the end of the query. There is a similar check in mysql_parse(). + */ + (!thd->lex->found_colon && + (char*)(thd->lex->ptr) != (thd->query+thd->query_length+1) && + /* yyerror() will show the garbage chars to the user */ + (yyerror("syntax error"), 1)) || send_prepare_results(stmt)) goto yyparse_err; lex_end(lex); |