mirror of
https://github.com/MariaDB/server.git
synced 2025-08-30 11:22:14 +03:00
212 lines
12 KiB
Plaintext
212 lines
12 KiB
Plaintext
drop table if exists t1, t2, t3, t4;
|
|
drop table if exists t1, t2, t3, t4;
|
|
start slave;
|
|
Got one of the listed errors
|
|
start slave;
|
|
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
|
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
|
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
|
reset slave;
|
|
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
|
reset master;
|
|
start slave;
|
|
create temporary table temp_table (a char(80) not null);
|
|
insert into temp_table values ("testing temporary tables");
|
|
create table t1 (s text);
|
|
insert into t1 values('Could not break slave'),('Tried hard');
|
|
show slave status;
|
|
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
|
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 550 # # master-bin.000001 Yes Yes 0 0 550 # None 0 No #
|
|
select * from t1;
|
|
s
|
|
Could not break slave
|
|
Tried hard
|
|
flush logs;
|
|
create table t2(m int not null auto_increment primary key);
|
|
insert into t2 values (34),(67),(123);
|
|
flush logs;
|
|
show binary logs;
|
|
Log_name
|
|
master-bin.000001
|
|
master-bin.000002
|
|
master-bin.000003
|
|
create table t3 select * from temp_table;
|
|
select * from t3;
|
|
a
|
|
testing temporary tables
|
|
drop table temp_table, t3;
|
|
insert into t2 values(1234);
|
|
set insert_id=1234;
|
|
insert into t2 values(NULL);
|
|
set global sql_slave_skip_counter=1;
|
|
start slave;
|
|
purge master logs to 'master-bin.000002';
|
|
show master logs;
|
|
Log_name
|
|
master-bin.000002
|
|
master-bin.000003
|
|
purge binary logs to 'master-bin.000002';
|
|
show binary logs;
|
|
Log_name
|
|
master-bin.000002
|
|
master-bin.000003
|
|
purge master logs before now();
|
|
show binary logs;
|
|
Log_name
|
|
master-bin.000003
|
|
insert into t2 values (65);
|
|
show slave status;
|
|
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
|
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 498 # # master-bin.000003 Yes Yes 0 0 498 # None 0 No #
|
|
select * from t2;
|
|
m
|
|
34
|
|
65
|
|
67
|
|
123
|
|
1234
|
|
create temporary table temp_table (a char(80) not null);
|
|
insert into temp_table values ("testing temporary tables part 2");
|
|
create table t3 (n int);
|
|
select count(*) from t3 where n >= 4;
|
|
count(*)
|
|
100
|
|
create table t4 select * from temp_table;
|
|
show binary logs;
|
|
Log_name
|
|
master-bin.000003
|
|
master-bin.000004
|
|
master-bin.000005
|
|
show master status;
|
|
File Position Binlog_Do_DB Binlog_Ignore_DB
|
|
master-bin.000005 2051
|
|
select * from t4;
|
|
a
|
|
testing temporary tables part 2
|
|
show slave status;
|
|
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
|
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2051 # # master-bin.000005 Yes Yes 0 0 2051 # None 0 No #
|
|
lock tables t3 read;
|
|
select count(*) from t3 where n >= 4;
|
|
count(*)
|
|
100
|
|
unlock tables;
|
|
drop table if exists t1,t2,t3,t4;
|
|
slave stop;
|
|
reset master;
|
|
create table t1 (n int) engine=innodb;
|
|
begin;
|
|
commit;
|
|
drop table t1;
|
|
show binlog events in 'master-bin.000001';
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 4 Format_desc 1 96 Server ver: 5.0.3-alpha-debug-log, Binlog ver: 4
|
|
master-bin.000001 96 Query 1 197 use `test`; create table t1 (n int) engine=innodb
|
|
master-bin.000001 197 Query 1 266 use `test`; BEGIN
|
|
master-bin.000001 266 Query 1 94 use `test`; insert into t1 values(100 + 4)
|
|
master-bin.000001 360 Query 1 187 use `test`; insert into t1 values(99 + 4)
|
|
master-bin.000001 453 Query 1 280 use `test`; insert into t1 values(98 + 4)
|
|
master-bin.000001 546 Query 1 373 use `test`; insert into t1 values(97 + 4)
|
|
master-bin.000001 639 Query 1 466 use `test`; insert into t1 values(96 + 4)
|
|
master-bin.000001 732 Query 1 559 use `test`; insert into t1 values(95 + 4)
|
|
master-bin.000001 825 Query 1 652 use `test`; insert into t1 values(94 + 4)
|
|
master-bin.000001 918 Query 1 745 use `test`; insert into t1 values(93 + 4)
|
|
master-bin.000001 1011 Query 1 838 use `test`; insert into t1 values(92 + 4)
|
|
master-bin.000001 1104 Query 1 931 use `test`; insert into t1 values(91 + 4)
|
|
master-bin.000001 1197 Query 1 1024 use `test`; insert into t1 values(90 + 4)
|
|
master-bin.000001 1290 Query 1 1117 use `test`; insert into t1 values(89 + 4)
|
|
master-bin.000001 1383 Query 1 1210 use `test`; insert into t1 values(88 + 4)
|
|
master-bin.000001 1476 Query 1 1303 use `test`; insert into t1 values(87 + 4)
|
|
master-bin.000001 1569 Query 1 1396 use `test`; insert into t1 values(86 + 4)
|
|
master-bin.000001 1662 Query 1 1489 use `test`; insert into t1 values(85 + 4)
|
|
master-bin.000001 1755 Query 1 1582 use `test`; insert into t1 values(84 + 4)
|
|
master-bin.000001 1848 Query 1 1675 use `test`; insert into t1 values(83 + 4)
|
|
master-bin.000001 1941 Query 1 1768 use `test`; insert into t1 values(82 + 4)
|
|
master-bin.000001 2034 Query 1 1861 use `test`; insert into t1 values(81 + 4)
|
|
master-bin.000001 2127 Query 1 1954 use `test`; insert into t1 values(80 + 4)
|
|
master-bin.000001 2220 Query 1 2047 use `test`; insert into t1 values(79 + 4)
|
|
master-bin.000001 2313 Query 1 2140 use `test`; insert into t1 values(78 + 4)
|
|
master-bin.000001 2406 Query 1 2233 use `test`; insert into t1 values(77 + 4)
|
|
master-bin.000001 2499 Query 1 2326 use `test`; insert into t1 values(76 + 4)
|
|
master-bin.000001 2592 Query 1 2419 use `test`; insert into t1 values(75 + 4)
|
|
master-bin.000001 2685 Query 1 2512 use `test`; insert into t1 values(74 + 4)
|
|
master-bin.000001 2778 Query 1 2605 use `test`; insert into t1 values(73 + 4)
|
|
master-bin.000001 2871 Query 1 2698 use `test`; insert into t1 values(72 + 4)
|
|
master-bin.000001 2964 Query 1 2791 use `test`; insert into t1 values(71 + 4)
|
|
master-bin.000001 3057 Query 1 2884 use `test`; insert into t1 values(70 + 4)
|
|
master-bin.000001 3150 Query 1 2977 use `test`; insert into t1 values(69 + 4)
|
|
master-bin.000001 3243 Query 1 3070 use `test`; insert into t1 values(68 + 4)
|
|
master-bin.000001 3336 Query 1 3163 use `test`; insert into t1 values(67 + 4)
|
|
master-bin.000001 3429 Query 1 3256 use `test`; insert into t1 values(66 + 4)
|
|
master-bin.000001 3522 Query 1 3349 use `test`; insert into t1 values(65 + 4)
|
|
master-bin.000001 3615 Query 1 3442 use `test`; insert into t1 values(64 + 4)
|
|
master-bin.000001 3708 Query 1 3535 use `test`; insert into t1 values(63 + 4)
|
|
master-bin.000001 3801 Query 1 3628 use `test`; insert into t1 values(62 + 4)
|
|
master-bin.000001 3894 Query 1 3721 use `test`; insert into t1 values(61 + 4)
|
|
master-bin.000001 3987 Query 1 3814 use `test`; insert into t1 values(60 + 4)
|
|
master-bin.000001 4080 Query 1 3907 use `test`; insert into t1 values(59 + 4)
|
|
master-bin.000001 4173 Query 1 4000 use `test`; insert into t1 values(58 + 4)
|
|
master-bin.000001 4266 Query 1 4093 use `test`; insert into t1 values(57 + 4)
|
|
master-bin.000001 4359 Query 1 4186 use `test`; insert into t1 values(56 + 4)
|
|
master-bin.000001 4452 Query 1 4279 use `test`; insert into t1 values(55 + 4)
|
|
master-bin.000001 4545 Query 1 4372 use `test`; insert into t1 values(54 + 4)
|
|
master-bin.000001 4638 Query 1 4465 use `test`; insert into t1 values(53 + 4)
|
|
master-bin.000001 4731 Query 1 4558 use `test`; insert into t1 values(52 + 4)
|
|
master-bin.000001 4824 Query 1 4651 use `test`; insert into t1 values(51 + 4)
|
|
master-bin.000001 4917 Query 1 4744 use `test`; insert into t1 values(50 + 4)
|
|
master-bin.000001 5010 Query 1 4837 use `test`; insert into t1 values(49 + 4)
|
|
master-bin.000001 5103 Query 1 4930 use `test`; insert into t1 values(48 + 4)
|
|
master-bin.000001 5196 Query 1 5023 use `test`; insert into t1 values(47 + 4)
|
|
master-bin.000001 5289 Query 1 5116 use `test`; insert into t1 values(46 + 4)
|
|
master-bin.000001 5382 Query 1 5209 use `test`; insert into t1 values(45 + 4)
|
|
master-bin.000001 5475 Query 1 5302 use `test`; insert into t1 values(44 + 4)
|
|
master-bin.000001 5568 Query 1 5395 use `test`; insert into t1 values(43 + 4)
|
|
master-bin.000001 5661 Query 1 5488 use `test`; insert into t1 values(42 + 4)
|
|
master-bin.000001 5754 Query 1 5581 use `test`; insert into t1 values(41 + 4)
|
|
master-bin.000001 5847 Query 1 5674 use `test`; insert into t1 values(40 + 4)
|
|
master-bin.000001 5940 Query 1 5767 use `test`; insert into t1 values(39 + 4)
|
|
master-bin.000001 6033 Query 1 5860 use `test`; insert into t1 values(38 + 4)
|
|
master-bin.000001 6126 Query 1 5953 use `test`; insert into t1 values(37 + 4)
|
|
master-bin.000001 6219 Query 1 6046 use `test`; insert into t1 values(36 + 4)
|
|
master-bin.000001 6312 Query 1 6139 use `test`; insert into t1 values(35 + 4)
|
|
master-bin.000001 6405 Query 1 6232 use `test`; insert into t1 values(34 + 4)
|
|
master-bin.000001 6498 Query 1 6325 use `test`; insert into t1 values(33 + 4)
|
|
master-bin.000001 6591 Query 1 6418 use `test`; insert into t1 values(32 + 4)
|
|
master-bin.000001 6684 Query 1 6511 use `test`; insert into t1 values(31 + 4)
|
|
master-bin.000001 6777 Query 1 6604 use `test`; insert into t1 values(30 + 4)
|
|
master-bin.000001 6870 Query 1 6697 use `test`; insert into t1 values(29 + 4)
|
|
master-bin.000001 6963 Query 1 6790 use `test`; insert into t1 values(28 + 4)
|
|
master-bin.000001 7056 Query 1 6883 use `test`; insert into t1 values(27 + 4)
|
|
master-bin.000001 7149 Query 1 6976 use `test`; insert into t1 values(26 + 4)
|
|
master-bin.000001 7242 Query 1 7069 use `test`; insert into t1 values(25 + 4)
|
|
master-bin.000001 7335 Query 1 7162 use `test`; insert into t1 values(24 + 4)
|
|
master-bin.000001 7428 Query 1 7255 use `test`; insert into t1 values(23 + 4)
|
|
master-bin.000001 7521 Query 1 7348 use `test`; insert into t1 values(22 + 4)
|
|
master-bin.000001 7614 Query 1 7441 use `test`; insert into t1 values(21 + 4)
|
|
master-bin.000001 7707 Query 1 7534 use `test`; insert into t1 values(20 + 4)
|
|
master-bin.000001 7800 Query 1 7627 use `test`; insert into t1 values(19 + 4)
|
|
master-bin.000001 7893 Query 1 7720 use `test`; insert into t1 values(18 + 4)
|
|
master-bin.000001 7986 Query 1 7813 use `test`; insert into t1 values(17 + 4)
|
|
master-bin.000001 8079 Query 1 7906 use `test`; insert into t1 values(16 + 4)
|
|
master-bin.000001 8172 Query 1 7999 use `test`; insert into t1 values(15 + 4)
|
|
master-bin.000001 8265 Query 1 8092 use `test`; insert into t1 values(14 + 4)
|
|
master-bin.000001 8358 Query 1 8185 use `test`; insert into t1 values(13 + 4)
|
|
master-bin.000001 8451 Query 1 8278 use `test`; insert into t1 values(12 + 4)
|
|
master-bin.000001 8544 Query 1 8371 use `test`; insert into t1 values(11 + 4)
|
|
master-bin.000001 8637 Query 1 8464 use `test`; insert into t1 values(10 + 4)
|
|
master-bin.000001 8730 Query 1 8556 use `test`; insert into t1 values(9 + 4)
|
|
master-bin.000001 8822 Query 1 8648 use `test`; insert into t1 values(8 + 4)
|
|
master-bin.000001 8914 Query 1 8740 use `test`; insert into t1 values(7 + 4)
|
|
master-bin.000001 9006 Query 1 8832 use `test`; insert into t1 values(6 + 4)
|
|
master-bin.000001 9098 Query 1 8924 use `test`; insert into t1 values(5 + 4)
|
|
master-bin.000001 9190 Query 1 9016 use `test`; insert into t1 values(4 + 4)
|
|
master-bin.000001 9282 Query 1 9108 use `test`; insert into t1 values(3 + 4)
|
|
master-bin.000001 9374 Query 1 9200 use `test`; insert into t1 values(2 + 4)
|
|
master-bin.000001 9466 Query 1 9292 use `test`; insert into t1 values(1 + 4)
|
|
master-bin.000001 9558 Xid 1 9319 COMMIT /* xid=146 */
|
|
master-bin.000001 9585 Rotate 1 9629 master-bin.000002;pos=4
|
|
show binlog events in 'master-bin.000002';
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000002 4 Format_desc 1 96 Server ver: 5.0.3-alpha-debug-log, Binlog ver: 4
|
|
master-bin.000002 96 Query 1 173 use `test`; drop table t1
|