2002-11-16 19:19:10 +01:00
|
|
|
drop table if exists t1, t2, t3, t4;
|
|
|
|
drop table if exists t1, t2, t3, t4;
|
2002-10-25 01:46:14 +02:00
|
|
|
start slave;
|
2005-02-16 17:34:02 +01:00
|
|
|
Got one of the listed errors
|
2002-10-25 01:46:14 +02:00
|
|
|
start slave;
|
2004-06-15 22:38:36 +02:00
|
|
|
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
2002-09-11 05:40:08 +02:00
|
|
|
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
2004-06-15 22:38:36 +02:00
|
|
|
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
2001-09-28 07:05:54 +02:00
|
|
|
reset slave;
|
2002-09-11 05:40:08 +02:00
|
|
|
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
2001-09-28 07:05:54 +02:00
|
|
|
reset master;
|
2002-10-25 01:46:14 +02:00
|
|
|
start slave;
|
2002-08-24 01:08:10 +02:00
|
|
|
create temporary table temp_table (a char(80) not null);
|
|
|
|
insert into temp_table values ("testing temporary tables");
|
2001-09-28 07:05:54 +02:00
|
|
|
create table t1 (s text);
|
|
|
|
insert into t1 values('Could not break slave'),('Tried hard');
|
2007-06-11 22:15:39 +02:00
|
|
|
SHOW SLAVE STATUS;
|
|
|
|
Slave_IO_State #
|
|
|
|
Master_Host 127.0.0.1
|
|
|
|
Master_User root
|
|
|
|
Master_Port MASTER_PORT
|
|
|
|
Connect_Retry 60
|
|
|
|
Master_Log_File master-bin.000001
|
|
|
|
Read_Master_Log_Pos 556
|
|
|
|
Relay_Log_File #
|
|
|
|
Relay_Log_Pos #
|
|
|
|
Relay_Master_Log_File master-bin.000001
|
|
|
|
Slave_IO_Running Yes
|
|
|
|
Slave_SQL_Running Yes
|
|
|
|
Replicate_Do_DB
|
|
|
|
Replicate_Ignore_DB
|
|
|
|
Replicate_Do_Table
|
|
|
|
Replicate_Ignore_Table #
|
|
|
|
Replicate_Wild_Do_Table
|
|
|
|
Replicate_Wild_Ignore_Table
|
|
|
|
Last_Errno 0
|
|
|
|
Last_Error
|
|
|
|
Skip_Counter 0
|
|
|
|
Exec_Master_Log_Pos 556
|
|
|
|
Relay_Log_Space #
|
|
|
|
Until_Condition None
|
|
|
|
Until_Log_File
|
|
|
|
Until_Log_Pos 0
|
|
|
|
Master_SSL_Allowed No
|
|
|
|
Master_SSL_CA_File
|
|
|
|
Master_SSL_CA_Path
|
|
|
|
Master_SSL_Cert
|
|
|
|
Master_SSL_Cipher
|
|
|
|
Master_SSL_Key
|
|
|
|
Seconds_Behind_Master #
|
|
|
|
Master_SSL_Verify_Server_Cert No
|
|
|
|
Last_IO_Errno #
|
|
|
|
Last_IO_Error #
|
|
|
|
Last_SQL_Errno 0
|
|
|
|
Last_SQL_Error
|
2001-09-28 07:05:54 +02:00
|
|
|
select * from t1;
|
2000-12-27 02:31:06 +01:00
|
|
|
s
|
|
|
|
Could not break slave
|
|
|
|
Tried hard
|
2001-09-28 07:05:54 +02:00
|
|
|
flush logs;
|
2001-11-28 15:11:05 +01:00
|
|
|
create table t2(m int not null auto_increment primary key);
|
2001-09-28 07:05:54 +02:00
|
|
|
insert into t2 values (34),(67),(123);
|
|
|
|
flush logs;
|
2002-10-25 02:32:42 +02:00
|
|
|
show binary logs;
|
2005-05-19 12:34:15 +02:00
|
|
|
Log_name File_size
|
2007-03-30 04:44:49 +02:00
|
|
|
master-bin.000001 600
|
|
|
|
master-bin.000002 371
|
|
|
|
master-bin.000003 106
|
2002-08-24 01:08:10 +02:00
|
|
|
create table t3 select * from temp_table;
|
|
|
|
select * from t3;
|
|
|
|
a
|
|
|
|
testing temporary tables
|
|
|
|
drop table temp_table, t3;
|
2001-09-28 07:05:54 +02:00
|
|
|
insert into t2 values(1234);
|
2001-11-28 15:11:05 +01:00
|
|
|
set insert_id=1234;
|
|
|
|
insert into t2 values(NULL);
|
2002-07-23 17:31:22 +02:00
|
|
|
set global sql_slave_skip_counter=1;
|
2002-10-25 01:46:14 +02:00
|
|
|
start slave;
|
2003-03-11 10:49:06 +01:00
|
|
|
purge master logs to 'master-bin.000002';
|
2003-07-12 23:31:21 +02:00
|
|
|
show master logs;
|
2005-05-19 12:34:15 +02:00
|
|
|
Log_name File_size
|
2007-03-30 04:44:49 +02:00
|
|
|
master-bin.000002 371
|
|
|
|
master-bin.000003 415
|
2003-07-12 23:31:21 +02:00
|
|
|
purge binary logs to 'master-bin.000002';
|
2003-03-11 10:49:06 +01:00
|
|
|
show binary logs;
|
2005-05-19 12:34:15 +02:00
|
|
|
Log_name File_size
|
2007-03-30 04:44:49 +02:00
|
|
|
master-bin.000002 371
|
|
|
|
master-bin.000003 415
|
2007-05-21 11:33:58 +02:00
|
|
|
select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
|
|
|
|
from information_schema.tables
|
|
|
|
where TABLE_SCHEMA="test" and TABLE_NAME="t2";
|
|
|
|
purge master logs before (@time_for_purge);
|
2002-10-25 02:32:42 +02:00
|
|
|
show binary logs;
|
2005-05-19 12:34:15 +02:00
|
|
|
Log_name File_size
|
2007-03-30 04:44:49 +02:00
|
|
|
master-bin.000003 415
|
2001-09-28 07:05:54 +02:00
|
|
|
insert into t2 values (65);
|
2007-06-11 22:15:39 +02:00
|
|
|
SHOW SLAVE STATUS;
|
|
|
|
Slave_IO_State #
|
|
|
|
Master_Host 127.0.0.1
|
|
|
|
Master_User root
|
|
|
|
Master_Port MASTER_PORT
|
|
|
|
Connect_Retry 60
|
|
|
|
Master_Log_File master-bin.000003
|
|
|
|
Read_Master_Log_Pos 504
|
|
|
|
Relay_Log_File #
|
|
|
|
Relay_Log_Pos #
|
|
|
|
Relay_Master_Log_File master-bin.000003
|
|
|
|
Slave_IO_Running Yes
|
|
|
|
Slave_SQL_Running Yes
|
|
|
|
Replicate_Do_DB
|
|
|
|
Replicate_Ignore_DB
|
|
|
|
Replicate_Do_Table
|
|
|
|
Replicate_Ignore_Table #
|
|
|
|
Replicate_Wild_Do_Table
|
|
|
|
Replicate_Wild_Ignore_Table
|
|
|
|
Last_Errno 0
|
|
|
|
Last_Error
|
|
|
|
Skip_Counter 0
|
|
|
|
Exec_Master_Log_Pos 504
|
|
|
|
Relay_Log_Space #
|
|
|
|
Until_Condition None
|
|
|
|
Until_Log_File
|
|
|
|
Until_Log_Pos 0
|
|
|
|
Master_SSL_Allowed No
|
|
|
|
Master_SSL_CA_File
|
|
|
|
Master_SSL_CA_Path
|
|
|
|
Master_SSL_Cert
|
|
|
|
Master_SSL_Cipher
|
|
|
|
Master_SSL_Key
|
|
|
|
Seconds_Behind_Master #
|
|
|
|
Master_SSL_Verify_Server_Cert No
|
|
|
|
Last_IO_Errno #
|
|
|
|
Last_IO_Error #
|
|
|
|
Last_SQL_Errno 0
|
|
|
|
Last_SQL_Error
|
2001-09-28 07:05:54 +02:00
|
|
|
select * from t2;
|
2000-12-27 02:31:06 +01:00
|
|
|
m
|
|
|
|
34
|
2001-01-24 17:15:34 +01:00
|
|
|
65
|
2000-12-27 02:31:06 +01:00
|
|
|
67
|
|
|
|
123
|
2001-01-24 17:15:34 +01:00
|
|
|
1234
|
2002-08-24 01:08:10 +02:00
|
|
|
create temporary table temp_table (a char(80) not null);
|
|
|
|
insert into temp_table values ("testing temporary tables part 2");
|
2001-09-28 07:05:54 +02:00
|
|
|
create table t3 (n int);
|
2003-12-16 12:20:17 +01:00
|
|
|
select count(*) from t3 where n >= 4;
|
|
|
|
count(*)
|
|
|
|
100
|
2002-08-24 01:08:10 +02:00
|
|
|
create table t4 select * from temp_table;
|
2002-10-25 02:32:42 +02:00
|
|
|
show binary logs;
|
2005-05-19 12:34:15 +02:00
|
|
|
Log_name File_size
|
2007-03-30 04:44:49 +02:00
|
|
|
master-bin.000003 4193
|
|
|
|
master-bin.000004 4198
|
|
|
|
master-bin.000005 2040
|
2001-09-28 07:05:54 +02:00
|
|
|
show master status;
|
2003-11-20 20:49:05 +01:00
|
|
|
File Position Binlog_Do_DB Binlog_Ignore_DB
|
2007-03-30 04:44:49 +02:00
|
|
|
master-bin.000005 2040
|
2002-08-24 01:08:10 +02:00
|
|
|
select * from t4;
|
|
|
|
a
|
|
|
|
testing temporary tables part 2
|
2007-06-11 22:15:39 +02:00
|
|
|
SHOW SLAVE STATUS;
|
|
|
|
Slave_IO_State #
|
|
|
|
Master_Host 127.0.0.1
|
|
|
|
Master_User root
|
|
|
|
Master_Port MASTER_PORT
|
|
|
|
Connect_Retry 60
|
|
|
|
Master_Log_File master-bin.000005
|
|
|
|
Read_Master_Log_Pos 2040
|
|
|
|
Relay_Log_File #
|
|
|
|
Relay_Log_Pos #
|
|
|
|
Relay_Master_Log_File master-bin.000005
|
|
|
|
Slave_IO_Running Yes
|
|
|
|
Slave_SQL_Running Yes
|
|
|
|
Replicate_Do_DB
|
|
|
|
Replicate_Ignore_DB
|
|
|
|
Replicate_Do_Table
|
|
|
|
Replicate_Ignore_Table #
|
|
|
|
Replicate_Wild_Do_Table
|
|
|
|
Replicate_Wild_Ignore_Table
|
|
|
|
Last_Errno 0
|
|
|
|
Last_Error
|
|
|
|
Skip_Counter 0
|
|
|
|
Exec_Master_Log_Pos 2040
|
|
|
|
Relay_Log_Space #
|
|
|
|
Until_Condition None
|
|
|
|
Until_Log_File
|
|
|
|
Until_Log_Pos 0
|
|
|
|
Master_SSL_Allowed No
|
|
|
|
Master_SSL_CA_File
|
|
|
|
Master_SSL_CA_Path
|
|
|
|
Master_SSL_Cert
|
|
|
|
Master_SSL_Cipher
|
|
|
|
Master_SSL_Key
|
|
|
|
Seconds_Behind_Master #
|
|
|
|
Master_SSL_Verify_Server_Cert No
|
|
|
|
Last_IO_Errno #
|
|
|
|
Last_IO_Error #
|
|
|
|
Last_SQL_Errno 0
|
|
|
|
Last_SQL_Error
|
2001-09-28 07:05:54 +02:00
|
|
|
lock tables t3 read;
|
|
|
|
select count(*) from t3 where n >= 4;
|
2001-01-24 17:15:34 +01:00
|
|
|
count(*)
|
|
|
|
100
|
2001-09-28 07:05:54 +02:00
|
|
|
unlock tables;
|
2002-09-22 17:02:39 +02:00
|
|
|
drop table if exists t1,t2,t3,t4;
|
2007-07-07 09:04:11 +02:00
|
|
|
End of 4.1 tests
|
|
|
|
show binlog events in 'non existing_binlog_file';
|
|
|
|
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
|
|
|
purge master logs before now();
|
|
|
|
show binlog events in '';
|
|
|
|
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
|
|
|
|
purge master logs before now();
|
|
|
|
End of 5.0 tests
|