Skip to content

Commit 4654b4f

Browse files
committed
MDEV-37893 - main.public_privileges fails sporadically
Test output was affected by incompletely closed preceding connections. Make test agnostic to concurrent connections by querying information_schema.processlist only for connections that it uses.
1 parent a405218 commit 4654b4f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

mysql-test/main/public_privileges.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ create database testdb;
8484
use testdb;
8585
create procedure p1 () select 1;
8686
connect testuser,localhost,testuser,,;
87-
select user,db from information_schema.processlist where user='root';
87+
select user,db from information_schema.processlist where id=$default_id;
8888
user db
8989
call testdb.p1();
9090
ERROR 42000: execute command denied to user 'testuser'@'%' for routine 'testdb.p1'
@@ -93,7 +93,7 @@ GRANT PROCESS ON *.* to PUBLIC;
9393
GRANT EXECUTE ON testdb.* to PUBLIC;
9494
disconnect testuser;
9595
connect testuser,localhost,testuser,,;
96-
select user,db from information_schema.processlist where user='root';
96+
select user,db from information_schema.processlist where id=$default_id;
9797
user db
9898
root testdb
9999
call testdb.p1();
@@ -104,7 +104,7 @@ disconnect testuser;
104104
# check that the privileges are correctly read by acl_load
105105
flush privileges;
106106
connect testuser,localhost,testuser,,;
107-
select user,db from information_schema.processlist where user='root';
107+
select user,db from information_schema.processlist where id=$default_id;
108108
user db
109109
root testdb
110110
call testdb.p1();

mysql-test/main/public_privileges.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ create user testuser;
7878
create database testdb;
7979
use testdb;
8080
create procedure p1 () select 1;
81+
let $default_id= `select connection_id()`;
8182

8283
connect (testuser,localhost,testuser,,);
8384

84-
select user,db from information_schema.processlist where user='root';
85+
evalp select user,db from information_schema.processlist where id=$default_id;
8586
--error ER_PROCACCESS_DENIED_ERROR
8687
call testdb.p1();
8788

@@ -94,7 +95,7 @@ GRANT EXECUTE ON testdb.* to PUBLIC;
9495
disconnect testuser;
9596
connect (testuser,localhost,testuser,,);
9697

97-
select user,db from information_schema.processlist where user='root';
98+
evalp select user,db from information_schema.processlist where id=$default_id;
9899
call testdb.p1();
99100

100101
connection default;
@@ -105,7 +106,7 @@ flush privileges;
105106

106107
connect (testuser,localhost,testuser,,);
107108

108-
select user,db from information_schema.processlist where user='root';
109+
evalp select user,db from information_schema.processlist where id=$default_id;
109110
call testdb.p1();
110111

111112
connection default;

0 commit comments

Comments
 (0)