summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <dlenev@mysql.com>2005-09-01 23:25:29 +0400
committerunknown <dlenev@mysql.com>2005-09-01 23:25:29 +0400
commit7783dbbcdccc8e45be88cd4d213c022a9fd023ac (patch)
treea5830cd512f96c9dfcac6af5cf627770f7fd7a72 /sql/sql_parse.cc
parentf5db9c9a5be0f2f7f78229e2b6054aae3d940c1c (diff)
parent84ddd543c7c10b8022e3b22d1913faa3704d59a8 (diff)
downloadmariadb-git-7783dbbcdccc8e45be88cd4d213c022a9fd023ac.tar.gz
Merge mysql.com:/home/dlenev/src/mysql-4.1-bg12423
into mysql.com:/home/dlenev/src/mysql-5.0-merges mysql-test/lib/mtr_report.pl: Auto merged mysql-test/lib/mtr_timer.pl: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.h: Auto merged sql/examples/ha_archive.cc: Auto merged mysql-test/lib/mtr_process.pl: Manual merge. mysql-test/mysql-test-run.pl: Manual merge. mysql-test/r/grant2.result: Manual merge. mysql-test/t/grant2.test: Manual merge. sql/sql_acl.cc: Manual merge. sql/sql_parse.cc: Manual merge.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 923a00decae..8b054035e29 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6552,8 +6552,25 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (options & REFRESH_GRANT)
{
- acl_reload(thd);
- grant_reload(thd);
+ THD *tmp_thd= 0;
+ /*
+ If reload_acl_and_cache() is called from SIGHUP handler we have to
+ allocate temporary THD for execution of acl_reload()/grant_reload().
+ */
+ if (!thd && (thd= (tmp_thd= new THD)))
+ thd->store_globals();
+ if (thd)
+ {
+ (void)acl_reload(thd);
+ (void)grant_reload(thd);
+ }
+ if (tmp_thd)
+ {
+ delete tmp_thd;
+ /* Remember that we don't have a THD */
+ my_pthread_setspecific_ptr(THR_THD, 0);
+ thd= 0;
+ }
reset_mqh((LEX_USER *)NULL, TRUE);
}
#endif