summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <dlenev@mysql.com>2005-08-24 23:44:42 +0400
committerunknown <dlenev@mysql.com>2005-08-24 23:44:42 +0400
commit9017addfd8e0a232b24bfe61aa9821feb45350bb (patch)
treed83d641c25ba04363061458ebd8d090b58a5b02c /sql
parent43e07c3b916bb967838c2dc5c63be3589385b4cf (diff)
downloadmariadb-git-9017addfd8e0a232b24bfe61aa9821feb45350bb.tar.gz
Correction of fix for bug #12280 "Triggers: crash if flush tables".
We should not assume that "thd" argument of reload_acl_and_cache() is non-zero. Failure to do so will cause server to crash when one sends SIGHUP to it. sql/sql_parse.cc: reload_acl_and_cache(): When we call this function from SIGHUP handler we pass 0 as "thd" argument to it. So we should not assume that thd is non-zero in it.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_parse.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 70920b07a97..c86b7eba024 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6517,7 +6517,7 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields)
SYNOPSIS
reload_acl_and_cache()
- thd Thread handler
+ thd Thread handler (can be NULL!)
options What should be reset/reloaded (tables, privileges,
slave...)
tables Tables to flush (if any)
@@ -6539,7 +6539,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
select_errors=0; /* Write if more errors */
bool tmp_write_to_binlog= 1;
- if (thd->in_sub_stmt)
+ if (thd && thd->in_sub_stmt)
{
my_error(ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG, MYF(0), "FLUSH");
return 1;