[MDEV-16166] RBR breaks with HA_ERR_KEY_NOT_FOUND upon DELETE from table with spatial index Created: 2018-05-14  Updated: 2018-08-03  Resolved: 2018-08-03

Status: Closed
Project: MariaDB Server
Component/s: GIS, Replication
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 5.5.62

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sachin Setiya (Inactive)
Resolution: Fixed Votes: 0
Labels: upstream


 Description   

--source include/have_binlog_format_row.inc
--source include/master-slave.inc
 
CREATE TABLE t1 (g POINT NOT NULL, SPATIAL INDEX(g));
INSERT INTO t1 VALUES (ST_GEOMFROMTEXT('Point(1 1)'));
DELETE FROM t1;
--sync_slave_with_master
 
--connection master
DROP TABLE t1;
--source include/rpl_end.inc

5.5 3eb2a265ea

Last_Errno	1032
Last_Error	Could not execute Delete_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 767

It fails on all of MariaDB 5.5-10.3 and MySQL 5.6-8.0 (MySQL 5.6 even throws a debug assertion somewhere). I haven't found an upstream bug report for that and didn't create one.



 Comments   
Comment by Sachin Setiya (Inactive) [ 2018-05-16 ]

Only fails when format is row (which is obvious)

Comment by Sachin Setiya (Inactive) [ 2018-05-16 ]

Slave ->
 
ha_write_row
(gdb) x/13b table->record[0]
0x7fff9c0153b8: 25      0       0       0       112     38      1       -100
0x7fff9c0153c0: -1      127     0       0       -91
 
ha_index_read
(gdb) x/13b table->record[0] (key)
0x7fff9c0153b8: 25      0       0       0       112     38      1       -100
0x7fff9c0153c0: -1      127     0       0       -91
 
Master ->
 
ha_write_row
(gdb) x /13b table->record[0]
0x7fffd80095f8: 25      0       0       0       -16     78      0       -40
0x7fffd8009600: -1      127     0       0       -91
 
ha_delete_row
(gdb) x /13b table->record[0]
0x7fffd80095f8: 25      0       0       0       -3      -71     0       -40
0x7fffd8009600: -1      127     0       0       -91

Comment by Sachin Setiya (Inactive) [ 2018-06-05 ]

Above comment is wrong , So the issue is since it is spatial index , at the time of searching index for
key we use wrong field image we use Field::itRAW while we should be using Field::itMBR

Comment by Sachin Setiya (Inactive) [ 2018-06-05 ]

bug branch bb-5.5-16166

Generated at Thu Feb 08 08:26:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.