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

Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt

into  magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.1-opt
This commit is contained in:
gkodinov/kgeorge@magare.gmz
2007-03-09 17:54:13 +02:00
22 changed files with 725 additions and 263 deletions

View File

@@ -126,7 +126,7 @@ int mysql_update(THD *thd,
#endif
uint table_count= 0;
ha_rows updated, found;
key_map old_used_keys;
key_map old_covering_keys;
TABLE *table;
SQL_SELECT *select;
READ_RECORD info;
@@ -165,8 +165,8 @@ int mysql_update(THD *thd,
thd->proc_info="init";
table= table_list->table;
/* Calculate "table->used_keys" based on the WHERE */
table->used_keys= table->s->keys_in_use;
/* Calculate "table->covering_keys" based on the WHERE */
table->covering_keys= table->s->keys_in_use;
table->quick_keys.clear_all();
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -176,7 +176,7 @@ int mysql_update(THD *thd,
if (mysql_prepare_update(thd, table_list, &conds, order_num, order))
DBUG_RETURN(1);
old_used_keys= table->used_keys; // Keys used in WHERE
old_covering_keys= table->covering_keys; // Keys used in WHERE
/* Check the fields we are going to modify */
#ifndef NO_EMBEDDED_ACCESS_CHECKS
table_list->grant.want_privilege= table->grant.want_privilege= want_privilege;
@@ -229,7 +229,7 @@ int mysql_update(THD *thd,
limit= 0; // Impossible WHERE
}
// Don't count on usage of 'only index' when calculating which key to use
table->used_keys.clear_all();
table->covering_keys.clear_all();
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (prune_partitions(thd, table, conds))
@@ -304,7 +304,7 @@ int mysql_update(THD *thd,
We can't update table directly; We must first search after all
matching rows before updating the table!
*/
if (used_index < MAX_KEY && old_used_keys.is_set(used_index))
if (used_index < MAX_KEY && old_covering_keys.is_set(used_index))
{
table->key_read=1;
table->mark_columns_used_by_index(used_index);
@@ -1092,7 +1092,7 @@ int multi_update::prepare(List<Item> &not_used_values,
}
/*
We have to check values after setup_tables to get used_keys right in
We have to check values after setup_tables to get covering_keys right in
reference tables
*/
@@ -1119,7 +1119,7 @@ int multi_update::prepare(List<Item> &not_used_values,
update.link_in_list((byte*) tl, (byte**) &tl->next_local);
tl->shared= table_count++;
table->no_keyread=1;
table->used_keys.clear_all();
table->covering_keys.clear_all();
table->pos_in_table_list= tl;
}
}