1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-33881 Userstat skips system tables inconsistently

Fixed that no tables from 'mysql' schema are included in userstat.
A beneif of this is that the server is not reading statistics tables
if mysql.proc or other tables in mysql is accessed.
This commit is contained in:
Monty
2024-04-18 11:45:21 +03:00
committed by Sergei Golubchik
parent ab513b007b
commit 0f414f639c
9 changed files with 83 additions and 87 deletions

View File

@ -122,12 +122,16 @@ set @@global.general_log=@save_general_log;
--echo #
create function f() returns int return (select 1 from performance_schema.threads);
set global userstat= 1;
create table t1 (a int primary key);
insert into t1 values (1),(2);
select * from t1 where a=1;
--error ER_SUBQUERY_NO_1_ROW
select f() from information_schema.table_statistics;
--error ER_SUBQUERY_NO_1_ROW
select f() from information_schema.index_statistics;
set global userstat= 0;
drop function f;
drop table t1;
--enable_ps2_protocol
--echo #
@ -145,7 +149,9 @@ set global userstat= 1;
create or replace table t1 (a int, key(a)) engine=MyISAM;
insert into t1 values (1),(2),(3),(4);
flush index_statistics;
--disable_ps2_protocol
select a from t1 where a in ( select a from t1 );
--enable_ps2_protocol
show index_statistics;
drop table t1;
set global userstat=@save_userstat;