summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_load.cc8
-rw-r--r--sql/sql_show.cc3
2 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index ee3b442c83a..3fb1b07cf6c 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -689,12 +689,10 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
strcpy(end, p);
end += pl;
- thd->set_query_inner(load_data_query, end - load_data_query);
-
Execute_load_query_log_event
- e(thd, thd->query(), thd->query_length(),
- (uint) ((char*) fname_start - (char*) thd->query() - 1),
- (uint) ((char*) fname_end - (char*) thd->query()),
+ e(thd, load_data_query, end-load_data_query,
+ (uint) ((char*) fname_start - load_data_query - 1),
+ (uint) ((char*) fname_end - load_data_query),
(duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :
(ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),
transactional_table, FALSE, errcode);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 989606300d8..cb60027842d 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1991,6 +1991,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
pthread_mutex_unlock(&mysys_var->mutex);
/* INFO */
+ /* Lock THD mutex that protects its data when looking at it. */
+ pthread_mutex_lock(&tmp->LOCK_thd_data);
if (tmp->query())
{
table->field[7]->store(tmp->query(),
@@ -1998,6 +2000,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
tmp->query_length()), cs);
table->field[7]->set_notnull();
}
+ pthread_mutex_unlock(&tmp->LOCK_thd_data);
if (schema_table_store_record(thd, table))
{