summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-17 21:24:29 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-17 21:24:29 +0200
commit97e640b9ae83e07b444fceede6b0524256c7a3cc (patch)
tree8f48fbfaf88ea7895ce59fd3ac2fbe6184334387 /sql/sql_parse.cc
parent2f6a2494a5eb2cf3ab06fbedd2584eca85d90230 (diff)
parentc7973615e723b13c6457b494b72be2fac35bfd18 (diff)
downloadmariadb-git-97e640b9ae83e07b444fceede6b0524256c7a3cc.tar.gz
5.5 merge
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4691ecefd89..97bc98a5b67 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -930,6 +930,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->enable_slow_log= TRUE;
thd->query_plan_flags= QPLAN_INIT;
thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
+
+ DEBUG_SYNC(thd,"dispatch_command_before_set_time");
+
thd->set_time();
if (!(server_command_flags[command] & CF_SKIP_QUERY_ID))
thd->set_query_id(next_query_id());
@@ -1106,6 +1109,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->update_server_status();
thd->protocol->end_statement();
query_cache_end_of_result(thd);
+
+ mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_STATUS,
+ thd->stmt_da->is_error() ? thd->stmt_da->sql_errno()
+ : 0, command_name[command].str);
+
ulong length= (ulong)(packet_end - beginning_of_next_stmt);
log_slow_statement(thd);
@@ -1486,6 +1494,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->reset_query();
thd->examined_row_count= 0; // For processlist
thd->command=COM_SLEEP;
+ thd->set_time();
dec_thread_running();
thd_proc_info(thd, 0);
thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory
@@ -6477,6 +6486,8 @@ TABLE_LIST *st_select_lex::nest_last_join(THD *thd)
for (uint i=0; i < 2; i++)
{
TABLE_LIST *table= join_list->pop();
+ if (!table)
+ DBUG_RETURN(NULL);
table->join_list= embedded_list;
table->embedding= ptr;
embedded_list->push_back(table);