Commit 18502f99 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-22185 Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON or...

MDEV-22185 Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON or ER_KEY_NOT_FOUND or Assertion `inited==NONE' failed in handler::ha_index_init

long unique checks should be done for a partitioned table as a whole,
not for individual partitions.

Followup for f3f31eaa that extends it to UPDATE
parent 67aaf51c
......@@ -337,3 +337,7 @@ a b
1 foo
3 bar
drop table if exists t1, t2;
create table t1 (a int, b int, unique (b) using hash) engine=innodb partition by key (a) partitions 2;
insert into t1 values (1,10),(2,20);
update t1 set b = 30 limit 1;
drop table t1;
......@@ -402,3 +402,11 @@ create or replace table t2 (a int, b blob, unique(b)) replace as select * from t
select * from t2;
drop table if exists t1, t2;
#
# MDEV-22185 Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON or ER_KEY_NOT_FOUND or Assertion `inited==NONE' failed in handler::ha_index_init
#
create table t1 (a int, b int, unique (b) using hash) engine=innodb partition by key (a) partitions 2;
insert into t1 values (1,10),(2,20);
update t1 set b = 30 limit 1;
drop table t1;
......@@ -7009,7 +7009,7 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data)
MYSQL_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str);
mark_trx_read_write();
increment_statistics(&SSV::ha_update_count);
if (table->s->long_unique_table &&
if (table->s->long_unique_table && this == table->file &&
(error= check_duplicate_long_entries_update(new_data)))
{
return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment