1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

WL#2985 "Partition pruning": addition2: perform partition pruning for

single-table UPDATE/DELETE.
This commit is contained in:
sergefp@mysql.com
2006-01-26 20:17:17 +03:00
parent dbc75b0e27
commit c53b5a0b9f
4 changed files with 115 additions and 2 deletions

View File

@ -244,6 +244,21 @@ int mysql_update(THD *thd,
}
// Don't count on usage of 'only index' when calculating which key to use
table->used_keys.clear_all();
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (prune_partitions(thd, table, conds))
{
free_underlaid_joins(thd, select_lex);
send_ok(thd); // No matching records
DBUG_RETURN(0);
}
/*
Update the table->records number (note: we probably could remove the
previous file->info() call)
*/
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
#endif
select= make_select(table, 0, 0, conds, 0, &error);
if (error || !limit ||
(select && select->check_quick(thd, safe_update, limit)))