Commit 6ee9cba7 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-10486 MariaDB 10.x does not update rows_examined in performance_schema tables.

        Save the rows_examined counter before it gets emptied.
parent ef9e78c9
......@@ -118,3 +118,19 @@ B
select count(*) from events_statements_history where sql_text like "%...";
count(*)
2
use test;
create table t1 (id int);
insert into t1 values (1), (2), (3);
truncate performance_schema.events_statements_history;
select * from t1;
id
1
2
3
insert into t1 select RAND()*10000 from t1;
select sql_text, rows_examined from performance_schema.events_statements_history;
sql_text rows_examined
truncate performance_schema.events_statements_history 0
select * from t1 3
insert into t1 select RAND()*10000 from t1 6
drop table t1;
......@@ -207,3 +207,18 @@ select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
select _utf8mb4 'васÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑвасÑ' as B;
select count(*) from events_statements_history where sql_text like "%...";
#
# MDEV-10486 MariaDB 10.x does not update rows_examined in performance_schema tables
# Verify that the rows_examined counter is set properly.
use test;
create table t1 (id int);
insert into t1 values (1), (2), (3);
truncate performance_schema.events_statements_history;
select * from t1;
insert into t1 select RAND()*10000 from t1;
select sql_text, rows_examined from performance_schema.events_statements_history;
drop table t1;
......@@ -1957,11 +1957,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
THD_STAGE_INFO(thd, stage_cleaning_up);
thd->reset_query();
thd->set_examined_row_count(0); // For processlist
thd->set_command(COM_SLEEP);
/* Performance Schema Interface instrumentation, end */
MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
thd->set_examined_row_count(0); // For processlist
thd->set_command(COM_SLEEP);
thd->m_statement_psi= NULL;
thd->m_digest= NULL;
......
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