summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2020-02-21 13:08:52 +1000
committerNikita Malyavin <nikitamalyavin@gmail.com>2020-02-21 13:49:32 +1000
commit6d82b46a12de536c16992fa3fb1da534c1e43630 (patch)
tree94e831cbae990b2803c0a4106f7784b3abc23254
parentdfbb7cd8b6e10d6f3c987ccec8f320af684579bb (diff)
downloadmariadb-git-6d82b46a12de536c16992fa3fb1da534c1e43630.tar.gz
Revert "handler: remove store/restore record from check_duplicate_long_entry_key"
This reverts commit 3efcc746
-rw-r--r--sql/handler.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index f74939ab153..6777e9732c2 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -6511,7 +6511,8 @@ static int check_duplicate_long_entry_key(TABLE *table, handler *h,
result= h->ha_index_init(key_no, 0);
if (result)
return result;
- result= h->ha_index_read_map(table->check_unique_buf,
+ store_record(table, check_unique_buf);
+ result= h->ha_index_read_map(table->record[0],
ptr, HA_WHOLE_KEY, HA_READ_KEY_EXACT);
if (!result)
{
@@ -6547,7 +6548,7 @@ static int check_duplicate_long_entry_key(TABLE *table, handler *h,
}
}
}
- while (!is_same && !(result= h->ha_index_next_same(table->check_unique_buf,
+ while (!is_same && !(result= h->ha_index_next_same(table->record[0],
ptr, key_info->key_length)));
if (is_same)
error= HA_ERR_FOUND_DUPP_KEY;
@@ -6561,10 +6562,11 @@ exit:
table->file->errkey= key_no;
if (h->ha_table_flags() & HA_DUPLICATE_POS)
{
- h->position(table->check_unique_buf);
+ h->position(table->record[0]);
memcpy(table->file->dup_ref, h->ref, h->ref_length);
}
}
+ restore_record(table, check_unique_buf);
h->ha_index_end();
return error;
}