diff options
author | unknown <bell@sanja.is.com.ua> | 2005-01-20 10:41:37 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-01-20 10:41:37 +0200 |
commit | 7a528488915786f56ab48e2995fae18cc9731d1a (patch) | |
tree | 688e14daabde23993878846e8b67af1f4d180abf /sql/protocol.cc | |
parent | 06284149809d85e347af94a8ba2568d0ba5c0e2d (diff) | |
download | mariadb-git-7a528488915786f56ab48e2995fae18cc9731d1a.tar.gz |
Fixed problem of sending ERROR to client after OK or EOF (BUG#6804)
include/mysql_com.h:
Flag which prevent sending error after EOF or OK sent
mysql-test/r/kill.result:
test of blocking of sending ERROR after OK or EOF
mysql-test/t/kill.test:
test of blocking of sending ERROR after OK or EOF
sql/item_func.cc:
typo fixed
sql/net_serv.cc:
initialization of flag
sql/protocol.cc:
check and set of flag no_send_error
sql/sql_parse.cc:
droping flag no_send_error before new command/query execution
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index d537f9cf829..c61a3eb9f7c 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -65,6 +65,12 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) err ? err : net->last_error[0] ? net->last_error : "NULL")); + if (net && net->no_send_error) + { + thd->clear_error(); + DBUG_PRINT("info", ("sending error messages prohibited")); + DBUG_VOID_RETURN; + } if (thd->spcont && thd->spcont->find_handler(sql_errno, MYSQL_ERROR::WARN_LEVEL_ERROR)) { @@ -154,6 +160,13 @@ net_printf_error(THD *thd, uint errcode, ...) DBUG_ENTER("net_printf_error"); DBUG_PRINT("enter",("message: %u",errcode)); + if (net && net->no_send_error) + { + thd->clear_error(); + DBUG_PRINT("info", ("sending error messages prohibited")); + DBUG_VOID_RETURN; + } + if (thd->spcont && thd->spcont->find_handler(errcode, MYSQL_ERROR::WARN_LEVEL_ERROR)) { @@ -300,6 +313,9 @@ send_ok(THD *thd, ha_rows affected_rows, ulonglong id, const char *message) VOID(net_flush(net)); /* We can't anymore send an error to the client */ thd->net.report_error= 0; + thd->net.no_send_error= 1; + DBUG_PRINT("info", ("OK sent, so no more error sendong allowed")); + DBUG_VOID_RETURN; } @@ -357,6 +373,8 @@ send_eof(THD *thd, bool no_flush) if (!no_flush) VOID(net_flush(net)); } + thd->net.no_send_error= 1; + DBUG_PRINT("info", ("EOF sent, so no more error sendong allowed")); } DBUG_VOID_RETURN; } |