You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MDEV-20549 test output was affected by incompletely closed preceding
connections.
Fix for similar issue was attempted by f4eb095, it introduced
wait_until_disconnected.inc. For an explanation of why it didn't work
see bead24b commit comment.
Another fix was attempted in bead24b. It didn't help either,
because connection is removed from information_schema.processlist
after COM_QUIT handling.
Make test for MDEV-20549 agnostic to concurrent connections by
querying information_schema.processlist only for connections that
it uses.
Copy file name to clipboardExpand all lines: mysql-test/main/information_schema_db.result
+5-8Lines changed: 5 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -215,11 +215,8 @@ connection default;
215
215
use test;
216
216
drop view testdb_1.v1, v2, testdb_1.v3, v4;
217
217
drop database testdb_1;
218
-
connection testdb_1;
219
218
disconnect testdb_1;
220
-
connection testdb_2;
221
219
disconnect testdb_2;
222
-
connection default;
223
220
drop user testdb_1@localhost;
224
221
drop user testdb_2@localhost;
225
222
#
@@ -251,18 +248,18 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table `
251
248
connection default;
252
249
drop user mysqltest_1@localhost;
253
250
drop database testdb_1;
254
-
connection user1;
255
251
disconnect user1;
256
-
connection default;
257
252
set global sql_mode=default;
258
253
#
259
254
# MDEV-20549 SQL SECURITY DEFINER does not work for INFORMATION_SCHEMA tables
260
255
#
261
256
create user foo@localhost;
262
257
grant select on test.* to foo@localhost;
258
+
connect foo,localhost,foo;
259
+
connection default;
263
260
create procedure rootonly() select 1;
264
-
create sql security definer view v1d as select current_user(),user from information_schema.processlist where command!='daemon';
265
-
create sql security invoker view v1i as select current_user(),user from information_schema.processlist where command!='daemon';
261
+
create sql security definer view v1d as select current_user(),user from information_schema.processlist where id in($default_id, $foo_id) order by user;
262
+
create sql security invoker view v1i as select current_user(),user from information_schema.processlist where id in($default_id, $foo_id) order by user;
266
263
create sql security definer view v2d as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
267
264
create sql security invoker view v2i as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
268
265
create sql security definer view v3d as select schema_name from information_schema.schemata where schema_name like '%mysql%';
@@ -271,7 +268,7 @@ create sql security definer view v4d as select routine_name from information_sch
271
268
create sql security invoker view v4i as select routine_name from information_schema.routines where routine_schema='test';
272
269
create sql security definer view v5d as select view_definition > '' from information_schema.views where table_name='v1d';
273
270
create sql security invoker view v5i as select view_definition > '' from information_schema.views where table_name='v1d';
Copy file name to clipboardExpand all lines: mysql-test/main/information_schema_db.test
+7-11Lines changed: 7 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -206,13 +206,8 @@ connection default;
206
206
use test;
207
207
drop view testdb_1.v1, v2, testdb_1.v3, v4;
208
208
drop database testdb_1;
209
-
connection testdb_1;
210
209
disconnect testdb_1;
211
-
--source include/wait_until_disconnected.inc
212
-
connection testdb_2;
213
210
disconnect testdb_2;
214
-
--source include/wait_until_disconnected.inc
215
-
connection default;
216
211
drop user testdb_1@localhost;
217
212
drop user testdb_2@localhost;
218
213
@@ -243,10 +238,7 @@ show create view testdb_1.v1;
243
238
connection default;
244
239
drop user mysqltest_1@localhost;
245
240
drop database testdb_1;
246
-
connection user1;
247
241
disconnect user1;
248
-
--source include/wait_until_disconnected.inc
249
-
connection default;
250
242
251
243
set global sql_mode=default;
252
244
@@ -256,9 +248,13 @@ set global sql_mode=default;
256
248
257
249
create user foo@localhost;
258
250
grant select on test.* to foo@localhost;
251
+
let $default_id= `select connection_id()`;
252
+
connect foo,localhost,foo;
253
+
let $foo_id= `select connection_id()`;
254
+
connection default;
259
255
create procedure rootonly() select 1;
260
-
create sql security definer view v1d as select current_user(),user from information_schema.processlist where command!='daemon';
261
-
create sql security invoker view v1i as select current_user(),user from information_schema.processlist where command!='daemon';
256
+
evalp create sql security definer view v1d as select current_user(),user from information_schema.processlist where id in($default_id, $foo_id) order by user;
257
+
evalp create sql security invoker view v1i as select current_user(),user from information_schema.processlist where id in($default_id, $foo_id) order by user;
262
258
create sql security definer view v2d as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
263
259
create sql security invoker view v2i as select table_name from information_schema.tables where table_schema='mysql' and table_name like '%user%';
264
260
create sql security definer view v3d as select schema_name from information_schema.schemata where schema_name like '%mysql%';
@@ -267,7 +263,7 @@ create sql security definer view v4d as select routine_name from information_sch
267
263
create sql security invoker view v4i as select routine_name from information_schema.routines where routine_schema='test';
268
264
create sql security definer view v5d as select view_definition > '' from information_schema.views where table_name='v1d';
269
265
create sql security invoker view v5i as select view_definition > '' from information_schema.views where table_name='v1d';
0 commit comments