Loading mysql-test/r/ndb_insert.result +27 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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 Loading @@ -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; mysql-test/r/ndb_replace.result +12 −0 Original line number Diff line number Diff line Loading @@ -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 mysql-test/t/ndb_insert.test +14 −9 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 mysql-test/t/ndb_replace.test +11 −0 Original line number Diff line number Diff line Loading @@ -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 ndb/include/ndbapi/NdbIndexOperation.hpp +5 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,11 @@ public: */ int deleteTuple(); /** * Get index object for this operation */ const NdbDictionary::Index * getIndex() const; #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** * Define the NdbIndexOperation to be a standard operation of type Loading Loading
mysql-test/r/ndb_insert.result +27 −1 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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 Loading @@ -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;
mysql-test/r/ndb_replace.result +12 −0 Original line number Diff line number Diff line Loading @@ -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
mysql-test/t/ndb_insert.test +14 −9 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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
mysql-test/t/ndb_replace.test +11 −0 Original line number Diff line number Diff line Loading @@ -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
ndb/include/ndbapi/NdbIndexOperation.hpp +5 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,11 @@ public: */ int deleteTuple(); /** * Get index object for this operation */ const NdbDictionary::Index * getIndex() const; #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** * Define the NdbIndexOperation to be a standard operation of type Loading