File: flush_notembedded.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (85 lines) | stat: -rw-r--r-- 2,394 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
source include/not_embedded.inc;
source include/have_perfschema.inc;

--echo #
--echo # MDEV-15888 Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views.
--echo #

--echo #
--echo # privilege checks with views
--echo #
create database mysqltest1;
create table mysqltest1.t1 (a int);
create user u1@localhost;
grant reload on *.* to u1@localhost;
grant select on mysqltest1.* to u1@localhost;
grant all on test.* to u1@localhost;
connect u1,localhost,u1;
error ER_DBACCESS_DENIED_ERROR;
flush tables mysqltest1.t1 for export;
create view v as select * from mysqltest1.t1;
create view v2 as select * from v;
create view v3 as select * from (select * from mysqltest1.t1) x;
error ER_DBACCESS_DENIED_ERROR;
flush tables v for export;
error ER_DBACCESS_DENIED_ERROR;
flush tables v2 for export;
error ER_DBACCESS_DENIED_ERROR;
flush tables v3 for export;
disconnect u1;
connection default;
drop database mysqltest1;
drop view v, v2, v3;
drop user u1@localhost;

--echo #
--echo # MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | SIGSEGV in ha_maria::extra
--echo #
CREATE VIEW v0 AS SELECT * FROM information_schema.columns; # Aria
CREATE VIEW v1 AS SELECT * FROM information_schema.collations; # Heap
CREATE VIEW v2 AS SELECT * FROM performance_schema.accounts;

--disable_abort_on_error
--echo #
--echo # first try to flush tables directly
--echo #
FLUSH TABLE information_schema.collations WITH READ LOCK;
FLUSH TABLE performance_schema.accounts WITH READ LOCK;
FLUSH TABLE information_schema.colums WITH READ LOCK;
FLUSH TABLE information_schema.collations FOR EXPORT;
FLUSH TABLE performance_schema.accounts FOR EXPORT;
FLUSH TABLE information_schema.colums FOR EXPORT;

--echo #
--echo # and now via views
--echo #
FLUSH TABLE v0 WITH READ LOCK;
FLUSH TABLE v1 WITH READ LOCK;
FLUSH TABLE v2 WITH READ LOCK;
FLUSH TABLE v0 FOR EXPORT;
FLUSH TABLE v1 FOR EXPORT;
FLUSH TABLE v2 FOR EXPORT;
--enable_abort_on_error
DROP VIEW v0, v1, v2;

--echo #
--echo # End of 10.6 tests
--echo #

--echo #
--echo # MDEV-33145 Add FLUSH GLOBAL STATUS
--echo #

CREATE USER mysqltest@localhost;
GRANT USAGE ON *.* TO mysqltest@localhost;

connect(con1, localhost, mysqltest);
FLUSH STATUS;
FLUSH SESSION STATUS;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
FLUSH GLOBAL STATUS;
disconnect con1;
connection default;
DROP USER mysqltest@localhost;

--echo # End of 11.5 tests