1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Auto-merge from mysql-trunk.

This commit is contained in:
Alexander Nozdrin
2010-05-28 09:47:58 +04:00
212 changed files with 3897 additions and 900 deletions

View File

@@ -436,6 +436,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
@@ -482,6 +483,7 @@ int mysql_update(THD *thd,
while (!(error=info.read_record(&info)) && !thd->killed)
{
thd->examined_row_count++;
if (!(select && select->skip_record()))
{
if (table->file->was_semi_consistent_read())
@@ -588,6 +590,7 @@ int mysql_update(THD *thd,
while (!(error=info.read_record(&info)) && !thd->killed)
{
thd->examined_row_count++;
if (!(select && select->skip_record()))
{
if (table->file->was_semi_consistent_read())
@@ -1336,6 +1339,16 @@ int multi_update::prepare(List<Item> &not_used_values,
{
table->read_set= &table->def_read_set;
bitmap_union(table->read_set, &table->tmp_set);
/*
If a timestamp field settable on UPDATE is present then to avoid wrong
update force the table handler to retrieve write-only fields to be able
to compare records and detect data change.
*/
if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ &&
table->timestamp_field &&
(table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_UPDATE ||
table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH))
bitmap_union(table->read_set, table->write_set);
}
}