Commit 27980b0f authored by Sachin's avatar Sachin Committed by Marko Mäkelä

MDEV-19365 Assertion failure in LONG Unique after 10.3 merge

If handler->inited is RND use cloned handler for long unique duplicate search.
parent d18ef804
......@@ -6500,8 +6500,7 @@ static int check_duplicate_long_entries_update(TABLE *table, handler *h, uchar *
with respect to fields in hash_str
*/
uint reclength= (uint) (table->record[1] - table->record[0]);
if (!table->update_handler)
table->clone_handler_for_update();
table->clone_handler_for_update();
for (uint i= 0; i < table->s->keys; i++)
{
keyinfo= table->key_info + i;
......@@ -6546,6 +6545,8 @@ int handler::ha_write_row(uchar *buf)
if (table->s->long_unique_table)
{
if (this->inited == RND)
table->clone_handler_for_update();
handler *h= table->update_handler ? table->update_handler : table->file;
if ((error= check_duplicate_long_entries(table, h, buf)))
DBUG_RETURN(error);
......
......@@ -9014,6 +9014,8 @@ void re_setup_keyinfo_hash(KEY *key_info)
*/
void TABLE::clone_handler_for_update()
{
if (this->update_handler)
return;
handler *update_handler= NULL;
if (!s->long_unique_table)
return;
......
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