1
by brian
clean slate |
1 |
-- source include/have_innodb.inc |
2 |
||
3 |
#
|
|
4 |
# BUG#11733: COMMITs should not happen if read-only is set |
|
5 |
#
|
|
6 |
||
7 |
--disable_warnings |
|
8 |
DROP TABLE IF EXISTS table_11733 ; |
|
9 |
--enable_warnings |
|
10 |
||
11 |
# READ_ONLY does nothing to SUPER users |
|
12 |
# so we use a non-SUPER one: |
|
13 |
||
14 |
grant CREATE, SELECT, DROP on *.* to test@localhost; |
|
15 |
||
16 |
connect (con1,localhost,test,,test); |
|
17 |
||
18 |
connection default; |
|
19 |
set global read_only=0; |
|
20 |
||
21 |
# Any transactional engine will do |
|
22 |
create table table_11733 (a int) engine=InnoDb; |
|
23 |
||
24 |
connection con1; |
|
25 |
BEGIN; |
|
26 |
insert into table_11733 values(11733); |
|
27 |
||
28 |
connection default; |
|
29 |
set global read_only=1; |
|
30 |
||
31 |
connection con1; |
|
32 |
select @@global.read_only; |
|
33 |
select * from table_11733 ; |
|
34 |
-- error ER_OPTION_PREVENTS_STATEMENT |
|
35 |
COMMIT; |
|
36 |
||
37 |
connection default; |
|
38 |
set global read_only=0; |
|
39 |
drop table table_11733 ; |
|
40 |
drop user test@localhost; |
|
41 |