Debian Codegraph @

mysql-test/suite/sys_vars/r/require_row_format_basic.result

raw
1 #
2 # 0. Create a user and a connection with it
3 CREATE USER u1@localhost;
4 GRANT ALL ON db1.* TO u1@localhost;
5 SELECT CURRENT_USER();
6 CURRENT_USER()
7 u1@localhost
8 SHOW GRANTS FOR CURRENT_USER();
9 Grants for u1@localhost
10 GRANT USAGE ON *.* TO `u1`@`localhost`
11 GRANT ALL PRIVILEGES ON `db1`.* TO `u1`@`localhost`
12 #
13 # 1. Test the use by a unprivileged user
14 include/assert.inc [By default the value is set to OFF]
15 SET GLOBAL require_row_format=true;
16 ERROR HY000: Variable 'require_row_format' is a SESSION variable and can't be used with SET GLOBAL
17 SET PERSIST require_row_format=true;
18 ERROR HY000: Variable 'require_row_format' is a SESSION variable and can't be used with SET GLOBAL
19 SET PERSIST_ONLY require_row_format=true;
20 ERROR HY000: Variable 'require_row_format' is a SESSION variable and can't be used with SET GLOBAL
21 SET SESSION require_row_format=false;
22 SET SESSION require_row_format=true;
23 SET SESSION require_row_format=false;
24 ERROR 42000: Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation
25 SET SESSION require_row_format=DEFAULT;
26 ERROR 42000: Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation
27 #
28 # 2. Test the use by a user with SESSION_VARIABLES_ADMIN privilege.
29 GRANT SESSION_VARIABLES_ADMIN ON *.* TO u1@localhost;
30 SELECT CURRENT_USER();
31 CURRENT_USER()
32 u1@localhost
33 SHOW GRANTS FOR CURRENT_USER();
34 Grants for u1@localhost
35 GRANT USAGE ON *.* TO `u1`@`localhost`
36 GRANT SESSION_VARIABLES_ADMIN ON *.* TO `u1`@`localhost`
37 GRANT ALL PRIVILEGES ON `db1`.* TO `u1`@`localhost`
38 SET SESSION require_row_format=false;
39 SET SESSION require_row_format=true;
40 SET SESSION require_row_format=DEFAULT;
41 #
42 # 3. Test the use by a user with SYSTEM_VARIABLES_ADMIN privilege.
43 REVOKE SESSION_VARIABLES_ADMIN ON *.* FROM u1@localhost;
44 GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO u1@localhost;
45 SELECT CURRENT_USER();
46 CURRENT_USER()
47 u1@localhost
48 SHOW GRANTS FOR CURRENT_USER();
49 Grants for u1@localhost
50 GRANT USAGE ON *.* TO `u1`@`localhost`
51 GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO `u1`@`localhost`
52 GRANT ALL PRIVILEGES ON `db1`.* TO `u1`@`localhost`
53 SET SESSION require_row_format=true;
54 SET SESSION require_row_format=false;
55 SET SESSION require_row_format=true;
56 #
57 # 4. Test the use by a user with SUPER privilege.
58 REVOKE SESSION_VARIABLES_ADMIN ON *.* FROM u1@localhost;
59 GRANT SUPER ON *.* TO u1@localhost;
60 Warnings:
61 Warning 1287 The SUPER privilege identifier is deprecated
62 SELECT CURRENT_USER();
63 CURRENT_USER()
64 u1@localhost
65 SHOW GRANTS FOR CURRENT_USER();
66 Grants for u1@localhost
67 GRANT SUPER ON *.* TO `u1`@`localhost`
68 GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO `u1`@`localhost`
69 GRANT ALL PRIVILEGES ON `db1`.* TO `u1`@`localhost`
70 SET SESSION require_row_format=true;
71 SELECT @@SESSION.require_row_format = true;
72 @@SESSION.require_row_format = true
73 1
74 SET SESSION require_row_format=false;
75 SELECT @@SESSION.require_row_format = false;
76 @@SESSION.require_row_format = false
77 1
78 SET SESSION require_row_format=true;
79 SELECT @@SESSION.require_row_format = true;
80 @@SESSION.require_row_format = true
81 1
82 #
83 # 5. Test errors when changing the variable to invalid values
84 SET SESSION require_row_format = -1;
85 ERROR 42000: Variable 'require_row_format' can't be set to the value of '-1'
86 SET SESSION require_row_format = 100000000000;
87 ERROR 42000: Variable 'require_row_format' can't be set to the value of '100000000000'
88 SET SESSION require_row_format = 10000.01;
89 ERROR 42000: Incorrect argument type to variable 'require_row_format'
90 SET SESSION require_row_format = 'test';
91 ERROR 42000: Variable 'require_row_format' can't be set to the value of 'test'
92 SET SESSION require_row_format = '';
93 ERROR 42000: Variable 'require_row_format' can't be set to the value of ''
94 #
95 # 6. Cleanup
96 DROP USER u1@localhost;
97 SET SESSION require_row_format=default;