1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00

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.
This commit is contained in:
Aleksey Midenkov
2025-03-30 18:54:23 +03:00
committed by Sergei Golubchik
parent 1db7ccc124
commit c1492f3d07
3 changed files with 32 additions and 1 deletions

View File

@@ -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;

View File

@@ -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 #

View File

@@ -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