diff options
author | svoj@mysql.com/april.(none) <> | 2006-10-05 19:02:29 +0500 |
---|---|---|
committer | svoj@mysql.com/april.(none) <> | 2006-10-05 19:02:29 +0500 |
commit | d41340516fa28c9b626bb37c07afd3af0c2d0744 (patch) | |
tree | 6258cfa7ebe6c1606b052b04319b61a92e53439e | |
parent | 25ef3a6ee1e284ae78f93283c69d6862f09e32e4 (diff) | |
parent | 16c13a588f9bbce45a776ef205fd92edced95c04 (diff) | |
download | mariadb-git-d41340516fa28c9b626bb37c07afd3af0c2d0744.tar.gz |
Merge mysql.com:/home/svoj/devel/mysql/BUG21381/mysql-4.1-engines
into mysql.com:/home/svoj/devel/mysql/BUG21381/mysql-5.0-engines
-rw-r--r-- | mysql-test/r/ndb_update.result | 8 | ||||
-rw-r--r-- | mysql-test/t/ndb_update.test | 9 | ||||
-rw-r--r-- | sql/sql_update.cc | 6 |
3 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result index c2247564e65..4848284b4af 100644 --- a/mysql-test/r/ndb_update.result +++ b/mysql-test/r/ndb_update.result @@ -31,3 +31,11 @@ pk1 b c 12 2 2 14 1 1 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; diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index 45e3add4639..e7c5fd0c4a5 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -33,4 +33,13 @@ select * from t1 order by pk1; DROP TABLE IF EXISTS t1; --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 diff --git a/sql/sql_update.cc b/sql/sql_update.cc index a5a767b6ebc..ead00ffe786 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1095,6 +1095,8 @@ multi_update::initialize_tables(JOIN *join) List<Item> temp_fields= *fields_for_table[cnt]; ORDER group; + if (ignore) + table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); if (table == main_table) // First table in join { if (safe_update_on_fly(join->join_tab, &temp_fields)) @@ -1216,7 +1218,11 @@ multi_update::~multi_update() { TABLE_LIST *table; for (table= update_tables ; table; table= table->next_local) + { table->table->no_keyread= table->table->no_cache= 0; + if (ignore) + table->table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); + } if (tmp_tables) { |