Debian Codegraph @

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

raw
1 ** Setup **
2
3 SET @default_read_only = @@read_only;
4 '#--------------------FN_DYNVARS_140_01-------------------------#'
5 SET Global read_only=ON;
6 DROP TABLE IF EXISTS t1;
7 CREATE TABLE t1
8 (
9 id INT NOT NULL auto_increment,
10 PRIMARY KEY (id),
11 name BLOB
12 );
13 INSERT into t1(name) values("aaassssssssddddddddffffff");
14 update t1 set name="jfjdf" where id=1;
15 select * from t1 where id=1;
16 id name
17 1 jfjdf
18 '#--------------------FN_DYNVARS_140_02-------------------------#'
19 ** Creating new user with out super privilege**
20 CREATE user sameea;
21 grant all on test.* to sameea;
22 CONNECT connn,localhost,sameea,,;
23 SET Global read_ONLY=ON;
24 ERROR 42000: Access denied; you need (at least one of) the READ_ONLY ADMIN privilege(s) for this operation
25 CREATE TABLE t2
26 (
27 id INT NOT NULL auto_increment,
28 PRIMARY KEY (id),
29 name BLOB
30 );
31 ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
32 not updating values
33 INSERT into t2(name) values("aaassssssssddddddddffffff");
34 Got one of the listed errors
35 UPDATE t2 SET name="samia" where id=1;
36 Got one of the listed errors
37 '#--------------------FN_DYNVARS_140_03-------------------------#'
38 CREATE TEMPORARY TABLE t3(a int);
39 '#--------------------FN_DYNVARS_140_04-------------------------#'
40 connection default;
41 SET Global read_only=OFF;
42 connection connn;
43 CREATE TABLE t2
44 (
45 id INT NOT NULL auto_increment,
46 PRIMARY KEY (id),
47 name BLOB
48 );
49 updating values
50 INSERT into t2(name) values("aaassssssssdddddddd");
51 UPDATE t2 SET name="samia" where id=1;
52 connection default;
53 disconnect connn;
54 DROP USER sameea;
55 DROP TABLE t1;
56 DROP TABLE t2;
57 SET global read_only = @default_read_only;