~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/r/read_only.result

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DROP TABLE IF EXISTS t1,t2,t3;
 
2
grant CREATE, SELECT, DROP on *.* to test@localhost;
 
3
set global read_only=0;
 
4
create table t1 (a int);
 
5
insert into t1 values(1);
 
6
create table t2 select * from t1;
 
7
set global read_only=1;
 
8
create table t3 (a int);
 
9
drop table t3;
 
10
select @@global.read_only;
 
11
@@global.read_only
 
12
1
 
13
create table t3 (a int);
 
14
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
15
insert into t1 values(1);
 
16
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
17
update t1 set a=1 where 1=0;
 
18
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
19
update t1,t2 set t1.a=t2.a+1 where t1.a=t2.a;
 
20
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
21
delete t1,t2 from t1,t2 where t1.a=t2.a;
 
22
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
23
create temporary table t3 (a int);
 
24
create temporary table t4 (a int) select * from t3;
 
25
insert into t3 values(1);
 
26
insert into t4 select * from t3;
 
27
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
 
28
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
29
update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a;
 
30
update t4,t3 set t4.a=t3.a+1 where t4.a=t3.a;
 
31
delete t1 from t1,t3 where t1.a=t3.a;
 
32
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
33
delete t3 from t1,t3 where t1.a=t3.a;
 
34
delete t4 from t3,t4 where t4.a=t3.a;
 
35
create temporary table t1 (a int);
 
36
insert into t1 values(1);
 
37
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
 
38
delete t1 from t1,t3 where t1.a=t3.a;
 
39
drop table t1;
 
40
insert into t1 values(1);
 
41
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
42
set global read_only=0;
 
43
lock table t1 write;
 
44
lock table t2 write;
 
45
set global read_only=1;
 
46
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
 
47
unlock tables ;
 
48
set global read_only=1;
 
49
select @@global.read_only;
 
50
@@global.read_only
 
51
0
 
52
unlock tables ;
 
53
select @@global.read_only;
 
54
@@global.read_only
 
55
1
 
56
set global read_only=0;
 
57
lock table t1 read;
 
58
lock table t2 read;
 
59
set global read_only=1;
 
60
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
 
61
unlock tables ;
 
62
set global read_only=1;
 
63
select @@global.read_only;
 
64
@@global.read_only
 
65
0
 
66
unlock tables ;
 
67
select @@global.read_only;
 
68
@@global.read_only
 
69
1
 
70
set global read_only=0;
 
71
BEGIN;
 
72
BEGIN;
 
73
set global read_only=1;
 
74
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
 
75
ROLLBACK;
 
76
set global read_only=1;
 
77
select @@global.read_only;
 
78
@@global.read_only
 
79
1
 
80
ROLLBACK;
 
81
set global read_only=0;
 
82
flush tables with read lock;
 
83
set global read_only=1;
 
84
unlock tables;
 
85
set global read_only=0;
 
86
flush tables with read lock;
 
87
set global read_only=1;
 
88
select @@global.read_only;
 
89
@@global.read_only
 
90
1
 
91
unlock tables;
 
92
drop temporary table ttt;
 
93
ERROR 42S02: Unknown table 'ttt'
 
94
drop temporary table if exists ttt;
 
95
Warnings:
 
96
Note    1051    Unknown table 'ttt'
 
97
set global read_only=0;
 
98
drop table t1,t2;
 
99
drop user test@localhost;
 
100
#
 
101
# Bug #27440 read_only allows create and drop database
 
102
#
 
103
set global read_only= 1;
 
104
drop database if exists mysqltest_db1;
 
105
drop database if exists mysqltest_db2;
 
106
delete from mysql.user where User like 'mysqltest_%';
 
107
delete from mysql.db where User like 'mysqltest_%';
 
108
delete from mysql.tables_priv where User like 'mysqltest_%';
 
109
delete from mysql.columns_priv where User like 'mysqltest_%';
 
110
flush privileges;
 
111
grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
 
112
create database mysqltest_db1;
 
113
grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
 
114
flush privileges;
 
115
create database mysqltest_db2;
 
116
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
117
show databases like '%mysqltest_db2%';
 
118
Database (%mysqltest_db2%)
 
119
drop database mysqltest_db1;
 
120
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
 
121
delete from mysql.user where User like 'mysqltest_%';
 
122
delete from mysql.db where User like 'mysqltest_%';
 
123
delete from mysql.tables_priv where User like 'mysqltest_%';
 
124
delete from mysql.columns_priv where User like 'mysqltest_%';
 
125
flush privileges;
 
126
drop database mysqltest_db1;
 
127
set global read_only=0;