1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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

single-table UPDATE/DELETE.


mysql-test/r/partition_pruning.result:
  WL#2985 "Partition pruning": addition2: perform partition pruning for UPDATE/DELETE:
  testcases added
mysql-test/t/partition_pruning.test:
  WL#2985 "Partition pruning": addition2: perform partition pruning for UPDATE/DELETE:
  testcases added
sql/sql_delete.cc:
  WL#2985 "Partition pruning": addition2: perform partition pruning for UPDATE/DELETE:
  Added partition pruning call in mysql_delete()
sql/sql_update.cc:
  WL#2985 "Partition pruning": addition2: perform partition pruning for UPDATE/DELETE:
  Added partition pruning call in mysql_update()
This commit is contained in:
unknown
2006-01-26 20:17:17 +03:00
parent 77f51bf11a
commit d50236f69e
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)))