~drizzle-trunk/drizzle/development

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
-- source include/have_innodb.inc

#
# BUG#11733: COMMITs should not happen if read-only is set
#

--disable_warnings
DROP TABLE IF EXISTS table_11733 ;
--enable_warnings

# READ_ONLY does nothing to SUPER users
# so we use a non-SUPER one:

grant CREATE, SELECT, DROP on *.* to test@localhost;

connect (con1,localhost,test,,test);

connection default;
set global read_only=0;

# Any transactional engine will do
create table table_11733 (a int) engine=InnoDb;

connection con1;
BEGIN;
insert into table_11733 values(11733);

connection default;
set global read_only=1;

connection con1;
select @@global.read_only;
select * from table_11733 ;
-- error ER_OPTION_PREVENTS_STATEMENT
COMMIT;

connection default;
set global read_only=0;
drop table table_11733 ;
drop user test@localhost;