Commit 869e67c9 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: remove thd->stmt_changes_data

what is done in the plugin - stays in the plugin
parent 3781848b
......@@ -231,7 +231,9 @@ static void query_response_time_audit_notify(MYSQL_THD thd,
if (event_general->event_subclass == MYSQL_AUDIT_GENERAL_STATUS &&
query_response_time_should_log(thd))
{
QUERY_TYPE query_type= (thd->stmt_changes_data ? WRITE : READ);
bool stmt_changes_data= is_update_query(thd->last_sql_command)
|| thd->transaction->stmt.is_trx_read_write();
QUERY_TYPE query_type= stmt_changes_data ? WRITE : READ;
#ifndef DBUG_OFF
if (THDVAR(thd, exec_time_debug))
{
......
......@@ -5288,7 +5288,6 @@ void handler::mark_trx_read_write_internal()
if (table_share == NULL || table_share->tmp_table == NO_TMP_TABLE)
ha_info->set_trx_read_write();
}
thd->stmt_changes_data= 1;
}
......
......@@ -661,7 +661,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
bootstrap(0),
derived_tables_processing(FALSE),
waiting_on_group_commit(FALSE), has_waiter(FALSE),
spcont(NULL),
last_sql_command(SQLCOM_END), spcont(NULL),
m_parser_state(NULL),
#ifndef EMBEDDED_LIBRARY
audit_plugin_version(-1),
......@@ -6034,7 +6034,6 @@ void THD::store_slow_query_state(Sub_statement_state *backup)
backup->tmp_tables_size= tmp_tables_size;
backup->tmp_tables_used= tmp_tables_used;
backup->handler_stats= handler_stats;
backup->stmt_changes_data= stmt_changes_data;
}
/* Reset variables related to slow query log */
......@@ -6063,7 +6062,6 @@ void THD::reset_slow_query_state(Sub_statement_state *backup)
}
if ((variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_ENGINE))
handler_stats.reset();
stmt_changes_data= 0; // Can be used by audit plugins
}
/*
......@@ -6095,7 +6093,6 @@ void THD::add_slow_query_state(Sub_statement_state *backup)
}
if ((variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_ENGINE))
handler_stats.add(&backup->handler_stats);
stmt_changes_data|= backup->stmt_changes_data;
}
......
......@@ -2122,7 +2122,6 @@ class Sub_statement_state
bool last_insert_id_used;
bool in_stored_procedure;
bool do_union;
bool stmt_changes_data;
enum enum_check_fields count_cuted_fields;
};
......@@ -3863,7 +3862,6 @@ class THD: public THD_count, /* this must be first */
See comment above regarding transaction_isolation.
*/
bool tx_read_only;
bool stmt_changes_data;
enum_check_fields count_cuted_fields;
DYNAMIC_ARRAY user_var_events; /* For user variables replication */
......@@ -3998,7 +3996,7 @@ class THD: public THD_count, /* this must be first */
execution stack when the event turns out to be ignored.
*/
int slave_expected_error;
enum_sql_command last_sql_command; // Last sql_command exceuted in mysql_execute_command()
enum_sql_command last_sql_command; // Last sql_command executed in mysql_execute_command()
sp_rcontext *spcont; // SP runtime context
......
......@@ -3515,8 +3515,6 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
like mysql_audit_plugin.
*/
thd->last_sql_command= lex->sql_command;
thd->stmt_changes_data|= (sql_command_flags[lex->sql_command] &
CF_CHANGES_DATA);
/*
Reset warning count for each query that uses tables
......
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