summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-10-28 02:54:32 +0400
committerunknown <konstantin@mysql.com>2004-10-28 02:54:32 +0400
commitb97048498a81dc0013261f0a67ae15a14cc7eb76 (patch)
tree7ce942eff8bf991fa80741bca3e5714b69799d03
parentfbabd08534a7b59d3539fd9e7f4a2195c912129c (diff)
downloadmariadb-git-b97048498a81dc0013261f0a67ae15a14cc7eb76.tar.gz
Making the latest fix for Bug#6166 (key.test) work in prepared statements.
sql/sql_prepare.cc: Catch another class of errors possible during yyparse: if thd->net.report_error is set, we need to send the message and abort.
-rw-r--r--sql/sql_prepare.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 5a311eefacd..bccf517466d 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1609,7 +1609,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
lex->safe_to_cache_query= 0;
error= yyparse((void *)thd) || thd->is_fatal_error ||
- init_param_array(stmt);
+ thd->net.report_error || init_param_array(stmt);
/*
While doing context analysis of the query (in send_prepare_results) we
allocate a lot of additional memory: for open tables, JOINs, derived
@@ -1640,7 +1640,9 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
/* Statement map deletes statement on erase */
thd->stmt_map.erase(stmt);
stmt= NULL;
- /* error is sent inside yyparse/send_prepare_results */
+ if (thd->net.report_error)
+ send_error(thd);
+ /* otherwise the error is sent inside yyparse/send_prepare_results */
}
else
{