Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16166

RBR breaks with HA_ERR_KEY_NOT_FOUND upon DELETE from table with spatial index

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
    • 5.5.62
    • GIS, Replication

    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.

      Attachments

        Activity

          Only fails when format is row (which is obvious)

          sachin.setiya.007 Sachin Setiya (Inactive) added a comment - Only fails when format is row (which is obvious)
          sachin.setiya.007 Sachin Setiya (Inactive) added a comment - - edited

          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
          
          

          sachin.setiya.007 Sachin Setiya (Inactive) added a comment - - edited 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

          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

          sachin.setiya.007 Sachin Setiya (Inactive) added a comment - 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

          bug branch bb-5.5-16166

          sachin.setiya.007 Sachin Setiya (Inactive) added a comment - bug branch bb-5.5-16166

          People

            sachin.setiya.007 Sachin Setiya (Inactive)
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.