summaryrefslogtreecommitdiff
path: root/sql/sql_connect.cc
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.(none)>2007-10-30 15:39:50 +0300
committerunknown <kostja@bodhi.(none)>2007-10-30 15:39:50 +0300
commitd4d4ba9a9f49a6abc9cd00924e1e33bfd2278b87 (patch)
treeeb9a5bd6e58db8080cb92e8ee971a0dc47e4d377 /sql/sql_connect.cc
parent5f4783cf4ba129388cd175020db80311759ccefe (diff)
downloadmariadb-git-d4d4ba9a9f49a6abc9cd00924e1e33bfd2278b87.tar.gz
Fix failing init_connect.test (5.1-runtime).
sql/sql_connect.cc: Fix failing init_connect.test (5.1-runtime). Add comments for the unjustified use of thd->is_slave_error.
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r--sql/sql_connect.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index afd97c27a55..c4367b2a8fb 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1030,7 +1030,17 @@ static void prepare_new_connection_state(THD* thd)
if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL))
{
execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect);
- if (thd->net.report_error)
+ /*
+ execute_init_command calls net_send_error.
+ If there was an error during execution of the init statements,
+ the error at this moment is present in thd->net.last_error and also
+ thd->is_slave_error and thd->net.report_error are set.
+ net_send_error sends the contents of thd->net.last_error and
+ clears thd->net.report_error. It doesn't, however, clean
+ thd->is_slave_error or thd->net.last_error. Here we make use of this
+ fact.
+ */
+ if (thd->is_slave_error)
{
thd->killed= THD::KILL_CONNECTION;
sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),