summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-08-02 12:01:24 +0300
committerMichael Widenius <monty@askmonty.org>2010-08-02 12:01:24 +0300
commite0a6b02c5d0a311e7167295494786077009743d1 (patch)
tree72c934fe42261ad5de3139961e092f57e9d147df /sql/sql_update.cc
parentd2f8b7d04503478ab6b6998194a2070891f0c2bb (diff)
parent6ad06b15222300e4eed4fe3972d1ad249c4c42a2 (diff)
downloadmariadb-git-e0a6b02c5d0a311e7167295494786077009743d1.tar.gz
Merge with MySQL 5.1.49
Fixed Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins' in a better way (patch from Sergey Petrunya)
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc15
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> &not_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> &not_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> &not_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) *