summaryrefslogtreecommitdiff
path: root/sql/sql_connect.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-11-28 23:15:12 +0100
committerSergei Golubchik <sergii@pisem.net>2011-11-28 23:15:12 +0100
commitec38c1bbd709da99fb84e2889f4443247fccfb30 (patch)
tree0324b7ee684e170c655f4f9d1472282ddc589f7c /sql/sql_connect.cc
parentb27d93f3471c2e06347d0c918a8ada20f6168191 (diff)
downloadmariadb-git-ec38c1bbd709da99fb84e2889f4443247fccfb30.tar.gz
small cleanup
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r--sql/sql_connect.cc21
1 files changed, 3 insertions, 18 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index bcffad06ad1..3c88b7a054d 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1072,20 +1072,8 @@ void end_connection(THD *thd)
status_var_increment(thd->status_var.lost_connections);
}
- if (net->error && net->vio != 0)
- {
- if (!thd->killed && thd->variables.log_warnings > 1)
- {
- Security_context *sctx= thd->security_ctx;
-
- sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
- thd->thread_id,(thd->db ? thd->db : "unconnected"),
- sctx->user ? sctx->user : "unauthenticated",
- sctx->host_or_ip,
- (thd->stmt_da->is_error() ? thd->stmt_da->message() :
- ER(ER_UNKNOWN_ERROR)));
- }
- }
+ if (!thd->killed && (net->error && net->vio != 0))
+ thd->print_aborted_warning(1, ER(ER_UNKNOWN_ERROR));
}
@@ -1116,10 +1104,7 @@ void prepare_new_connection_state(THD* thd)
if (thd->is_error())
{
thd->killed= KILL_CONNECTION;
- sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
- thd->thread_id,(thd->db ? thd->db : "unconnected"),
- sctx->user ? sctx->user : "unauthenticated",
- sctx->host_or_ip, "init_connect command failed");
+ thd->print_aborted_warning(0, "init_connect command failed");
sql_print_warning("%s", thd->stmt_da->message());
}
thd->proc_info=0;