diff options
author | unknown <malff/marcsql@weblab.(none)> | 2006-08-22 18:58:14 -0700 |
---|---|---|
committer | unknown <malff/marcsql@weblab.(none)> | 2006-08-22 18:58:14 -0700 |
commit | 09e9b2f6cd92d7a75dfb6e46fadd9be2c326c8f5 (patch) | |
tree | ccb7b9e5ad7613314c628d26a562ee256754cb0c /sql/protocol.cc | |
parent | 5e1039b23477ade8df5948a15766217cac6a8d68 (diff) | |
download | mariadb-git-09e9b2f6cd92d7a75dfb6e46fadd9be2c326c8f5.tar.gz |
Bug#8153 (Stored procedure with subquery and continue handler, wrong result)
Implemented code review comments
Test cleanup
sql/protocol.cc:
Bug#8153 (Stored procedure with subquery and continue handler, wrong result)
Implemented code review comments
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index c6cacf978ea..5de24ebdcb3 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -53,8 +53,18 @@ bool Protocol_prep::net_store_data(const char *from, uint length) } - /* Send a error string to client */ +/* + Send a error string to client + + Design note: + net_printf_error and net_send_error are low-level functions + that shall be used only when a new connection is being + established or at server startup. + For SIGNAL/RESIGNAL and GET DIAGNOSTICS functionality it's + critical that every error that can be intercepted is issued in one + place only, my_message_sql. +*/ void net_send_error(THD *thd, uint sql_errno, const char *err) { NET *net= &thd->net; @@ -64,6 +74,8 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) err ? err : net->last_error[0] ? net->last_error : "NULL")); + DBUG_ASSERT(!thd->spcont); + if (net && net->no_send_error) { thd->clear_error(); @@ -71,12 +83,6 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) DBUG_VOID_RETURN; } - if (thd->spcont && - thd->spcont->handle_error(sql_errno, MYSQL_ERROR::WARN_LEVEL_ERROR, thd)) - { - DBUG_VOID_RETURN; - } - thd->query_error= 1; // needed to catch query errors during replication if (!err) { @@ -117,6 +123,15 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) Write error package and flush to client It's a little too low level, but I don't want to use another buffer for this + + Design note: + + net_printf_error and net_send_error are low-level functions + that shall be used only when a new connection is being + established or at server startup. + For SIGNAL/RESIGNAL and GET DIAGNOSTICS functionality it's + critical that every error that can be intercepted is issued in one + place only, my_message_sql. */ void @@ -136,6 +151,8 @@ net_printf_error(THD *thd, uint errcode, ...) DBUG_ENTER("net_printf_error"); DBUG_PRINT("enter",("message: %u",errcode)); + DBUG_ASSERT(!thd->spcont); + if (net && net->no_send_error) { thd->clear_error(); @@ -143,12 +160,6 @@ net_printf_error(THD *thd, uint errcode, ...) DBUG_VOID_RETURN; } - if (thd->spcont && - thd->spcont->handle_error(errcode, MYSQL_ERROR::WARN_LEVEL_ERROR, thd)) - { - DBUG_VOID_RETURN; - } - thd->query_error= 1; // needed to catch query errors during replication #ifndef EMBEDDED_LIBRARY query_cache_abort(net); // Safety |