summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-09-30 19:59:30 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-09-30 19:59:30 -0300
commit3c5d9f4272f484fa71426581962c31413f47d984 (patch)
treefb730de08ed225db360fec337e4445fceaed92bc /sql/sql_parse.cc
parente218ac06ed3721e6b5496e1954fc9afd9d95cf24 (diff)
downloadmariadb-git-3c5d9f4272f484fa71426581962c31413f47d984.tar.gz
Post-merge cleanup: Reorganize code for better comprehensibility.
Removes the need of a hack (the jump to label).
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc44
1 files changed, 20 insertions, 24 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 88e70a129c4..f34aa3c3bad 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2162,26 +2162,27 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
mysql_log.write(thd,command,NullS);
#ifndef DBUG_OFF
- DBUG_EXECUTE_IF("simulate_detached_thread_refresh",
- {
- /*
- 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)
- send_ok(thd);
- goto end;
- }
- );
+ 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)
+ send_ok(thd);
+ break;
+ }
#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);
break;
}
@@ -2319,11 +2320,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
- /* Break the switch for DBUG wrapped code. */
-#ifndef DBUG_OFF
-end:
-#endif
-
if (thd->lock || thd->open_tables || thd->derived_tables ||
thd->prelocked_mode)
{