Commit a0e0166b authored by unknown's avatar unknown

BUG#22583: RBR between MyISAM and non-MyISAM tables containing a BIT

           field does not work

Fix to prevent MyISAM from reading data from NULL BLOB.
Fix to make record comparison independent of values of unused bits in
record.
Updating binlog positions in tests.


mysql-test/extra/rpl_tests/rpl_multi_query.test:
  Binlog position change
mysql-test/extra/rpl_tests/rpl_stm_charset.test:
  Binlog position change
mysql-test/include/show_binlog_events.inc:
  Binlog position change
mysql-test/r/binlog_stm_binlog.result:
  Result change
mysql-test/r/binlog_stm_ctype_ucs.result:
  Result change
mysql-test/r/binlog_stm_insert_select.result:
  Result change
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
  Result change
mysql-test/r/ctype_cp932_binlog_stm.result:
  Result change
mysql-test/r/ndb_binlog_multi.result:
  Result change
mysql-test/r/rpl_known_bugs_detection.result:
  Result change
mysql-test/r/rpl_loaddata.result:
  Result change
mysql-test/r/rpl_loaddata_s.result:
  Result change
mysql-test/r/rpl_ndb_charset.result:
  Result change
mysql-test/r/rpl_ndb_extraCol.result:
  Result change
mysql-test/r/rpl_ndb_log.result:
  Result change
mysql-test/r/rpl_ndb_multi.result:
  Result change
mysql-test/r/rpl_rbr_to_sbr.result:
  Result change
mysql-test/r/rpl_rotate_logs.result:
  Result change
mysql-test/r/rpl_sp.result:
  Result change
mysql-test/r/rpl_stm_charset.result:
  Result change
mysql-test/r/rpl_stm_flsh_tbls.result:
  Result change
mysql-test/r/rpl_stm_log.result:
  Result change
mysql-test/r/rpl_stm_max_relay_size.result:
  Result change
mysql-test/r/rpl_stm_multi_query.result:
  Result change
mysql-test/r/rpl_stm_reset_slave.result:
  Result change
mysql-test/r/rpl_stm_until.result:
  Result change
mysql-test/r/rpl_truncate_7ndb.result:
  Result change
mysql-test/r/user_var-binlog.result:
  Result change
mysql-test/t/binlog_stm_mix_innodb_myisam.test:
  Binlog position change
mysql-test/t/ctype_cp932_binlog_stm.test:
  Binlog position change
mysql-test/t/mysqlbinlog.test:
  Binlog position change
mysql-test/t/mysqlbinlog2.test:
  Binlog position change
mysql-test/t/rpl_sp.test:
  Binlog position change
mysql-test/t/rpl_stm_flsh_tbls.test:
  Binlog position change
sql/log_event.cc:
  Emptying the record entirely since it appears MyISAM reads blob column
  data even when they are NULL.
  
  Adding code to set unused bits of the records before doing a comparison,
  and restoring the original values after. Setting the unused bits is necessary
  since NDB does not set them correctly, and resetting them afterwards is needed
  because MyISAM compares the record with the one located when updating
  or deleting it.
mysql-test/r/rpl_row_basic_11bugs-master.opt:
  New BitKeeper file ``mysql-test/r/rpl_row_basic_11bugs-master.opt''
mysql-test/r/rpl_row_basic_11bugs-slave.opt:
  New BitKeeper file ``mysql-test/r/rpl_row_basic_11bugs-slave.opt''
