diff options
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index cb72534856a..9dd48ca2010 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -394,7 +394,7 @@ int mysql_update(THD *thd, matching rows before updating the table! */ if (used_index < MAX_KEY && old_covering_keys.is_set(used_index)) - table->mark_columns_used_by_index(used_index); + table->add_read_columns_used_by_index(used_index); else { table->use_all_columns(); @@ -422,6 +422,7 @@ int mysql_update(THD *thd, { goto err; } + thd->examined_row_count+= examined_rows; /* Filesort has already found and selected the rows we want to update, so we don't need the where clause @@ -469,6 +470,7 @@ int mysql_update(THD *thd, while (!(error=info.read_record(&info)) && !thd->killed && !thd->is_error()) { + thd->examined_row_count++; if (!select || select->skip_record(thd) > 0) { if (table->file->was_semi_consistent_read()) @@ -575,6 +577,7 @@ int mysql_update(THD *thd, while (!(error=info.read_record(&info)) && !thd->killed) { + thd->examined_row_count++; if (!select || select->skip_record(thd) > 0) { if (table->file->was_semi_consistent_read()) @@ -1048,7 +1051,7 @@ reopen_tables: correct order of statements. Otherwise, we use a TL_READ lock to improve performance. */ - tl->lock_type= read_lock_type_for_table(thd, table); + tl->lock_type= read_lock_type_for_table(thd, lex, tl); tl->updating= 0; /* Update TABLE::lock_type accordingly. */ if (!tl->placeholder() && !using_lock_tables) @@ -1326,7 +1329,7 @@ int multi_update::prepare(List<Item> ¬_used_values, SELECT_LEX_UNIT *lex_unit) { TABLE_LIST *table_ref; - SQL_LIST update; + SQL_I_List<TABLE_LIST> update; table_map tables_to_update; Item_field *item; List_iterator_fast<Item> field_it(*fields); @@ -1406,11 +1409,11 @@ int multi_update::prepare(List<Item> ¬_used_values, leaf_table_count++; if (tables_to_update & table->map) { - TABLE_LIST *tl= (TABLE_LIST*) thd->memdup((char*) table_ref, + TABLE_LIST *tl= (TABLE_LIST*) thd->memdup(table_ref, sizeof(*tl)); if (!tl) DBUG_RETURN(1); - update.link_in_list((uchar*) tl, (uchar**) &tl->next_local); + update.link_in_list(tl, &tl->next_local); tl->shared= table_count++; table->no_keyread=1; table->covering_keys.clear_all(); @@ -1431,7 +1434,7 @@ int multi_update::prepare(List<Item> ¬_used_values, table_count= update.elements; - update_tables= (TABLE_LIST*) update.first; + update_tables= update.first; tmp_tables = (TABLE**) thd->calloc(sizeof(TABLE *) * table_count); tmp_table_param = (TMP_TABLE_PARAM*) thd->calloc(sizeof(TMP_TABLE_PARAM) * |