2005-12-22 06:39:02 +01:00
|
|
|
# Mixed DDL-DML (CREATE ... SELECT ...) statements can only be
|
|
|
|
# replicated properly in statement-based replication.
|
|
|
|
# Currently statement based due to bug 12345
|
|
|
|
--source include/have_binlog_format_statement.inc
|
|
|
|
|
2000-12-07 07:54:59 -07:00
|
|
|
source include/master-slave.inc;
|
2003-01-06 01:48:59 +02:00
|
|
|
|
2004-02-17 01:35:17 +02:00
|
|
|
# Test replication of auto_increment
|
|
|
|
|
2001-01-03 02:15:48 +02:00
|
|
|
create table t1 (n int auto_increment primary key);
|
2000-11-17 23:35:40 -07:00
|
|
|
set insert_id = 2000;
|
2001-01-03 02:15:48 +02:00
|
|
|
insert into t1 values (NULL),(NULL),(NULL);
|
2002-10-24 17:46:14 -06:00
|
|
|
sync_slave_with_master;
|
2001-02-14 21:23:20 -07:00
|
|
|
select * from t1;
|
2001-01-17 05:47:33 -07:00
|
|
|
connection master;
|
2002-08-08 03:12:02 +03:00
|
|
|
--replace_result $SLAVE_MYPORT 9999
|
2001-05-30 18:50:56 -06:00
|
|
|
show slave hosts;
|
2001-01-03 02:15:48 +02:00
|
|
|
drop table t1;
|
2002-10-24 17:46:14 -06:00
|
|
|
sync_slave_with_master;
|
|
|
|
stop slave;
|
2001-02-14 21:23:20 -07:00
|
|
|
connection master;
|
2004-02-17 01:35:17 +02:00
|
|
|
|
|
|
|
# Test replication of timestamp
|
|
|
|
|
2001-02-14 21:23:20 -07:00
|
|
|
create table t2(id int auto_increment primary key, created datetime);
|
|
|
|
set timestamp=12345;
|
|
|
|
insert into t2 set created=now();
|
|
|
|
select * from t2;
|
2004-02-17 01:35:17 +02:00
|
|
|
|
|
|
|
# Test replication of CREATE .. LIKE (Bug #2557)
|
|
|
|
|
|
|
|
create table t3 like t2;
|
|
|
|
create temporary table t4 like t2;
|
|
|
|
create table t5 select * from t4;
|
2001-02-14 21:23:20 -07:00
|
|
|
save_master_pos;
|
|
|
|
connection slave;
|
2002-10-24 17:46:14 -06:00
|
|
|
start slave;
|
2001-02-14 21:23:20 -07:00
|
|
|
sync_with_master;
|
|
|
|
select * from t2;
|
2004-02-17 01:35:17 +02:00
|
|
|
show create table t3;
|
|
|
|
show create table t5;
|
2001-02-14 21:23:20 -07:00
|
|
|
connection master;
|
2004-02-17 01:35:17 +02:00
|
|
|
drop table t2,t3,t5;
|
2002-10-24 17:46:14 -06:00
|
|
|
sync_slave_with_master;
|
2005-07-28 03:22:47 +03:00
|
|
|
|
|
|
|
# End of 4.1 tests
|