Commit e6d79c2b authored by Alexander Nozdrin's avatar Alexander Nozdrin

Auto-merge from mysql-trunk-merge.

parents ea0bbb72 120425cc
...@@ -2939,7 +2939,7 @@ sp_instr_stmt::print(String *str) ...@@ -2939,7 +2939,7 @@ sp_instr_stmt::print(String *str)
int int
sp_instr_stmt::exec_core(THD *thd, uint *nextp) sp_instr_stmt::exec_core(THD *thd, uint *nextp)
{ {
MYSQL_QUERY_EXEC_START(thd->query, MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id, thd->thread_id,
(char *) (thd->db ? thd->db : ""), (char *) (thd->db ? thd->db : ""),
thd->security_ctx->priv_user, thd->security_ctx->priv_user,
......
...@@ -1652,13 +1652,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d", ...@@ -1652,13 +1652,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
thd->stmt_da->disable_status(); thd->stmt_da->disable_status();
BLOCK_UNLOCK_RD(query_block); BLOCK_UNLOCK_RD(query_block);
MYSQL_QUERY_CACHE_HIT(thd->query, (ulong) thd->limit_found_rows); MYSQL_QUERY_CACHE_HIT(thd->query(), (ulong) thd->limit_found_rows);
DBUG_RETURN(1); // Result sent to client DBUG_RETURN(1); // Result sent to client
err_unlock: err_unlock:
unlock(); unlock();
err: err:
MYSQL_QUERY_CACHE_MISS(thd->query); MYSQL_QUERY_CACHE_MISS(thd->query());
DBUG_RETURN(0); // Query was not cached DBUG_RETURN(0); // Query was not cached
} }
......
...@@ -169,7 +169,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result, ...@@ -169,7 +169,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
thd->lock_id= sensitive_cursor->get_lock_id(); thd->lock_id= sensitive_cursor->get_lock_id();
thd->cursor= sensitive_cursor; thd->cursor= sensitive_cursor;
} }
MYSQL_QUERY_EXEC_START(thd->query, MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id, thd->thread_id,
(char *) (thd->db ? thd->db : ""), (char *) (thd->db ? thd->db : ""),
thd->security_ctx->priv_user, thd->security_ctx->priv_user,
......
...@@ -1220,7 +1220,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1220,7 +1220,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{ {
if (alloc_query(thd, packet, packet_length)) if (alloc_query(thd, packet, packet_length))
break; // fatal error is set break; // fatal error is set
MYSQL_QUERY_START(thd->query, thd->thread_id, MYSQL_QUERY_START(thd->query(), thd->thread_id,
(char *) (thd->db ? thd->db : ""), (char *) (thd->db ? thd->db : ""),
thd->security_ctx->priv_user, thd->security_ctx->priv_user,
(char *) thd->security_ctx->host_or_ip); (char *) thd->security_ctx->host_or_ip);
...@@ -3164,7 +3164,7 @@ case SQLCOM_PREPARE: ...@@ -3164,7 +3164,7 @@ case SQLCOM_PREPARE:
goto error; goto error;
DBUG_ASSERT(select_lex->offset_limit == 0); DBUG_ASSERT(select_lex->offset_limit == 0);
unit->set_limit(select_lex); unit->set_limit(select_lex);
MYSQL_UPDATE_START(thd->query); MYSQL_UPDATE_START(thd->query());
res= (up_result= mysql_update(thd, all_tables, res= (up_result= mysql_update(thd, all_tables,
select_lex->item_list, select_lex->item_list,
lex->value_list, lex->value_list,
...@@ -3238,7 +3238,7 @@ case SQLCOM_PREPARE: ...@@ -3238,7 +3238,7 @@ case SQLCOM_PREPARE:
#endif #endif
{ {
multi_update *result_obj; multi_update *result_obj;
MYSQL_MULTI_UPDATE_START(thd->query); MYSQL_MULTI_UPDATE_START(thd->query());
res= mysql_multi_update(thd, all_tables, res= mysql_multi_update(thd, all_tables,
&select_lex->item_list, &select_lex->item_list,
&lex->value_list, &lex->value_list,
...@@ -3306,7 +3306,7 @@ case SQLCOM_PREPARE: ...@@ -3306,7 +3306,7 @@ case SQLCOM_PREPARE:
res= 1; res= 1;
break; break;
} }
MYSQL_INSERT_START(thd->query); MYSQL_INSERT_START(thd->query());
res= mysql_insert(thd, all_tables, lex->field_list, lex->many_values, res= mysql_insert(thd, all_tables, lex->field_list, lex->many_values,
lex->update_list, lex->value_list, lex->update_list, lex->value_list,
lex->duplicates, lex->ignore); lex->duplicates, lex->ignore);
...@@ -3348,7 +3348,7 @@ case SQLCOM_PREPARE: ...@@ -3348,7 +3348,7 @@ case SQLCOM_PREPARE:
} }
if (!(res= open_and_lock_tables(thd, all_tables))) if (!(res= open_and_lock_tables(thd, all_tables)))
{ {
MYSQL_INSERT_SELECT_START(thd->query); MYSQL_INSERT_SELECT_START(thd->query());
/* Skip first table, which is the table we are inserting in */ /* Skip first table, which is the table we are inserting in */
TABLE_LIST *second_table= first_table->next_local; TABLE_LIST *second_table= first_table->next_local;
select_lex->table_list.first= (uchar*) second_table; select_lex->table_list.first= (uchar*) second_table;
...@@ -3434,7 +3434,7 @@ case SQLCOM_PREPARE: ...@@ -3434,7 +3434,7 @@ case SQLCOM_PREPARE:
res= 1; res= 1;
break; break;
} }
MYSQL_DELETE_START(thd->query); MYSQL_DELETE_START(thd->query());
res = mysql_delete(thd, all_tables, select_lex->where, res = mysql_delete(thd, all_tables, select_lex->where,
&select_lex->order_list, &select_lex->order_list,
unit->select_limit_cnt, select_lex->options, unit->select_limit_cnt, select_lex->options,
...@@ -3469,7 +3469,7 @@ case SQLCOM_PREPARE: ...@@ -3469,7 +3469,7 @@ case SQLCOM_PREPARE:
if ((res= open_and_lock_tables(thd, all_tables))) if ((res= open_and_lock_tables(thd, all_tables)))
break; break;
MYSQL_MULTI_DELETE_START(thd->query); MYSQL_MULTI_DELETE_START(thd->query());
if ((res= mysql_multi_delete_prepare(thd))) if ((res= mysql_multi_delete_prepare(thd)))
{ {
MYSQL_MULTI_DELETE_DONE(1, 0); MYSQL_MULTI_DELETE_DONE(1, 0);
...@@ -6201,7 +6201,7 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, ...@@ -6201,7 +6201,7 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
thd->server_status|= SERVER_MORE_RESULTS_EXISTS; thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
} }
lex->set_trg_event_type_for_tables(); lex->set_trg_event_type_for_tables();
MYSQL_QUERY_EXEC_START(thd->query, MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id, thd->thread_id,
(char *) (thd->db ? thd->db : ""), (char *) (thd->db ? thd->db : ""),
thd->security_ctx->priv_user, thd->security_ctx->priv_user,
...@@ -8063,7 +8063,7 @@ bool parse_sql(THD *thd, ...@@ -8063,7 +8063,7 @@ bool parse_sql(THD *thd,
bool ret_value; bool ret_value;
DBUG_ASSERT(thd->m_parser_state == NULL); DBUG_ASSERT(thd->m_parser_state == NULL);
MYSQL_QUERY_PARSE_START(thd->query); MYSQL_QUERY_PARSE_START(thd->query());
/* Backup creation context. */ /* Backup creation context. */
Object_creation_ctx *backup_ctx= NULL; Object_creation_ctx *backup_ctx= NULL;
......
...@@ -3753,7 +3753,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) ...@@ -3753,7 +3753,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
if (query_cache_send_result_to_client(thd, thd->query(), if (query_cache_send_result_to_client(thd, thd->query(),
thd->query_length()) <= 0) thd->query_length()) <= 0)
{ {
MYSQL_QUERY_EXEC_START(thd->query, MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id, thd->thread_id,
(char *) (thd->db ? thd->db : ""), (char *) (thd->db ? thd->db : ""),
thd->security_ctx->priv_user, thd->security_ctx->priv_user,
......
...@@ -242,7 +242,7 @@ bool handle_select(THD *thd, LEX *lex, select_result *result, ...@@ -242,7 +242,7 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
bool res; bool res;
register SELECT_LEX *select_lex = &lex->select_lex; register SELECT_LEX *select_lex = &lex->select_lex;
DBUG_ENTER("handle_select"); DBUG_ENTER("handle_select");
MYSQL_SELECT_START(thd->query); MYSQL_SELECT_START(thd->query());
if (select_lex->master_unit()->is_union() || if (select_lex->master_unit()->is_union() ||
select_lex->master_unit()->fake_select_lex) select_lex->master_unit()->fake_select_lex)
......
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