mirror of
https://github.com/MariaDB/server.git
synced 2025-07-24 19:42:23 +03:00
5.5 merge
This commit is contained in:
@ -471,12 +471,15 @@ int mysql_update(THD *thd,
|
||||
We can't update table directly; We must first search after all
|
||||
matching rows before updating the table!
|
||||
*/
|
||||
|
||||
// Verify that table->restore_column_maps_after_mark_index() will work
|
||||
DBUG_ASSERT(table->read_set == &table->def_read_set);
|
||||
DBUG_ASSERT(table->write_set == &table->def_write_set);
|
||||
|
||||
if (used_index < MAX_KEY && old_covering_keys.is_set(used_index))
|
||||
table->add_read_columns_used_by_index(used_index);
|
||||
else
|
||||
{
|
||||
table->use_all_columns();
|
||||
}
|
||||
|
||||
/* note: We avoid sorting if we sort on the used index */
|
||||
if (order && (need_sort || used_key_is_modified))
|
||||
@ -613,8 +616,11 @@ int mysql_update(THD *thd,
|
||||
if (error >= 0)
|
||||
goto err;
|
||||
}
|
||||
if (table->key_read)
|
||||
table->restore_column_maps_after_mark_index();
|
||||
/*
|
||||
This restore bitmaps, works for add_read_columns_used_by_index() and
|
||||
use_all_columns():
|
||||
*/
|
||||
table->restore_column_maps_after_mark_index();
|
||||
}
|
||||
|
||||
if (ignore)
|
||||
@ -2238,11 +2244,16 @@ err:
|
||||
}
|
||||
|
||||
err2:
|
||||
(void) table->file->ha_rnd_end();
|
||||
(void) tmp_table->file->ha_rnd_end();
|
||||
if (table->file->inited)
|
||||
(void) table->file->ha_rnd_end();
|
||||
if (tmp_table->file->inited)
|
||||
(void) tmp_table->file->ha_rnd_end();
|
||||
check_opt_it.rewind();
|
||||
while (TABLE *tbl= check_opt_it++)
|
||||
tbl->file->ha_rnd_end();
|
||||
{
|
||||
if (tbl->file->inited)
|
||||
(void) tbl->file->ha_rnd_end();
|
||||
}
|
||||
|
||||
if (updated != org_updated)
|
||||
{
|
||||
|
Reference in New Issue
Block a user