mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.4 into 10.5
This commit is contained in:
@ -754,15 +754,20 @@ int mysql_update(THD *thd,
|
||||
!table->check_virtual_columns_marked_for_write())
|
||||
{
|
||||
DBUG_PRINT("info", ("Trying direct update"));
|
||||
if (select && select->cond &&
|
||||
(select->cond->used_tables() == table->map))
|
||||
bool use_direct_update= !select || !select->cond;
|
||||
if (!use_direct_update &&
|
||||
(select->cond->used_tables() & ~RAND_TABLE_BIT) == table->map)
|
||||
{
|
||||
DBUG_ASSERT(!table->file->pushed_cond);
|
||||
if (!table->file->cond_push(select->cond))
|
||||
{
|
||||
use_direct_update= TRUE;
|
||||
table->file->pushed_cond= select->cond;
|
||||
}
|
||||
}
|
||||
|
||||
if (!table->file->info_push(INFO_KIND_UPDATE_FIELDS, &fields) &&
|
||||
if (use_direct_update &&
|
||||
!table->file->info_push(INFO_KIND_UPDATE_FIELDS, &fields) &&
|
||||
!table->file->info_push(INFO_KIND_UPDATE_VALUES, &values) &&
|
||||
!table->file->direct_update_rows_init(&fields))
|
||||
{
|
||||
|
Reference in New Issue
Block a user