Commit a6e940f5 authored by vasil's avatar vasil

branches/zip:

 
Bugfix: Lock the MySQL mutex LOCK_thread_count before accessing
trx->mysql_query_str to avoid race conditions where MySQL sets it to
NULL after we have checked that it is not NULL and before we access it.
 
Approved by:	Marko
parent 6367b36c
...@@ -19,6 +19,7 @@ Created July 17, 2007 Vasil Dimov ...@@ -19,6 +19,7 @@ Created July 17, 2007 Vasil Dimov
#include "buf0buf.h" #include "buf0buf.h"
#include "dict0dict.h" #include "dict0dict.h"
#include "ha0storage.h" #include "ha0storage.h"
#include "ha_prototypes.h"
#include "hash0hash.h" #include "hash0hash.h"
#include "lock0iter.h" #include "lock0iter.h"
#include "lock0lock.h" #include "lock0lock.h"
...@@ -1138,6 +1139,9 @@ trx_i_s_possibly_fetch_data_into_cache( ...@@ -1138,6 +1139,9 @@ trx_i_s_possibly_fetch_data_into_cache(
return(1); return(1);
} }
/* We are going to access trx->query in all transactions */
innobase_mysql_prepare_print_arbitrary_thd();
/* We need to read trx_sys and record/table lock queues */ /* We need to read trx_sys and record/table lock queues */
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
...@@ -1145,6 +1149,8 @@ trx_i_s_possibly_fetch_data_into_cache( ...@@ -1145,6 +1149,8 @@ trx_i_s_possibly_fetch_data_into_cache(
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
innobase_mysql_end_print_arbitrary_thd();
return(0); return(0);
} }
......
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