summaryrefslogtreecommitdiff
path: root/sql/event_data_objects.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2009-07-24 21:04:55 +0500
committerGleb Shchepa <gshchepa@mysql.com>2009-07-24 21:04:55 +0500
commit2bc6b6a80099ddb5b57e3d3c8be120e6596daa08 (patch)
tree999d090b1f7c4cb9c23b5e41592e0cec56389c5f /sql/event_data_objects.cc
parentc24cccabdda8fad2117e3dea39e4de3c7feb3157 (diff)
parentdc0a87fdc24ed0859856d243ad68a0c1913db3af (diff)
downloadmariadb-git-2bc6b6a80099ddb5b57e3d3c8be120e6596daa08.tar.gz
Merge from 5.0
****** manual merge 5.0-bugteam --> 5.1-bugteam (bug 38816)
Diffstat (limited to 'sql/event_data_objects.cc')
-rw-r--r--sql/event_data_objects.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 0eba357b632..dba32cac6b2 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -1430,13 +1430,7 @@ Event_job_data::execute(THD *thd, bool drop)
thd->variables.sql_mode= sql_mode;
thd->variables.time_zone= time_zone;
- /*
- Peculiar initialization order is a crutch to avoid races in SHOW
- PROCESSLIST which reads thd->{query/query_length} without a mutex.
- */
- thd->query_length= 0;
- thd->query= sp_sql.c_ptr_safe();
- thd->query_length= sp_sql.length();
+ thd->set_query(sp_sql.c_ptr_safe(), sp_sql.length());
{
Parser_state parser_state(thd, thd->query, thd->query_length);
@@ -1497,13 +1491,8 @@ end_no_lex_start:
else
{
ulong saved_master_access;
- /*
- Peculiar initialization order is a crutch to avoid races in SHOW
- PROCESSLIST which reads thd->{query/query_length} without a mutex.
- */
- thd->query_length= 0;
- thd->query= sp_sql.c_ptr_safe();
- thd->query_length= sp_sql.length();
+
+ thd->set_query(sp_sql.c_ptr_safe(), sp_sql.length());
/*
NOTE: even if we run in read-only mode, we should be able to lock
@@ -1528,8 +1517,7 @@ end_no_lex_start:
thd->end_statement();
thd->cleanup_after_query();
/* Avoid races with SHOW PROCESSLIST */
- thd->query_length= 0;
- thd->query= NULL;
+ thd->set_query(NULL, 0);
DBUG_PRINT("info", ("EXECUTED %s.%s ret: %d", dbname.str, name.str, ret));