Browse Source

MDEV-36115 InnoDB: assertion: node->pcur->rel_pos == BTR_PCUR_ON

in row_update_for_mysql

932ec586 (MDEV-23644) in TABLE::delete_row() added ha_delete_row() for
the case of HA_ERR_FOREIGN_DUPLICATE_KEY. The problem is
ha_update_row() called beforewards may change m_last_part which is
required for ha_delete_row() to delete from correct partition.

The fix reverts m_last_part in case ha_partition::update_row() fails.
pull/3951/head
Aleksey Midenkov 6 months ago
committed by Sergei Golubchik
parent
commit
c1492f3d07
  1. 14
      mysql-test/suite/versioning/r/partition.result
  2. 16
      mysql-test/suite/versioning/t/partition.test
  3. 3
      sql/ha_partition.cc

14
mysql-test/suite/versioning/r/partition.result

@ -1791,6 +1791,20 @@ drop table t;
create table t (a int) with system versioning partition by system_time partitions 3;
ERROR HY000: Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
#
# MDEV-36115 InnoDB: assertion: node->pcur->rel_pos == BTR_PCUR_ON
# in row_update_for_mysql
#
create table t (a int key) engine=innodb
with system versioning
partition by key() partitions 3;
start transaction;
insert into t values (1),(2),(3),(4),(5),(6),(7),(8);
set timestamp=+1;
delete from t;
insert into t values (1),(2);
DELETE from t;
drop table t;
#
# End of 10.5 tests
#
set global innodb_stats_persistent= @save_persistent;

16
mysql-test/suite/versioning/t/partition.test

@ -1563,6 +1563,22 @@ drop table t;
--error WARN_VERS_PARAMETERS
create table t (a int) with system versioning partition by system_time partitions 3;
--echo #
--echo # MDEV-36115 InnoDB: assertion: node->pcur->rel_pos == BTR_PCUR_ON
--echo # in row_update_for_mysql
--echo #
create table t (a int key) engine=innodb
with system versioning
partition by key() partitions 3;
start transaction;
insert into t values (1),(2),(3),(4),(5),(6),(7),(8);
set timestamp=+1;
delete from t;
insert into t values (1),(2);
DELETE from t;
drop table t;
--echo #
--echo # End of 10.5 tests
--echo #

3
sql/ha_partition.cc

@ -4616,7 +4616,6 @@ int ha_partition::update_row(const uchar *old_data, const uchar *new_data)
}
m_last_part= new_part_id;
start_part_bulk_insert(thd, new_part_id);
DBUG_ASSERT(!m_file[new_part_id]->row_logging);
if (new_part_id == old_part_id)
@ -4651,6 +4650,8 @@ int ha_partition::update_row(const uchar *old_data, const uchar *new_data)
goto exit;
}
m_last_part= new_part_id;
exit:
/*
if updating an auto_increment column, update

Loading…
Cancel
Save