mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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.
This commit is contained in:
@@ -9717,7 +9717,13 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
|
|||||||
table->file->extra(HA_EXTRA_KEYREAD);
|
table->file->extra(HA_EXTRA_KEYREAD);
|
||||||
tab->index= tab->ref.key;
|
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";
|
tab->info="unique row not found";
|
||||||
/* Mark for EXPLAIN that the row was 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)
|
if (!table->maybe_null || error > 0)
|
||||||
DBUG_RETURN(error);
|
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)
|
if (*tab->on_expr_ref && !table->null_row)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user