diff options
author | unknown <mskold@mysql.com> | 2006-03-23 22:39:30 +0100 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2006-03-23 22:39:30 +0100 |
commit | b436ae59d5d7dc753f01e711a49bb605882cceca (patch) | |
tree | 663cd6576766a904a568b03694fc5fac1783e4b7 /mysql-test | |
parent | d4c8ca0ca79afd3dd34a8aea4e75e9a7c38bb626 (diff) | |
parent | 65942df9c992fa78e81b401fbb684b1f05c8bb4f (diff) | |
download | mariadb-git-b436ae59d5d7dc753f01e711a49bb605882cceca.tar.gz |
Merge mysql.com:/usr/local/home/marty/MySQL/mysql-5.0
into mysql.com:/usr/local/home/marty/MySQL/mysql-5.1-new
mysql-test/r/ndb_insert.result:
Auto merged
mysql-test/r/ndb_replace.result:
Auto merged
storage/ndb/include/ndbapi/NdbIndexOperation.hpp:
Auto merged
storage/ndb/include/ndbapi/NdbOperation.hpp:
Auto merged
storage/ndb/include/ndbapi/NdbScanOperation.hpp:
Auto merged
storage/ndb/src/ndbapi/NdbIndexOperation.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbOperation.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbTransaction.cpp:
Auto merged
sql/ha_ndbcluster.cc:
Keeping local and do manual merge
sql/ha_ndbcluster.h:
Keeping local and do hand merge
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ndb_insert.result | 28 | ||||
-rw-r--r-- | mysql-test/r/ndb_replace.result | 12 | ||||
-rw-r--r-- | mysql-test/t/ndb_insert.test | 23 | ||||
-rw-r--r-- | mysql-test/t/ndb_replace.test | 11 |
4 files changed, 64 insertions, 10 deletions
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index 11d322a06de..1da958ef0f7 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -577,6 +577,25 @@ pk1 b c 2 2 17 4 4 3 6 6 3 +DELETE FROM t1; +CREATE UNIQUE INDEX bi ON t1(b); +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10; +select * from t1 order by pk1; +pk1 b c +2 2 2 +3 3 3 +4 4 4 +5 5 5 +6 6 6 +7 7 7 +8 8 8 +9 9 9 +10 10 10 +11 11 1 +21 21 21 DROP TABLE t1; CREATE TABLE t1(a INT) ENGINE=ndb; INSERT IGNORE INTO t1 VALUES (1); @@ -586,7 +605,7 @@ INSERT IGNORE INTO t1 SELECT a FROM t1; INSERT IGNORE INTO t1 SELECT a FROM t1; INSERT IGNORE INTO t1 VALUES (1); INSERT IGNORE INTO t1 VALUES (1); -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; a 1 1 @@ -606,4 +625,11 @@ a 1 1 1 +DELETE FROM t1; +CREATE UNIQUE INDEX ai ON t1(a); +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +SELECT * FROM t1 ORDER BY a; +a +1 DROP TABLE t1; diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/r/ndb_replace.result index 6aa1a387661..5e49968ca64 100644 --- a/mysql-test/r/ndb_replace.result +++ b/mysql-test/r/ndb_replace.result @@ -19,3 +19,15 @@ gesuchnr benutzer_id 2 1 3 2 drop table t1; +CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT, +j INT, +k INT, +UNIQUE INDEX(j) +) ENGINE = ndb; +INSERT INTO t1 VALUES (1,1,23),(2,2,24); +REPLACE INTO t1 (j,k) VALUES (1,42); +REPLACE INTO t1 (i,j) VALUES (17,2); +SELECT * from t1 ORDER BY i; +i j k +3 1 42 +17 2 24 diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index 92bc51bcf4f..4fe847058c4 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -591,14 +591,14 @@ DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6; INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b; select * from t1 where pk1 = b and b != c order by pk1; -# The following test case currently does not work -#DELETE FROM t1; -#CREATE UNIQUE INDEX bi ON t1(b); -#INSERT INTO t1 VALUES -#(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), -#(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); -#INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,c=b+10; -#select * from t1 order by pk1; +# Test handling of duplicate unique +DELETE FROM t1; +CREATE UNIQUE INDEX bi ON t1(b); +INSERT INTO t1 VALUES +(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,b=b+10; +select * from t1 order by pk1; DROP TABLE t1; @@ -614,7 +614,12 @@ INSERT IGNORE INTO t1 SELECT a FROM t1; INSERT IGNORE INTO t1 SELECT a FROM t1; INSERT IGNORE INTO t1 VALUES (1); INSERT IGNORE INTO t1 VALUES (1); -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY a; +DELETE FROM t1; +CREATE UNIQUE INDEX ai ON t1(a); +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +SELECT * FROM t1 ORDER BY a; DROP TABLE t1; # End of 4.1 tests diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/t/ndb_replace.test index b97a0322a6a..6cad80ef8ea 100644 --- a/mysql-test/t/ndb_replace.test +++ b/mysql-test/t/ndb_replace.test @@ -27,4 +27,15 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1); select * from t1 order by gesuchnr; drop table t1; +# bug#17431 +CREATE TABLE t1(i INT PRIMARY KEY AUTO_INCREMENT, + j INT, + k INT, + UNIQUE INDEX(j) + ) ENGINE = ndb; +INSERT INTO t1 VALUES (1,1,23),(2,2,24); +REPLACE INTO t1 (j,k) VALUES (1,42); +REPLACE INTO t1 (i,j) VALUES (17,2); +SELECT * from t1 ORDER BY i; + # End of 4.1 tests |