Commit 16c13a58 authored by svoj@mysql.com/april.(none)'s avatar svoj@mysql.com/april.(none)

Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1-engines

into  mysql.com:/home/svoj/devel/mysql/BUG21381/mysql-4.1-engines
parents 5f3cf1ec b141a7c1
...@@ -31,3 +31,11 @@ pk1 b c ...@@ -31,3 +31,11 @@ pk1 b c
12 2 2 12 2 2
14 1 1 14 1 1
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT NOT NULL, UNIQUE(a)) ENGINE=ndbcluster;
INSERT INTO t1 VALUES(1),(2);
UPDATE IGNORE t1, t1 AS t1a SET t1.a=3;
SELECT a FROM t1 ORDER BY a;
a
1
3
DROP TABLE t1;
...@@ -33,4 +33,13 @@ select * from t1 order by pk1; ...@@ -33,4 +33,13 @@ select * from t1 order by pk1;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
#
# BUG#21381 - Engine not notified about multi-table UPDATE IGNORE
#
CREATE TABLE t1(a INT NOT NULL, UNIQUE(a)) ENGINE=ndbcluster;
INSERT INTO t1 VALUES(1),(2);
UPDATE IGNORE t1, t1 AS t1a SET t1.a=3;
SELECT a FROM t1 ORDER BY a;
DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
...@@ -901,6 +901,8 @@ multi_update::initialize_tables(JOIN *join) ...@@ -901,6 +901,8 @@ multi_update::initialize_tables(JOIN *join)
List<Item> temp_fields= *fields_for_table[cnt]; List<Item> temp_fields= *fields_for_table[cnt];
ORDER group; ORDER group;
if (ignore)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
if (table == main_table) // First table in join if (table == main_table) // First table in join
{ {
if (safe_update_on_fly(join->join_tab, &temp_fields)) if (safe_update_on_fly(join->join_tab, &temp_fields))
...@@ -1007,7 +1009,11 @@ multi_update::~multi_update() ...@@ -1007,7 +1009,11 @@ multi_update::~multi_update()
{ {
TABLE_LIST *table; TABLE_LIST *table;
for (table= update_tables ; table; table= table->next) for (table= update_tables ; table; table= table->next)
{
table->table->no_keyread= table->table->no_cache= 0; table->table->no_keyread= table->table->no_cache= 0;
if (ignore)
table->table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
}
if (tmp_tables) if (tmp_tables)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment