Commit 8d210fc2 authored by Sergei Petrunia's avatar Sergei Petrunia Committed by Oleksandr Byelkin

MDEV-31877: ASAN errors in Exec_time_tracker::get_cycles with innodb slow log verbosity

Remove redundant delete_explain_query() calls in

sp_instr_set::exec_core(), sp_instr_set_row_field::exec_core(),
sp_instr_set_row_field_by_name::exec_core().

These calls are made before the SP instruction's tables are
"closed" by close_thread_tables() call.

When we call close_thread_tables() after that, we no longer
can collect engine's counter variables, as they use the data
structures that are located in the Explain Data Structures.

Also, these delete_explain_query() calls are redundant, as
sp_lex_keeper::reset_lex_and_exec_core() has another
delete_explain_query() call, which is located in the right
location after the close_thread_tables() call.
parent d28d636f
......@@ -8972,3 +8972,15 @@ select @counter;
5
drop function f1;
drop table t1,t2;
#
# MDEV-31877: ASAN errors in Exec_time_tracker::get_cycles with innodb slow log verbosity
#
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,2);
SET @tmp=@@log_slow_verbosity;
SET SESSION log_slow_verbosity= 'innodb';
BEGIN NOT ATOMIC DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1); SELECT r.a; END $
r.a
1
SET SESSION log_slow_verbosity= @tmp;
DROP TABLE t1;
......@@ -10573,3 +10573,19 @@ select f1(col1) from t2 order by col2 desc limit 5;
select @counter;
drop function f1;
drop table t1,t2;
--echo #
--echo # MDEV-31877: ASAN errors in Exec_time_tracker::get_cycles with innodb slow log verbosity
--echo #
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,2);
SET @tmp=@@log_slow_verbosity;
SET SESSION log_slow_verbosity= 'innodb';
--delimiter $
BEGIN NOT ATOMIC DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1); SELECT r.a; END $
--delimiter ;
SET SESSION log_slow_verbosity= @tmp;
# Cleanup
DROP TABLE t1;
......@@ -3807,7 +3807,6 @@ int
sp_instr_set::exec_core(THD *thd, uint *nextp)
{
int res= get_rcontext(thd)->set_variable(thd, m_offset, &m_value);
delete_explain_query(thd->lex);
*nextp = m_ip+1;
return res;
}
......@@ -3849,7 +3848,6 @@ sp_instr_set_row_field::exec_core(THD *thd, uint *nextp)
int res= get_rcontext(thd)->set_variable_row_field(thd, m_offset,
m_field_offset,
&m_value);
delete_explain_query(thd->lex);
*nextp= m_ip + 1;
return res;
}
......@@ -3897,7 +3895,6 @@ sp_instr_set_row_field_by_name::exec_core(THD *thd, uint *nextp)
int res= get_rcontext(thd)->set_variable_row_field_by_name(thd, m_offset,
m_field_name,
&m_value);
delete_explain_query(thd->lex);
*nextp= m_ip + 1;
return res;
}
......
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