Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
869e67c9
Commit
869e67c9
authored
May 07, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: remove thd->stmt_changes_data
what is done in the plugin - stays in the plugin
parent
3781848b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
11 deletions
+5
-11
plugin/query_response_time/plugin.cc
plugin/query_response_time/plugin.cc
+3
-1
sql/handler.cc
sql/handler.cc
+0
-1
sql/sql_class.cc
sql/sql_class.cc
+1
-4
sql/sql_class.h
sql/sql_class.h
+1
-3
sql/sql_parse.cc
sql/sql_parse.cc
+0
-2
No files found.
plugin/query_response_time/plugin.cc
View file @
869e67c9
...
...
@@ -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
))
{
...
...
sql/handler.cc
View file @
869e67c9
...
...
@@ -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
;
}
...
...
sql/sql_class.cc
View file @
869e67c9
...
...
@@ -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
;
}
...
...
sql/sql_class.h
View file @
869e67c9
...
...
@@ -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 ex
ce
uted in mysql_execute_command()
enum_sql_command
last_sql_command
;
// Last sql_command ex
ec
uted in mysql_execute_command()
sp_rcontext
*
spcont
;
// SP runtime context
...
...
sql/sql_parse.cc
View file @
869e67c9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment