summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@Sun.COM>2010-07-21 14:56:43 +0700
committerDmitry Shulga <Dmitry.Shulga@Sun.COM>2010-07-21 14:56:43 +0700
commitbd41af86ebc53510760504b980f073be4438f6e9 (patch)
tree6fa561732c7d7b6aafd747e41417467da3cab2c9 /sql/sql_prepare.cc
parent7ccbf9b817b47d0393fe66bda6f6013ec24486ba (diff)
downloadmariadb-git-bd41af86ebc53510760504b980f073be4438f6e9.tar.gz
Fixed bug #42496 - the server could crash on a debug assert after a failure
to write into a closed socket sql/protocol.cc: Protocol::flush modified: set thd->main_da.can_overwrite_status= TRUE before call to net_flush() in order to prevent crash on assert in case of socket write failure, reset it to FALSE when net_flush() returned; Protocol::send_fields modified: return from method with error if call to my_net_write(), proto.write() or write_eof_packet() failed. sql/sql_cache.cc: Query_cache::send_result_to_client modified: call to thd->main_da.disable_status() only if write to socket was successful. sql/sql_cursor.cc: Materialized_cursor::fetch modified: leave method if call to result->send_data() failed. sql/sql_prepare.cc: send_prep_stmt() modified: call to thd->main_da.disable_status() only if thd->protocol_text.send_fields() completed successfully.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 041d9f7c30b..bd152866deb 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -263,8 +263,11 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
&stmt->lex->param_list,
Protocol::SEND_EOF);
}
- /* Flag that a response has already been sent */
- thd->main_da.disable_status();
+
+ if (!error)
+ /* Flag that a response has already been sent */
+ thd->main_da.disable_status();
+
DBUG_RETURN(error);
}
#else