Bug #58997 Row-based replication breaks on table with only fulltext index
Submitted: 17 Dec 2010 12:46 Modified: 10 Jan 2013 14:33
Reporter: Kristian Nielsen Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S3 (Non-critical)
Version:5.1-launchpad OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[17 Dec 2010 12:46] Kristian Nielsen
Description:
Row-based replication uses the first index on a table to locate rows for
UPDATE and DELETE. However, it does not verify that such index is usable. If
not, replication breaks.

In particular, a MyISAM table that has only a fulltext index causes row-based
replication to break with the error:

    Last_SQL_Error	Could not execute Update_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND

Verified with latest MySQL 5.1 on Launchpad.

How to repeat:
Run this mysql-test-run test case:

-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc

connection master;
CREATE TABLE t1 (a int, b varchar(100), fulltext(b)) engine=MyISAM;
INSERT INTO t1 VALUES (1,"a"), (2,"b");
UPDATE t1 SET b='A' WHERE a=1;
DELETE FROM t1 WHERE a=2;

sync_slave_with_master;

connection slave;

SELECT * FROM t1 ORDER BY a;

connection master;
DROP TABLE t1;

sync_slave_with_master;

Suggested fix:
Don't try to use an index that does not support index_read()/index_next().
[17 Dec 2010 14:53] Valeriy Kravchuk
Verified on Mac OS X:

macbook-pro:mysql-test openxs$ ./mtr --mysqld=--binlog-format=row bug58997
Logging: ./mtr  --mysqld=--binlog-format=row bug58997
101217 16:51:25 [Warning] Setting lower_case_table_names=2 because file system for /var/folders/dX/dXCzvuSlHX4Op1g-o1jIWk+++TI/-Tmp-/iPm6eT9jDu/ is case insensitive
101217 16:51:25 [Note] Plugin 'FEDERATED' is disabled.
101217 16:51:25 [Note] Plugin 'ndbcluster' is disabled.
MySQL Version 5.1.54
Using binlog format 'row'
Checking supported features...
 - skipping ndbcluster
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
vardir: /Users/openxs/dbs/5.1/mysql-test/var
Checking leftover processes...
Removing old var directory...
Creating var directory '/Users/openxs/dbs/5.1/mysql-test/var'...
Installing system database...
Using server port 49219

==============================================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
main.bug58997                            [ fail ]
        Test ended at 2010-12-17 16:51:33

CURRENT_TEST: main.bug58997
=== SHOW MASTER STATUS ===
---- 1. ----
File	slave-bin.000001
Position	441
Binlog_Do_DB	
Binlog_Ignore_DB	
==========================

=== SHOW SLAVE STATUS ===
---- 1. ----
Slave_IO_State	Waiting for master to send event
Master_Host	127.0.0.1
Master_User	root
Master_Port	13000
Connect_Retry	1
Master_Log_File	master-bin.000001
Read_Master_Log_Pos	901
Relay_Log_File	slave-relay-bin.000003
Relay_Log_Pos	605
Relay_Master_Log_File	master-bin.000001
Slave_IO_Running	Yes
Slave_SQL_Running	No
Replicate_Do_DB	
Replicate_Ignore_DB	
Replicate_Do_Table	
Replicate_Ignore_Table	
Replicate_Wild_Do_Table	
Replicate_Wild_Ignore_Table	
Last_Errno	1032
Last_Error	Could not execute Update_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 615
Skip_Counter	0
Exec_Master_Log_Pos	459
Relay_Log_Space	1202
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	0
Last_IO_Error	
Last_SQL_Errno	1032
Last_SQL_Error	Could not execute Update_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 615
=========================
...
[10 Jan 2013 14:33] Erlend Dahl
Fixed in 5.6.9 as a duplicate of an internally filed bug.
[10 Jan 2013 17:17] Elena Stepanova
Hi,

I've seen several such comments recently, and they made me wonder: do they mean that although the bugs get fixed, public bug numbers will not appear in commit comments anymore; and since the internal bug numbers are not mentioned here, there will be no way to match commits with public bugs, even for non-security issues?
[21 Jul 2014 12:25] Sveta Smirnova
Bug #69974 was marked as duplicate of this one.