mariadb/mysql-test/r/rpl_read_only.result
unknown 245b9ad4b3 Make sure tests drops objects created and restore variables to default
mysql-test/extra/rpl_tests/rpl_row_func003.test:
  Fix spelling error
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
  Restore sql_mode after test
mysql-test/r/events_logs_tests.result:
  Turn even_scheduleroff before test ends
mysql-test/r/events_scheduling.result:
  Turn even_scheduleroff before test ends
mysql-test/r/insert.result:
  Drop tables t1 before test ends
mysql-test/r/rpl_read_only.result:
  Set read_only flag back to default
mysql-test/r/rpl_row_NOW.result:
  Drop database mysqltest1 before test ends
mysql-test/r/rpl_row_USER.result:
  Drop users created by test
mysql-test/r/rpl_row_basic_11bugs.result:
  Drop table and set query_cache_size back to default
mysql-test/r/rpl_row_func002.result:
  Drop table created by test
mysql-test/r/rpl_row_sp008.result:
  Drop table created by test
mysql-test/r/rpl_row_sp012.result:
  Drop user created by test
mysql-test/r/rpl_row_tabledefs_2myisam.result:
  Restore sql_mode
mysql-test/r/rpl_row_tabledefs_3innodb.result:
  Restore sql_mode
mysql-test/r/rpl_row_tabledefs_7ndb.result:
  Restore sql_mode
mysql-test/r/rpl_row_view01.result:
  Drop database created by test
mysql-test/r/rpl_slave_status.result:
  Remove created users
mysql-test/r/rpl_switch_stm_row_mixed.result:
  Reset binlog_format to default
mysql-test/r/sp.result:
  Drop procedure created by test
mysql-test/r/varbinary.result:
  Drop table created by test
mysql-test/r/variables.result:
  Reset changed variables to their defaults
mysql-test/t/events_logs_tests.test:
  Turn off event_scheduler before test ends
mysql-test/t/events_scheduling.test:
  Turn off event_scheduler
mysql-test/t/insert.test:
  Drop table created by test
mysql-test/t/rpl_read_only.test:
  Reset read_only flag
mysql-test/t/rpl_row_NOW.test:
  Drop db created by test
mysql-test/t/rpl_row_USER.test:
  Drop users created
mysql-test/t/rpl_row_basic_11bugs.test:
  Drop tables created by test
mysql-test/t/rpl_row_func002.test:
  Drop table created by test
mysql-test/t/rpl_row_sp008.test:
  Drop table created by test
mysql-test/t/rpl_row_sp012.test:
  Drop user created by test
mysql-test/t/rpl_row_view01.test:
  Drop db created by test
mysql-test/t/rpl_slave_status.test:
  Remove users created by test
mysql-test/t/rpl_switch_stm_row_mixed.test:
  Reset binlog_format
mysql-test/t/sp.test:
  Drop procedure created by test
mysql-test/t/varbinary.test:
  Drop tables created by test
mysql-test/t/variables.test:
  Restore variables to their default before test ends
2007-03-01 14:16:38 +01:00

116 lines
1.9 KiB
Text

stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
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;
insert into t1 values(1002);
insert into t2 values(2002);
BEGIN;
insert into t1 values(1003);
insert into t2 values(2003);
set global read_only=1;
COMMIT;
COMMIT;
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
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
2003
2004
select * from t1;
a
1001
1002
1004
select * from t2;
a
2001
2002
2003
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
2003
2004
2005
select * from t1;
a
1001
1002
1004
1005
select * from t2;
a
2001
2002
2003
2004
2005
insert into t1 values(1006);
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2006);
ERROR HY000: The MySQL 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;