summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-05-05 19:27:29 +0200
committerNikita Malyavin <nikitamalyavin@gmail.com>2021-05-05 23:06:12 +0300
commit0775ca315e1dc92bdaf5d961cb4a5a31eb051fe8 (patch)
tree2b3a3dcd2f41bad89077a6cc9d8b8c4039cbddd7
parentda63eb16c95884665bc414511193d10e1469376b (diff)
downloadmariadb-git-0775ca315e1dc92bdaf5d961cb4a5a31eb051fe8.tar.gz
MDEV-23542 Server crashes in thd_clear_errors()
1) Checked presence of mysys_var. 2) Removed unneeded thd_clear_errors, its content added to THD::change_user.
-rw-r--r--sql/sql_class.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 0d61a38e918..7864623e719 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -299,17 +299,6 @@ THD *thd_get_current_thd()
return current_thd;
}
-/**
- Clear errors from the previous THD
-
- @param thd THD object
-*/
-void thd_clear_errors(THD *thd)
-{
- my_errno= 0;
- thd->mysys_var->abort= 0;
-}
-
/**
Get thread attributes for connection threads
@@ -1422,7 +1411,10 @@ void THD::change_user(void)
cleanup();
cleanup_done= 0;
reset_killed();
- thd_clear_errors(this);
+ /* Clear errors from the previous THD */
+ my_errno= 0;
+ if (mysys_var)
+ mysys_var->abort= 0;
/* Clear warnings. */
if (!get_stmt_da()->is_warning_info_empty())