Commit 7a62b592 authored by unknown's avatar unknown

Fix for BUG#12082 (assert failure when the query fails to get a lock for record in 'const' table):

 Set table->key_read back to 0 regardless of whether join_read_const() succeeded or not.

parent 8db171df
......@@ -9717,7 +9717,13 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
table->file->extra(HA_EXTRA_KEYREAD);
tab->index= tab->ref.key;
}
if ((error=join_read_const(tab)))
error=join_read_const(tab);
if (table->key_read)
{
table->key_read=0;
table->file->extra(HA_EXTRA_NO_KEYREAD);
}
if (error)
{
tab->info="unique row not found";
/* Mark for EXPLAIN that the row was not found */
......@@ -9725,11 +9731,6 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
if (!table->maybe_null || error > 0)
DBUG_RETURN(error);
}
if (table->key_read)
{
table->key_read=0;
table->file->extra(HA_EXTRA_NO_KEYREAD);
}
}
if (*tab->on_expr_ref && !table->null_row)
{
......
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