summaryrefslogtreecommitdiff
path: root/mysql-test/r/innodb_mysql.result
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 /mysql-test/r/innodb_mysql.result
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 'mysql-test/r/innodb_mysql.result')
-rw-r--r--mysql-test/r/innodb_mysql.result27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 3f830378afa..b9e236c0def 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -2021,4 +2021,31 @@ DROP TABLE t4;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+CREATE TABLE t1 (a INT, b INT, KEY (a)) ENGINE = INNODB;
+CREATE TABLE t2 (a INT KEY, b INT, KEY (b)) ENGINE = INNODB;
+CREATE TABLE t3 (a INT, b INT KEY, KEY (a)) ENGINE = INNODB;
+CREATE TABLE t4 (a INT KEY, b INT, KEY (b)) ENGINE = INNODB;
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6);
+INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+INSERT INTO t3 VALUES (1, 101), (2, 102), (3, 103), (4, 104), (5, 105), (6, 106);
+INSERT INTO t4 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+UPDATE t1, t2 SET t1.a = t1.a + 100, t2.b = t1.a + 10
+WHERE t1.a BETWEEN 2 AND 4 AND t2.a = t1.b;
+SELECT * FROM t2;
+a b
+1 1
+2 12
+3 13
+4 14
+5 5
+UPDATE t3, t4 SET t3.a = t3.a + 100, t4.b = t3.a + 10
+WHERE t3.a BETWEEN 2 AND 4 AND t4.a = t3.b - 100;
+SELECT * FROM t4;
+a b
+1 1
+2 12
+3 13
+4 14
+5 5
+DROP TABLE t1, t2, t3, t4;
End of 5.1 tests