Commit f62dfd07 authored by unknown's avatar unknown

InnoDB: avoid some data races in innobase_mysql_print_thd() (Bug #3596)


sql/ha_innodb.cc:
  innobase_mysql_print_thd(): initial fix to Bug #3596
parent a82bd4ab
...@@ -323,9 +323,10 @@ innobase_mysql_print_thd( ...@@ -323,9 +323,10 @@ innobase_mysql_print_thd(
FILE* f, /* in: output stream */ FILE* f, /* in: output stream */
void* input_thd)/* in: pointer to a MySQL THD object */ void* input_thd)/* in: pointer to a MySQL THD object */
{ {
THD* thd; const THD* thd;
const char* s;
thd = (THD*) input_thd; thd = (const THD*) input_thd;
fprintf(f, "MySQL thread id %lu, query id %lu", fprintf(f, "MySQL thread id %lu, query id %lu",
thd->thread_id, thd->query_id); thd->thread_id, thd->query_id);
...@@ -344,14 +345,14 @@ innobase_mysql_print_thd( ...@@ -344,14 +345,14 @@ innobase_mysql_print_thd(
fputs(thd->user, f); fputs(thd->user, f);
} }
if (thd->proc_info) { if ((s = thd->proc_info)) {
putc(' ', f); putc(' ', f);
fputs(thd->proc_info, f); fputs(s, f);
} }
if (thd->query) { if ((s = thd->query)) {
putc(' ', f); putc(' ', f);
fputs(thd->query, f); fputs(s, f);
} }
putc('\n', f); putc('\n', f);
......
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