summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-10-14 12:25:39 +0400
committerAlexander Nozdrin <alik@sun.com>2009-10-14 12:25:39 +0400
commitca08f10ccd20213ad2ac1fa19f19cd7dfbcc5d7d (patch)
tree1b3260f72106f50b182546dff41127a389144fa1 /sql/sql_parse.cc
parent946dc457facc58517e9c47f1c5ad0029e529da79 (diff)
parent32e51de7f58d6f3e82c97fe9ab37d8d8246b762b (diff)
downloadmariadb-git-ca08f10ccd20213ad2ac1fa19f19cd7dfbcc5d7d.tar.gz
Manual merge from mysql-trunk-merge.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 5a4af9afbb1..5c5957e7871 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1447,7 +1447,28 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (check_global_access(thd,RELOAD_ACL))
break;
general_log_print(thd, command, NullS);
- if (!reload_acl_and_cache(thd, options, (TABLE_LIST*) 0, &not_used))
+#ifndef DBUG_OFF
+ bool debug_simulate= FALSE;
+ DBUG_EXECUTE_IF("simulate_detached_thread_refresh", debug_simulate= TRUE;);
+ if (debug_simulate)
+ {
+ /*
+ Simulate a reload without a attached thread session.
+ Provides a environment similar to that of when the
+ server receives a SIGHUP signal and reloads caches
+ and flushes tables.
+ */
+ bool res;
+ my_pthread_setspecific_ptr(THR_THD, NULL);
+ res= reload_acl_and_cache(NULL, options | REFRESH_FAST,
+ NULL, &not_used);
+ my_pthread_setspecific_ptr(THR_THD, thd);
+ if (!res)
+ my_ok(thd);
+ break;
+ }
+#endif
+ if (!reload_acl_and_cache(thd, options, NULL, &not_used))
my_ok(thd);
break;
}