From 78a0b1676da525f9f3444cd66385dc08458d6915 Mon Sep 17 00:00:00 2001 From: Kamil Holubicki Date: Fri, 11 Oct 2024 12:10:22 +0200 Subject: [PATCH] PS-9453: percona_telemetry causes a long wait on COND_thd_list due to the absence of the root user https://perconadev.atlassian.net/browse/PS-9453 Adjusted MTR tests affected by the fix. --- mysql-test/r/grant.result | 8 ++++++-- mysql-test/r/information_schema_ci.result | 4 +++- mysql-test/r/information_schema_cs.result | 4 +++- mysql-test/r/transactional_acl_tables.result | 8 ++++++-- mysql-test/suite/funcs_1/r/is_table_privileges.result | 4 +++- mysql-test/suite/funcs_1/t/is_table_privileges.test | 4 +++- mysql-test/suite/innodb/t/log_first_rec_group-master.opt | 2 +- .../suite/perfschema/t/privilege_table_io-master.opt | 1 + mysql-test/t/grant.test | 8 ++++++-- .../t/grant_dynamic_session_variables_admin-master.opt | 1 + mysql-test/t/information_schema_cs.test | 5 ++++- mysql-test/t/mysql_upgrade-master.opt | 1 + mysql-test/t/transactional_acl_tables.test | 8 ++++++-- 13 files changed, 44 insertions(+), 14 deletions(-) mode change 100644 => 100755 mysql-test/r/information_schema_ci.result create mode 100644 mysql-test/suite/perfschema/t/privilege_table_io-master.opt create mode 100644 mysql-test/t/grant_dynamic_session_variables_admin-master.opt create mode 100644 mysql-test/t/mysql_upgrade-master.opt diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index f14d602f4040..9ab8e8d1d083 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -831,7 +831,9 @@ show grants for mysqltest_8; Grants for mysqltest_8@% GRANT USAGE ON *.* TO `mysqltest_8`@`%` GRANT UPDATE ON `test`.`t1` TO `mysqltest_8`@`%` -select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql'); +select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql') +and not (grantee = "'mysql.session'@'localhost'" +and table_name in ('component', 'replication_group_members')); GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE 'mysqltest_8'@'%' def test t1 UPDATE NO 'mysqltest_8'@'' def test t1 UPDATE NO @@ -845,7 +847,9 @@ GRANT USAGE ON *.* TO `mysqltest_8`@`` show grants for mysqltest_8; Grants for mysqltest_8@% GRANT USAGE ON *.* TO `mysqltest_8`@`%` -select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql'); +select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql') +and not (grantee = "'mysql.session'@'localhost'" +and table_name in ('component', 'replication_group_members')); GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE flush privileges; show grants for mysqltest_8@''; diff --git a/mysql-test/r/information_schema_ci.result b/mysql-test/r/information_schema_ci.result old mode 100644 new mode 100755 index 8660d4fd0e86..8a78ad2992bf --- a/mysql-test/r/information_schema_ci.result +++ b/mysql-test/r/information_schema_ci.result @@ -544,7 +544,9 @@ grant select (a) on test.t1 to joe@localhost with grant option; select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES WHERE table_schema != 'sys'; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE 'joe'@'localhost' def test t1 a SELECT YES -select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE table_schema NOT IN ('sys','mysql'); +select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE table_schema NOT IN ('sys','mysql') +and not (grantee = "'mysql.session'@'localhost'" +and table_name in ('component', 'replication_group_members')); GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE drop view v1, v2, v3; drop table t1; diff --git a/mysql-test/r/information_schema_cs.result b/mysql-test/r/information_schema_cs.result index db686d3ec4b2..6e2a85433468 100644 --- a/mysql-test/r/information_schema_cs.result +++ b/mysql-test/r/information_schema_cs.result @@ -544,7 +544,9 @@ grant select (a) on test.t1 to joe@localhost with grant option; select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES WHERE table_schema != 'sys'; GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE 'joe'@'localhost' def test t1 a SELECT YES -select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE table_schema NOT IN ('sys','mysql'); +select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE table_schema NOT IN ('sys','mysql') +and not (grantee = "'mysql.session'@'localhost'" +and table_name in ('component', 'replication_group_members')); GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE drop view v1, v2, v3; drop table t1; diff --git a/mysql-test/r/transactional_acl_tables.result b/mysql-test/r/transactional_acl_tables.result index 889f6fe7332a..aa6efa980e7d 100644 --- a/mysql-test/r/transactional_acl_tables.result +++ b/mysql-test/r/transactional_acl_tables.result @@ -1342,7 +1342,9 @@ SELECT host, db, user, table_name, column_name, column_priv FROM mysql.columns_p host db user table_name column_name column_priv h test u1 t1 a Select,Insert,Update,References h test u1 t2 a Insert -SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv; +SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv +WHERE NOT (user = 'mysql.session' +AND table_name IN ('component', 'replication_group_members')); host db user table_name grantor table_priv column_priv h test u1 t1 root@localhost Select,Insert,Update,References h test u1 t2 root@localhost Insert @@ -1354,7 +1356,9 @@ COMMIT; REVOKE ALL PRIVILEGES, GRANT OPTION FROM u1@h; SELECT host, db, user, table_name, column_name, column_priv FROM mysql.columns_priv; host db user table_name column_name column_priv -SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv; +SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv +WHERE NOT (user = 'mysql.session' +AND table_name IN ('component', 'replication_group_members')); host db user table_name grantor table_priv column_priv localhost mysql mysql.session user root@localhost Select localhost sys mysql.sys sys_config root@localhost Select diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result index 2c1f19f28ea7..91de9f2b83e2 100644 --- a/mysql-test/suite/funcs_1/r/is_table_privileges.result +++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result @@ -53,7 +53,9 @@ TABLE_NAME varchar(64) NO PRIVILEGE_TYPE varchar(64) NO IS_GRANTABLE varchar(3) NO SELECT table_catalog, table_schema, table_name, privilege_type -FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL; +FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL +AND NOT (grantee = "'mysql.session'@'localhost'" +AND table_name IN ('component', 'replication_group_members')); table_catalog table_schema table_name privilege_type def mysql user SELECT def sys sys_config SELECT diff --git a/mysql-test/suite/funcs_1/t/is_table_privileges.test b/mysql-test/suite/funcs_1/t/is_table_privileges.test index c66121409ea3..cb5397708242 100644 --- a/mysql-test/suite/funcs_1/t/is_table_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_table_privileges.test @@ -64,7 +64,9 @@ eval SHOW COLUMNS FROM information_schema.$is_table; # Show that TABLE_CATALOG is always NULL. --sorted_result SELECT table_catalog, table_schema, table_name, privilege_type -FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL; +FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL +AND NOT (grantee = "'mysql.session'@'localhost'" +AND table_name IN ('component', 'replication_group_members')); --echo ###################################################################### --echo # Testcase 3.2.11.2+3.2.11.3+3.2.11.4: diff --git a/mysql-test/suite/innodb/t/log_first_rec_group-master.opt b/mysql-test/suite/innodb/t/log_first_rec_group-master.opt index 789275fa25e2..d32e57403214 100644 --- a/mysql-test/suite/innodb/t/log_first_rec_group-master.opt +++ b/mysql-test/suite/innodb/t/log_first_rec_group-master.opt @@ -1 +1 @@ ---skip-log-bin +--skip-log-bin --loose-percona-telemetry-disable=ON diff --git a/mysql-test/suite/perfschema/t/privilege_table_io-master.opt b/mysql-test/suite/perfschema/t/privilege_table_io-master.opt new file mode 100644 index 000000000000..03813db02e49 --- /dev/null +++ b/mysql-test/suite/perfschema/t/privilege_table_io-master.opt @@ -0,0 +1 @@ +--loose-percona-telemetry-disable=ON diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 3ca2848927ff..6d9897f705d7 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -655,7 +655,9 @@ flush privileges; show grants for mysqltest_8@''; show grants for mysqltest_8; --sorted_result -select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql'); +select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql') +and not (grantee = "'mysql.session'@'localhost'" +and table_name in ('component', 'replication_group_members')); connect (conn5,localhost,mysqltest_8,,); select * from t1; disconnect conn5; @@ -665,7 +667,9 @@ revoke update on t1 from mysqltest_8; show grants for mysqltest_8@''; show grants for mysqltest_8; --sorted_result -select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql'); +select * from information_schema.table_privileges where table_schema NOT IN ('sys','mysql') +and not (grantee = "'mysql.session'@'localhost'" +and table_name in ('component', 'replication_group_members')); flush privileges; show grants for mysqltest_8@''; show grants for mysqltest_8; diff --git a/mysql-test/t/grant_dynamic_session_variables_admin-master.opt b/mysql-test/t/grant_dynamic_session_variables_admin-master.opt new file mode 100644 index 000000000000..03813db02e49 --- /dev/null +++ b/mysql-test/t/grant_dynamic_session_variables_admin-master.opt @@ -0,0 +1 @@ +--loose-percona-telemetry-disable=ON diff --git a/mysql-test/t/information_schema_cs.test b/mysql-test/t/information_schema_cs.test index 9fb8d780bf31..b26ba99ebf0d 100644 --- a/mysql-test/t/information_schema_cs.test +++ b/mysql-test/t/information_schema_cs.test @@ -292,7 +292,10 @@ select * from information_schema.views where table_schema != 'sys' order by table_name; grant select (a) on test.t1 to joe@localhost with grant option; select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES WHERE table_schema != 'sys'; -select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE table_schema NOT IN ('sys','mysql'); +select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES WHERE table_schema NOT IN ('sys','mysql') +and not (grantee = "'mysql.session'@'localhost'" +and table_name in ('component', 'replication_group_members')); + drop view v1, v2, v3; drop table t1; delete from mysql.user where user='joe'; diff --git a/mysql-test/t/mysql_upgrade-master.opt b/mysql-test/t/mysql_upgrade-master.opt new file mode 100644 index 000000000000..03813db02e49 --- /dev/null +++ b/mysql-test/t/mysql_upgrade-master.opt @@ -0,0 +1 @@ +--loose-percona-telemetry-disable=ON diff --git a/mysql-test/t/transactional_acl_tables.test b/mysql-test/t/transactional_acl_tables.test index 40ec1686f132..2677c9a85693 100644 --- a/mysql-test/t/transactional_acl_tables.test +++ b/mysql-test/t/transactional_acl_tables.test @@ -1829,14 +1829,18 @@ CREATE TABLE t2 (a INT); GRANT SELECT(a), UPDATE(a), INSERT(a), REFERENCES(a) ON t1 TO u1@h; GRANT INSERT(a) ON t2 TO u1@h; SELECT host, db, user, table_name, column_name, column_priv FROM mysql.columns_priv; -SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv; +SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv +WHERE NOT (user = 'mysql.session' +AND table_name IN ('component', 'replication_group_members')); DELETE FROM mysql.columns_priv WHERE host = 'h' AND user = 'u1' AND table_name = 't1'; COMMIT; REVOKE ALL PRIVILEGES, GRANT OPTION FROM u1@h; SELECT host, db, user, table_name, column_name, column_priv FROM mysql.columns_priv; -SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv; +SELECT host, db, user, table_name, grantor, table_priv, column_priv FROM mysql.tables_priv +WHERE NOT (user = 'mysql.session' +AND table_name IN ('component', 'replication_group_members')); SHOW GRANTS FOR u1@h; # Check whether on FLUSH PRIVILEGES the GRANT_TABLE::init handles OUT OF MEMORY