mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
cleanup: remove thd->stmt_changes_data
what is done in the plugin - stays in the plugin
This commit is contained in:
@ -231,7 +231,9 @@ static void query_response_time_audit_notify(MYSQL_THD thd,
|
|||||||
if (event_general->event_subclass == MYSQL_AUDIT_GENERAL_STATUS &&
|
if (event_general->event_subclass == MYSQL_AUDIT_GENERAL_STATUS &&
|
||||||
query_response_time_should_log(thd))
|
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
|
#ifndef DBUG_OFF
|
||||||
if (THDVAR(thd, exec_time_debug))
|
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)
|
if (table_share == NULL || table_share->tmp_table == NO_TMP_TABLE)
|
||||||
ha_info->set_trx_read_write();
|
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),
|
bootstrap(0),
|
||||||
derived_tables_processing(FALSE),
|
derived_tables_processing(FALSE),
|
||||||
waiting_on_group_commit(FALSE), has_waiter(FALSE),
|
waiting_on_group_commit(FALSE), has_waiter(FALSE),
|
||||||
spcont(NULL),
|
last_sql_command(SQLCOM_END), spcont(NULL),
|
||||||
m_parser_state(NULL),
|
m_parser_state(NULL),
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
audit_plugin_version(-1),
|
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_size= tmp_tables_size;
|
||||||
backup->tmp_tables_used= tmp_tables_used;
|
backup->tmp_tables_used= tmp_tables_used;
|
||||||
backup->handler_stats= handler_stats;
|
backup->handler_stats= handler_stats;
|
||||||
backup->stmt_changes_data= stmt_changes_data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset variables related to slow query log */
|
/* 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))
|
if ((variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_ENGINE))
|
||||||
handler_stats.reset();
|
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))
|
if ((variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_ENGINE))
|
||||||
handler_stats.add(&backup->handler_stats);
|
handler_stats.add(&backup->handler_stats);
|
||||||
stmt_changes_data|= backup->stmt_changes_data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2122,7 +2122,6 @@ public:
|
|||||||
bool last_insert_id_used;
|
bool last_insert_id_used;
|
||||||
bool in_stored_procedure;
|
bool in_stored_procedure;
|
||||||
bool do_union;
|
bool do_union;
|
||||||
bool stmt_changes_data;
|
|
||||||
enum enum_check_fields count_cuted_fields;
|
enum enum_check_fields count_cuted_fields;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3863,7 +3862,6 @@ public:
|
|||||||
See comment above regarding transaction_isolation.
|
See comment above regarding transaction_isolation.
|
||||||
*/
|
*/
|
||||||
bool tx_read_only;
|
bool tx_read_only;
|
||||||
bool stmt_changes_data;
|
|
||||||
enum_check_fields count_cuted_fields;
|
enum_check_fields count_cuted_fields;
|
||||||
|
|
||||||
DYNAMIC_ARRAY user_var_events; /* For user variables replication */
|
DYNAMIC_ARRAY user_var_events; /* For user variables replication */
|
||||||
@ -3998,7 +3996,7 @@ public:
|
|||||||
execution stack when the event turns out to be ignored.
|
execution stack when the event turns out to be ignored.
|
||||||
*/
|
*/
|
||||||
int slave_expected_error;
|
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
|
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.
|
like mysql_audit_plugin.
|
||||||
*/
|
*/
|
||||||
thd->last_sql_command= lex->sql_command;
|
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
|
Reset warning count for each query that uses tables
|
||||||
|
Reference in New Issue
Block a user