parent c75e3d7e
......@@ -25,6 +25,6 @@ select * from mysqltest.t1;
connection master;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events from 102;
show binlog events from 105;
drop database mysqltest;
sync_slave_with_master;
......@@ -111,7 +111,7 @@ drop database mysqltest2;
drop database mysqltest3;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events from 102;
show binlog events from 105;
sync_slave_with_master;
# Check that we can change global.collation_server (since 5.0.3)
......
--let $binlog_start=102
--let $binlog_start=105
--replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
......
......@@ -4,11 +4,11 @@ insert into t1 values (1,2);
commit;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: #, Binlog ver: #
master-bin.000001 102 Query 1 209 use `test`; create table t1 (a int, b int) engine=innodb
master-bin.000001 209 Query 1 277 use `test`; BEGIN
master-bin.000001 277 Query 1 90 use `test`; insert into t1 values (1,2)
master-bin.000001 367 Xid 1 394 COMMIT /* XID */
master-bin.000001 4 Format_desc 1 105 Server ver: #, Binlog ver: #
master-bin.000001 105 Query 1 212 use `test`; create table t1 (a int, b int) engine=innodb
master-bin.000001 212 Query 1 280 use `test`; BEGIN
master-bin.000001 280 Query 1 90 use `test`; insert into t1 values (1,2)
master-bin.000001 370 Xid 1 397 COMMIT /* XID */
drop table t1;
drop table if exists t1, t2;
reset master;
......@@ -20,7 +20,7 @@ commit;
begin;
insert t2 values (5);
commit;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb
master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb
......@@ -36,7 +36,7 @@ create table t1 (n int) engine=innodb;
begin;
commit;
drop table t1;
show binlog events in 'master-bin.000001' from 102;
show binlog events in 'master-bin.000001' from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
master-bin.000001 # Query 1 # use `test`; BEGIN
......@@ -142,7 +142,7 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4)
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4)
master-bin.000001 # Xid 1 # COMMIT /* xid= */
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
show binlog events in 'master-bin.000002' from 102;
show binlog events in 'master-bin.000002' from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query 1 # use `test`; drop table t1
reset master;
......@@ -164,7 +164,7 @@ INSERT INTO user SET host='localhost', user='@#@', password=password('Just a tes
UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
DELETE FROM user WHERE host='localhost' AND user='@#@';
use test;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
master-bin.000001 # Intvar 1 # INSERT_ID=127
......@@ -183,7 +183,7 @@ set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
insert delayed into t1 values (null);
insert delayed into t1 values (300);
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
master-bin.000001 # Intvar 1 # INSERT_ID=127
......
......@@ -3,10 +3,10 @@ create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2);
reset master;
insert into t2 values (@v);
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 User var 1 142 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 142 Query 1 231 use `test`; insert into t2 values (@v)
master-bin.000001 105 User var 1 145 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 145 Query 1 234 use `test`; insert into t2 values (@v)
flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
......
......@@ -8,8 +8,8 @@ insert into t1 select * from t2;
ERROR 23000: Duplicate entry '2' for key 'a'
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 196 use `test`; insert into t1 select * from t2
master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4
master-bin.000001 105 Query 1 199 use `test`; insert into t1 select * from t2
select * from t1;
a
1
......@@ -22,5 +22,5 @@ create table t2(unique(a)) select a from t1;
ERROR 23000: Duplicate entry '1' for key 'a'
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
master-bin.000001 4 Format_desc 1 105 Server ver: VERSION, Binlog ver: 4
drop table t1;
......@@ -6,7 +6,7 @@ begin;
insert into t1 values(1);
insert into t2 select * from t1;
commit;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(1)
......@@ -21,7 +21,7 @@ insert into t2 select * from t1;
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(2)
......@@ -39,7 +39,7 @@ rollback to savepoint my_savepoint;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
commit;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(3)
......@@ -65,7 +65,7 @@ select a from t1 order by a;
a
5
7
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(5)
......@@ -87,7 +87,7 @@ insert into t2 select * from t1;
select get_lock("a",10);
get_lock("a",10)
1
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(8)
......@@ -98,7 +98,7 @@ delete from t2;
reset master;
insert into t1 values(9);
insert into t2 select * from t1;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; insert into t1 values(9)
master-bin.000001 # Xid 1 # COMMIT /* xid= */
......@@ -109,14 +109,14 @@ reset master;
insert into t1 values(10);
begin;
insert into t2 select * from t1;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 # Xid 1 # COMMIT /* xid= */
master-bin.000001 # Query 1 # use `test`; insert into t2 select * from t1
insert into t1 values(11);
commit;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; insert into t1 values(10)
master-bin.000001 # Xid 1 # COMMIT /* xid= */
......@@ -132,7 +132,7 @@ begin;
insert into t1 values(12);
insert into t2 select * from t1;
commit;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(12)
......@@ -145,7 +145,7 @@ begin;
insert into t1 values(13);
insert into t2 select * from t1;
rollback;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
delete from t1;
delete from t2;
......@@ -157,7 +157,7 @@ insert into t1 values(15);
insert into t2 select * from t1;
rollback to savepoint my_savepoint;
commit;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(14)
......@@ -177,7 +177,7 @@ select a from t1 order by a;
a
16
18
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(16)
......@@ -227,7 +227,7 @@ insert into t2 values (3);
select get_lock("lock1",60);
get_lock("lock1",60)
1
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert into t1 values(16)
......@@ -331,7 +331,7 @@ SELECT * from t2;
a b
100 100
DROP TABLE t1,t2;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 values (1,1),(1,2)
master-bin.000001 # Query 1 # use `test`; DROP TABLE if exists t2
......
......@@ -6,7 +6,7 @@ CREATE TABLE t1(f1 blob);
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
SET @var1= x'8300';
EXECUTE stmt1 USING @var1;
SHOW BINLOG EVENTS FROM 102;
SHOW BINLOG EVENTS FROM 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob)
master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary
......@@ -30,17 +30,17 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
SHOW BINLOG EVENTS FROM 406|
SHOW BINLOG EVENTS FROM 409|
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 406 Query 1 572 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
master-bin.000001 409 Query 1 575 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
master-bin.000001 572 Query 1 820 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
master-bin.000001 575 Query 1 823 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE bug18293 (IN ins1 CHAR(50),
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
master-bin.000001 820 Query 1 1039 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001 1039 Query 1 1128 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1128 Query 1 1207 use `test`; DROP TABLE t4
master-bin.000001 823 Query 1 1042 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001 1042 Query 1 1131 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1131 Query 1 1210 use `test`; DROP TABLE t4
......@@ -13,6 +13,7 @@ master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t2)
master-bin1.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT
select * from t2 order by a;
......@@ -35,6 +36,7 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE t2
......@@ -53,6 +55,7 @@ master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t1)
master-bin1.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT
SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
......@@ -71,6 +74,7 @@ master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # table_id: # (test.t1)
master-bin1.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: #
master-bin1.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; drop table t1
......
......@@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 1105
Last_Error Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'
Skip_Counter 0
Exec_Master_Log_Pos 242
Exec_Master_Log_Pos 245
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -115,7 +115,7 @@ FROM t2
ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c'
Skip_Counter 0
Exec_Master_Log_Pos 1274
Exec_Master_Log_Pos 1277
Relay_Log_Space #
Until_Condition None
Until_Log_File
......
......@@ -28,7 +28,7 @@ day id category name
2003-03-22 2416 a bbbbb
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
slave-bin.000001 1276
slave-bin.000001 1279
drop table t1;
drop table t2;
drop table t3;
......@@ -39,7 +39,7 @@ set global sql_slave_skip_counter=1;
start slave;
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 1 master-bin.000001 1793 # # master-bin.000001 Yes Yes # 0 0 1793 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1796 # # master-bin.000001 Yes Yes # 0 0 1796 # None 0 No #
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
......@@ -49,7 +49,7 @@ change master to master_user='test';
change master to master_user='root';
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 1 master-bin.000001 1828 # # master-bin.000001 No No # 0 0 1828 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1831 # # master-bin.000001 No No # 0 0 1831 # None 0 No #
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
......
......@@ -10,6 +10,6 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table test.t1;
select count(*) from test.t1;
count(*)
2
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
drop table test.t1;
......@@ -109,7 +109,7 @@ a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3
......
......@@ -28,9 +28,9 @@ a b c
*** Select from slave ***
SELECT * FROM t1 ORDER BY a;
a b c d e
1 2 TEXAS 2 TEST
2 1 AUSTIN 2 TEST
3 4 QA 2 TEST
1 2 TEXAS NULL NULL
2 1 AUSTIN NULL NULL
3 4 QA NULL NULL
*** Drop t1 ***
DROP TABLE t1;
*** Create t3 on slave ***
......@@ -289,9 +289,9 @@ a b c
*** Select from slave ***
SELECT * FROM t7 ORDER BY a;
a b c d e
1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
1 b1b1 Kyle NULL NULL
2 b1b1 JOE NULL NULL
3 b1b1 QA NULL NULL
*** Drop t7 ***
DROP TABLE t7;
*** Create t8 on slave ***
......@@ -447,9 +447,9 @@ a b c
*** Select on Slave ***
SELECT * FROM t12 ORDER BY a;
a b f c e
1 b1b1b1b1b1b1b1b1 Kyle test 1
2 b1b1b1b1b1b1b1b1 JOE test 1
3 b1b1b1b1b1b1b1b1 QA test 1
1 b1b1b1b1b1b1b1b1 Kyle NULL NULL
2 b1b1b1b1b1b1b1b1 JOE NULL NULL
3 b1b1b1b1b1b1b1b1 QA NULL NULL
*** Drop t12 ***
DROP TABLE t12;
**** Extra Colums End ****
......@@ -479,9 +479,9 @@ a b c
*** Select on Slave ****
SELECT * FROM t13 ORDER BY a;
a b c d e
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
*** Drop t13 ***
DROP TABLE t13;
*** 22117 END ***
......@@ -515,9 +515,9 @@ c1 c2 c3 c4 c5
*** Select on Slave ****
SELECT * FROM t14 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
*** connect to master and drop columns ***
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c4;
......@@ -530,9 +530,9 @@ c1 c3 c5
*** Select from Slave ***
SELECT * FROM t14 ORDER BY c1;
c1 c3 c5 c6 c7
1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
2 This Test Should work JOE 1 CURRENT_TIMESTAMP
3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
1 Replication Testing Extra Col Kyle NULL CURRENT_TIMESTAMP
2 This Test Should work JOE NULL CURRENT_TIMESTAMP
3 If is does not, I will open a bug QA NULL CURRENT_TIMESTAMP
*** Drop t14 ***
DROP TABLE t14;
*** Create t15 on slave ***
......@@ -563,9 +563,9 @@ c1 c2 c3 c4 c5
*** Select on Slave ****
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
*** Add column on master that is a Extra on Slave ***
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
********************************************
......@@ -618,9 +618,9 @@ c1 c2 c3 c4 c5 c6
*** Try to select from slave ****
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
*** DROP TABLE t15 ***
DROP TABLE t15;
......@@ -652,9 +652,9 @@ c1 c2 c3 c4 c5
*** Select on Slave ****
SELECT * FROM t16 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
*** Add Partition on master ***
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
......
......@@ -32,16 +32,17 @@ master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT
show binlog events from 102 limit 1;
show binlog events from 105 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
show binlog events from 102 limit 2;
show binlog events from 105 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN
show binlog events from 102 limit 2,1;
show binlog events from 105 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
flush logs;
......@@ -71,6 +72,7 @@ master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
......@@ -87,13 +89,13 @@ master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Query 1 # COMMIT
show binary logs;
Log_name File_size
master-bin.000001 1702
master-bin.000002 593
master-bin.000001 1734
master-bin.000002 596
start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1797
slave-bin.000002 198
slave-bin.000001 1829
slave-bin.000002 201
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
......@@ -110,6 +112,7 @@ slave-bin.000001 # Query 2 # BEGIN
slave-bin.000001 # Table_map 2 # table_id: # (test.t1)
slave-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
slave-bin.000001 # Write_rows 2 # table_id: #
slave-bin.000001 # Write_rows 2 # table_id: #
slave-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 2 # COMMIT
slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
......@@ -126,7 +129,7 @@ slave-bin.000002 # Write_rows 2 # table_id: # flags: STMT_END_F
slave-bin.000002 # Query 2 # COMMIT
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 1 master-bin.000002 593 # # master-bin.000002 Yes Yes # 0 0 593 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 596 # # master-bin.000002 Yes Yes # 0 0 596 # None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
......
......@@ -26,11 +26,11 @@ stop slave;
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
102 master-bin1.000001
105 master-bin1.000001
CHANGE MASTER TO
master_port=<MASTER_PORT1>,
master_log_file = 'master-bin1.000001',
master_log_pos = 102 ;
master_log_pos = 105 ;
start slave;
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
DELETE FROM t1 WHERE c3 = 1;
......
......@@ -28,7 +28,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 450
Read_Master_Log_Pos 453
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 450
Exec_Master_Log_Pos 453
Relay_Log_Space #
Until_Condition None
Until_Log_File
......
......@@ -16,7 +16,7 @@ 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 552 # # master-bin.000001 Yes Yes # 0 0 552 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000001 555 # # master-bin.000001 Yes Yes # 0 0 555 # None 0 No #
select * from t1;
s
Could not break slave
......@@ -27,9 +27,9 @@ insert into t2 values (34),(67),(123);
flush logs;
show binary logs;
Log_name File_size
master-bin.000001 596
master-bin.000002 367
master-bin.000003 102
master-bin.000001 599
master-bin.000002 370
master-bin.000003 105
create table t3 select * from temp_table;
select * from t3;
a
......@@ -43,21 +43,21 @@ start slave;
purge master logs to 'master-bin.000002';
show master logs;
Log_name File_size
master-bin.000002 367
master-bin.000003 411
master-bin.000002 370
master-bin.000003 414
purge binary logs to 'master-bin.000002';
show binary logs;
Log_name File_size
master-bin.000002 367
master-bin.000003 411
master-bin.000002 370
master-bin.000003 414
purge master logs before now();
show binary logs;
Log_name File_size
master-bin.000003 411
master-bin.000003 414
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 500 # # master-bin.000003 Yes Yes # 0 0 500 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000003 503 # # master-bin.000003 Yes Yes # 0 0 503 # None 0 No #
select * from t2;
m
34
......@@ -74,18 +74,18 @@ count(*)
create table t4 select * from temp_table;
show binary logs;
Log_name File_size
master-bin.000003 4189
master-bin.000004 4194
master-bin.000005 2036
master-bin.000003 4192
master-bin.000004 4197
master-bin.000005 2039
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000005 2036
master-bin.000005 2039
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 2036 # # master-bin.000005 Yes Yes # 0 0 2036 # None 0 No #
# 127.0.0.1 root MASTER_PORT 60 master-bin.000005 2039 # # master-bin.000005 Yes Yes # 0 0 2039 # None 0 No #
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
......
......@@ -381,7 +381,7 @@ return 0;
end|
use mysqltest;
set @a:= mysqltest2.f1();
show binlog events in 'master-bin.000001' from 102;
show binlog events in 'master-bin.000001' from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest1
master-bin.000001 # Query 1 # create database mysqltest1
......
......@@ -103,7 +103,7 @@ a b
1 cp850_general_ci
drop database mysqltest2;
drop database mysqltest3;
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest2
master-bin.000001 # Query 1 # drop database if exists mysqltest3
......
......@@ -12,13 +12,13 @@ create table t4 (a int);
insert into t4 select * from t3;
rename table t1 to t5, t2 to t1;
flush no_write_to_binlog tables;
SHOW BINLOG EVENTS FROM 652 ;
SHOW BINLOG EVENTS FROM 655 ;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
SHOW BINLOG EVENTS FROM 652 ;
SHOW BINLOG EVENTS FROM 655 ;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1
master-bin.000001 # Query 1 # use `test`; flush tables
......
......@@ -26,14 +26,14 @@ master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
show binlog events from 102 limit 1;
show binlog events from 105 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
show binlog events from 102 limit 2;
show binlog events from 105 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
master-bin.000001 # Intvar 1 # INSERT_ID=1
show binlog events from 102 limit 2,1;
show binlog events from 105 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
flush logs;
......@@ -66,13 +66,13 @@ master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
master-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
show binary logs;
Log_name File_size
master-bin.000001 1343
master-bin.000002 388
master-bin.000001 1346
master-bin.000002 391
start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1443
slave-bin.000002 289
slave-bin.000001 1446
slave-bin.000002 292
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
......@@ -92,7 +92,7 @@ slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
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 1 master-bin.000002 388 # # master-bin.000002 Yes Yes # 0 0 388 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 391 # # master-bin.000002 Yes Yes # 0 0 391 # None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
......
......@@ -28,7 +28,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72956
Read_Master_Log_Pos 72959
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -43,7 +43,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72956
Exec_Master_Log_Pos 72959
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -71,7 +71,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72956
Read_Master_Log_Pos 72959
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -86,7 +86,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72956
Exec_Master_Log_Pos 72959
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -114,7 +114,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 72956
Read_Master_Log_Pos 72959
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -129,7 +129,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 72956
Exec_Master_Log_Pos 72959
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -195,7 +195,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 73042
Read_Master_Log_Pos 73045
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -210,7 +210,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 73042
Exec_Master_Log_Pos 73045
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -234,7 +234,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 73118
Read_Master_Log_Pos 73121
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -249,7 +249,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 73118
Exec_Master_Log_Pos 73121
Relay_Log_Space #
Until_Condition None
Until_Log_File
......@@ -264,7 +264,7 @@ Seconds_Behind_Master #
flush logs;
show master status;
File master-bin.000002
Position 102
Position 105
Binlog_Do_DB <Binlog_Ignore_DB>
Binlog_Ignore_DB
set global max_binlog_size= @my_max_binlog_size;
......
......@@ -19,7 +19,7 @@ n
3
4
5
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # drop database if exists mysqltest
master-bin.000001 # Query 1 # create database mysqltest
......
......@@ -6,12 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
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 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No #
stop slave;
change master to master_user='test';
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 test MASTER_PORT 1 master-bin.000001 102 # # master-bin.000001 No No # 0 0 102 # None 0 No #
# 127.0.0.1 test MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 No No # 0 0 105 # None 0 No #
reset slave;
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
......@@ -19,7 +19,7 @@ Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File
start slave;
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 1 master-bin.000001 102 # # master-bin.000001 Yes Yes # 0 0 102 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 105 # # master-bin.000001 Yes Yes # 0 0 105 # None 0 No #
stop slave;
reset slave;
start slave;
......
......@@ -26,7 +26,7 @@ Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Read_Master_Log_Pos 783
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -41,7 +41,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 323
Exec_Master_Log_Pos 326
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
......@@ -67,7 +67,7 @@ Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Read_Master_Log_Pos 783
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -82,7 +82,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 323
Exec_Master_Log_Pos 326
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-no-such-bin.000001
......@@ -106,7 +106,7 @@ Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Read_Master_Log_Pos 783
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -121,7 +121,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 612
Exec_Master_Log_Pos 615
Relay_Log_Space #
Until_Condition Relay
Until_Log_File slave-relay-bin.000004
......@@ -143,7 +143,7 @@ Master_User root
Master_Port MASTER_MYPORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos 780
Read_Master_Log_Pos 783
Relay_Log_File slave-relay-bin.000004
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
......@@ -158,7 +158,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 780
Exec_Master_Log_Pos 783
Relay_Log_Space #
Until_Condition Master
Until_Log_File master-bin.000001
......
......@@ -29,16 +29,17 @@ a b
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 378 Write_rows 1 137 table_id: #
master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F
master-bin.000001 467 Query 1 532 COMMIT
master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1
master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1
master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 222 Query 1 286 BEGIN
master-bin.000001 286 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 326 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 381 Write_rows 1 137 table_id: #
master-bin.000001 423 Write_rows 1 175 table_id: #
master-bin.000001 461 Write_rows 1 213 table_id: # flags: STMT_END_F
master-bin.000001 499 Query 1 564 COMMIT
master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1
master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
......@@ -65,27 +66,30 @@ a b
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 378 Write_rows 1 137 table_id: #
master-bin.000001 420 Write_rows 1 184 table_id: # flags: STMT_END_F
master-bin.000001 467 Query 1 532 COMMIT
master-bin.000001 532 Query 1 612 use `test`; TRUNCATE TABLE t1
master-bin.000001 612 Query 1 688 use `test`; DROP TABLE t1
master-bin.000001 688 Query 1 805 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 805 Query 1 869 BEGIN
master-bin.000001 869 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 909 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 964 Write_rows 1 137 table_id: #
master-bin.000001 1006 Write_rows 1 184 table_id: # flags: STMT_END_F
master-bin.000001 1053 Query 1 1118 COMMIT
master-bin.000001 1118 Query 1 1182 BEGIN
master-bin.000001 1182 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 1222 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 1277 Write_rows 1 137 table_id: #
master-bin.000001 1319 Delete_rows 1 176 table_id: # flags: STMT_END_F
master-bin.000001 1358 Query 1 1423 COMMIT
master-bin.000001 1423 Query 1 1499 use `test`; DROP TABLE t1
master-bin.000001 4 Format_desc 1 105 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 105 Query 1 222 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 222 Query 1 286 BEGIN
master-bin.000001 286 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 326 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 381 Write_rows 1 137 table_id: #
master-bin.000001 423 Write_rows 1 175 table_id: #
master-bin.000001 461 Write_rows 1 213 table_id: # flags: STMT_END_F
master-bin.000001 499 Query 1 564 COMMIT
master-bin.000001 564 Query 1 644 use `test`; TRUNCATE TABLE t1
master-bin.000001 644 Query 1 720 use `test`; DROP TABLE t1
master-bin.000001 720 Query 1 837 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 837 Query 1 901 BEGIN
master-bin.000001 901 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 941 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 996 Write_rows 1 137 table_id: #
master-bin.000001 1038 Write_rows 1 175 table_id: #
master-bin.000001 1076 Write_rows 1 213 table_id: # flags: STMT_END_F
master-bin.000001 1114 Query 1 1179 COMMIT
master-bin.000001 1179 Query 1 1243 BEGIN
master-bin.000001 1243 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 1283 Table_map 1 95 table_id: # (mysql.ndb_apply_status)
master-bin.000001 1338 Write_rows 1 137 table_id: #
master-bin.000001 1380 Delete_rows 1 171 table_id: #
master-bin.000001 1414 Delete_rows 1 205 table_id: # flags: STMT_END_F
master-bin.000001 1448 Query 1 1513 COMMIT
master-bin.000001 1513 Query 1 1589 use `test`; DROP TABLE t1
......@@ -6,7 +6,7 @@ INSERT INTO t1 VALUES(@`a b`);
set @var1= "';aaa";
SET @var2=char(ascii('a'));
insert into t1 values (@var1),(@var2);
show binlog events from 102;
show binlog events from 105;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # User var 1 # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@`a b`)
......
......@@ -12,7 +12,7 @@
# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
# and does not make slave to stop)
flush logs;
--exec $MYSQL_BINLOG --start-position=551 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
--exec $MYSQL_BINLOG --start-position=554 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
......
......@@ -22,7 +22,7 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)|
SELECT HEX(s1),HEX(s2),d FROM t4|
DROP PROCEDURE bug18293|
DROP TABLE t4|
SHOW BINLOG EVENTS FROM 406|
SHOW BINLOG EVENTS FROM 409|
delimiter ;|
# End of 5.0 tests
......
......@@ -65,7 +65,7 @@ select "--- --database --" as "";
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=235 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=238 $MYSQLTEST_VARDIR/log/master-bin.000002
# These are tests for remote binlog.
# They should return the same as previous test.
......@@ -97,7 +97,7 @@ select "--- --database --" as "";
select "--- --position --" as "";
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=235 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=238 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 (mysqlbinlog does not accept input from stdin)
--disable_query_log
......
......@@ -52,11 +52,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --start-position=607 $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001
--exec $MYSQL_BINLOG --short-form --stop-position=607 $MYSQLTEST_VARDIR/log/master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......@@ -82,11 +82,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=604 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --start-position=607 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=130 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--exec $MYSQL_BINLOG --short-form --stop-position=133 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......@@ -109,11 +109,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--exec $MYSQL_BINLOG --short-form --start-position=607 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--exec $MYSQL_BINLOG --short-form --stop-position=607 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......@@ -136,11 +136,11 @@ select "--- offset --" as "";
--disable_query_log
select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=604 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--exec $MYSQL_BINLOG --short-form --start-position=607 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=130 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--exec $MYSQL_BINLOG --short-form --stop-position=133 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
......
......@@ -566,7 +566,7 @@ connection master;
# were written to the binary log.
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000001' from 102;
show binlog events in 'master-bin.000001' from 105;
# Restore log_bin_trust_function_creators to its original value.
......
# depends on the binlog output
--source include/have_binlog_format_mixed_or_statement.inc
let $rename_event_pos= 652;
let $rename_event_pos= 655;
-- source extra/rpl_tests/rpl_flsh_tbls.test
# End of 4.1 tests
......
......@@ -5641,7 +5641,7 @@ unpack_row(RELAY_LOG_INFO *rli,
bitmap_clear_all(rw_set);
memcpy(table->record[0], table->s->default_values, table->s->null_bytes);
empty_record(table);
Field **const begin_ptr = table->field;
Field **field_ptr;
......@@ -5657,6 +5657,10 @@ unpack_row(RELAY_LOG_INFO *rli,
{
Field *const f= *field_ptr;
/*
No need to bother about columns that does not exist: they have
gotten default values when being emptied above.
*/
if (bitmap_is_set(cols, field_ptr - begin_ptr))
{
if ((null_mask & 0xFF) == 0)
......@@ -5680,10 +5684,13 @@ unpack_row(RELAY_LOG_INFO *rli,
/*
We only unpack the field if it was non-null
*/
const char *const old_ptr= pack_ptr;
pack_ptr= f->unpack(f->ptr, pack_ptr);
DBUG_PRINT("debug", ("Unpacking field '%s' from %d bytes",
f->field_name, pack_ptr - old_ptr));
}
bitmap_set_bit(rw_set, field_ptr - begin_ptr);
bitmap_set_bit(rw_set, f->field_index);
null_mask <<= 1;
}
}
......@@ -6784,6 +6791,15 @@ copy_extra_record_fields(TABLE *table,
return 0; // All OK
}
#define DBUG_PRINT_BITSET(N,FRM,BS) \
do { \
char buf[256]; \
for (uint i = 0 ; i < (BS)->n_bits ; ++i) \
buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
buf[(BS)->n_bits] = '\0'; \
DBUG_PRINT((N), ((FRM), buf)); \
} while (0)
/*
Replace the provided record in the database.
......@@ -6816,6 +6832,12 @@ replace_record(THD *thd, TABLE *table,
int keynum;
auto_afree_ptr<char> key(NULL);
#ifndef DBUG_OFF
DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set);
DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set);
#endif
while ((error= table->file->ha_write_row(table->record[0])))
{
if (error == HA_ERR_LOCK_DEADLOCK || error == HA_ERR_LOCK_WAIT_TIMEOUT)
......@@ -6937,20 +6959,75 @@ void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info)
*/
static bool record_compare(TABLE *table)
{
/*
Need to set the X bit and the filler bits in both records since
there are engines that do not set it correctly.
In addition, since MyISAM checks that one hasn't tampered with the
record, it is necessary to restore the old bytes into the record
after doing the comparison.
TODO[record format ndb]: Remove it once NDB returns correct
records. Check that the other engines also return correct records.
*/
bool result= FALSE;
byte saved_x[2], saved_filler[2];
if (table->s->null_bytes > 0)
{
for (int i = 0 ; i < 2 ; ++i)
{
saved_x[i]= table->record[i][0];
saved_filler[i]= table->record[i][table->s->null_bytes - 1];
table->record[i][0]|= 1U;
table->record[i][table->s->null_bytes - 1]|=
256U - (1U << table->s->last_null_bit_pos);
}
}
if (table->s->blob_fields + table->s->varchar_fields == 0)
return cmp_record(table,record[1]);
{
result= cmp_record(table,record[1]);
goto record_compare_exit;
}
/* Compare null bits */
if (memcmp(table->null_flags,
table->null_flags+table->s->rec_buff_length,
table->s->null_bytes))
return TRUE; // Diff in NULL value
{
result= TRUE; // Diff in NULL value
goto record_compare_exit;
}
/* Compare updated fields */
for (Field **ptr=table->field ; *ptr ; ptr++)
{
if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
return TRUE;
{
result= TRUE;
goto record_compare_exit;
}
}
record_compare_exit:
/*
Restore the saved bytes.
TODO[record format ndb]: Remove this code once NDB returns the
correct record format.
*/
if (table->s->null_bytes > 0)
{
for (int i = 0 ; i < 2 ; ++i)
{
table->record[i][0]= saved_x[i];
table->record[i][table->s->null_bytes - 1]= saved_filler[i];
}
return FALSE;
}
return result;
}
......@@ -7094,6 +7171,9 @@ static int find_and_fetch_row(TABLE *table, byte *key)
are all set when returning. There are storage engines that
just set the necessary bits on the bytes and don't set the
filler bits correctly.
TODO[record format ndb]: Remove this code once NDB returns the
correct record format.
*/
if (table->s->null_bytes > 0)
{
......@@ -7126,16 +7206,6 @@ static int find_and_fetch_row(TABLE *table, byte *key)
/* Continue until we find the right record or have made a full loop */
do
{
/*
Patching the record before calling rnd_next() since some
storage engines do not set the filler bits correctly.
*/
if (table->s->null_bytes > 0)
{
table->record[1][table->s->null_bytes - 1]|=
256U - (1U << table->s->last_null_bit_pos);
}
error= table->file->rnd_next(table->record[1]);
DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
......@@ -7154,6 +7224,7 @@ static int find_and_fetch_row(TABLE *table, byte *key)
default:
table->file->print_error(error, MYF(0));
DBUG_PRINT("info", ("Record not found"));
table->file->ha_rnd_end();
DBUG_RETURN(error);
}
......@@ -7163,6 +7234,7 @@ static int find_and_fetch_row(TABLE *table, byte *key)
/*
Have to restart the scan to be able to fetch the next row.
*/
DBUG_PRINT("info", ("Record %sfound", restart_count == 2 ? "not " : ""));
table->file->ha_rnd_end();
DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment