Commit 1442ef0f authored by Davi Arnaut's avatar Davi Arnaut

Post-merge cleanup: Reorganize code for better comprehensibility.

                    Removes the need of a hack (the jump to label).
parent e1e038ab
...@@ -2162,26 +2162,27 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -2162,26 +2162,27 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break; break;
mysql_log.write(thd,command,NullS); mysql_log.write(thd,command,NullS);
#ifndef DBUG_OFF #ifndef DBUG_OFF
DBUG_EXECUTE_IF("simulate_detached_thread_refresh", 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 Simulate a reload without a attached thread session.
and flushes tables. Provides a environment similar to that of when the
*/ server receives a SIGHUP signal and reloads caches
bool res; and flushes tables.
my_pthread_setspecific_ptr(THR_THD, NULL); */
res= reload_acl_and_cache(NULL, options | REFRESH_FAST, bool res;
NULL, &not_used); my_pthread_setspecific_ptr(THR_THD, NULL);
my_pthread_setspecific_ptr(THR_THD, thd); res= reload_acl_and_cache(NULL, options | REFRESH_FAST,
if (!res) NULL, &not_used);
send_ok(thd); my_pthread_setspecific_ptr(THR_THD, thd);
goto end; if (!res)
} send_ok(thd);
); break;
}
#endif #endif
if (!reload_acl_and_cache(thd, options, (TABLE_LIST*) 0, &not_used)) if (!reload_acl_and_cache(thd, options, NULL, &not_used))
send_ok(thd); send_ok(thd);
break; break;
} }
...@@ -2319,11 +2320,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -2319,11 +2320,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break; break;
} }
/* Break the switch for DBUG wrapped code. */
#ifndef DBUG_OFF
end:
#endif
if (thd->lock || thd->open_tables || thd->derived_tables || if (thd->lock || thd->open_tables || thd->derived_tables ||
thd->prelocked_mode) thd->prelocked_mode)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment