summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorMartin Hansson <mhansson@mysql.com>2009-05-05 11:38:19 +0200
committerMartin Hansson <mhansson@mysql.com>2009-05-05 11:38:19 +0200
commit391364fac778621e626c9ffdf7653d2b61690ad3 (patch)
tree432a1d7e25b477fe9f283a886845c37bd86cfeb5 /sql/sql_base.cc
parente0526914b6acb91f8cf15bd536ad40e226158d1b (diff)
downloadmariadb-git-391364fac778621e626c9ffdf7653d2b61690ad3.tar.gz
Bug#43580: Issue with Innodb on multi-table update
Certain multi-updates gave different results on InnoDB from to MyISAM, due to on-the-fly updates being used on the former and the update order matters. Fixed by turning off on-the-fly updates when update order dependencies are present. mysql-test/r/innodb_mysql.result: Bug#43580: Test result. mysql-test/suite/rpl/r/rpl_slave_skip.result: Bug#43580: Changed test result. The InnoDB result is now what it would have been on MyISAM. mysql-test/t/innodb_mysql.test: Bug#43580: Test case. sql/sql_base.cc: Bug#43580: Added a word of caution about using tmp_set here. sql/sql_update.cc: Bug#43580: Fix. Calls to TABLE::mark_columns_needed_for_update() are moved from mysql_multi_update_prepare() and right before the decison to do on-the-fly updates to the place where we do (or don't do) on-the-fly updates.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 0dc29f7e3c2..d4d813d0fbd 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -5585,6 +5585,13 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table)
other_bitmap= table->read_set;
}
+ /*
+ The test-and-set mechanism in the bitmap is not reliable during
+ multi-UPDATE statements under MARK_COLUMNS_READ mode
+ (thd->mark_used_columns == MARK_COLUMNS_READ), as this bitmap contains
+ only those columns that are used in the SET clause. I.e they are being
+ set here. See multi_update::prepare()
+ */
if (bitmap_fast_test_and_set(current_bitmap, field->field_index))
{
if (thd->mark_used_columns == MARK_COLUMNS_WRITE)