mariadb/mysql-test/suite/rpl/r/rpl_read_only.result
Sergei Golubchik 2ccf247e93 after merge changes:
* rename all debugging related command-line options
  and variables to start from "debug-", and made them all
  OFF by default.
* replace "MySQL" with "MariaDB" in error messages
* "Cast ... converted ... integer to it's ... complement"
  is now a note, not a warning
* @@query_cache_strip_comments now has a session scope,
  not global.
2011-12-12 23:58:40 +01:00

121 lines
2.2 KiB
Text

include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create user test;
create table t1(a int) engine=InnoDB;
create table t2(a int) engine=MyISAM;
insert into t1 values(1001);
insert into t2 values(2001);
set global read_only=1;
select @@read_only;
@@read_only
1
select * from t1;
a
1001
select * from t2;
a
2001
select @@read_only;
@@read_only
0
select * from t1;
a
1001
select * from t2;
a
2001
set global read_only=0;
BEGIN;
BEGIN;
select @@read_only;
@@read_only
0
set global read_only=1;
*** On SUPER USER connection ***
insert into t1 values(1002);
insert into t2 values(2002);
*** On regular USER connection ***
insert into t1 values(1003);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2003);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
*** SUPER USER COMMIT (must succeed) ***
COMMIT;
*** regular USER COMMIT (must succeed - nothing to commit) ***
COMMIT;
select @@read_only;
@@read_only
1
set global read_only=0;
insert into t1 values(1004);
insert into t2 values(2004);
select * from t1;
a
1001
1002
1004
select * from t2;
a
2001
2002
2004
select * from t1;
a
1001
1002
1004
select * from t2;
a
2001
2002
2004
set global read_only=1;
select @@read_only;
@@read_only
1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values(1005);
insert into t2 values(2005);
select * from t1;
a
1001
1002
1004
1005
select * from t2;
a
2001
2002
2004
2005
select * from t1;
a
1001
1002
1004
1005
select * from t2;
a
2001
2002
2004
2005
insert into t1 values(1006);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2006);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
drop user test;
drop table t1;
drop table t2;
set global read_only=0;
include/rpl_end.inc