diff options
author | unknown <magnus@neptunus.(none)> | 2004-09-15 14:44:21 +0200 |
---|---|---|
committer | unknown <magnus@neptunus.(none)> | 2004-09-15 14:44:21 +0200 |
commit | 38238355c2acb7c64a653db2756856475dc04026 (patch) | |
tree | 2331b117f11c8582f32a66f627692c3a43d91eb6 /mysql-test/r/ndb_insert.result | |
parent | 373f1b701489e6932572cac205ef7bf14c0a0467 (diff) | |
download | mariadb-git-38238355c2acb7c64a653db2756856475dc04026.tar.gz |
BUG#4775 "Duplicate key requires rollback of transaction" - Improved error message telling that transaction is aborted
BUG#4312 "wrong behaviour on insert .. on duplicate key" functionality disabled
mysql-test/r/ndb_insert.result:
New tests for fduplicate inserts in combination with transaction
New tests for INSERT IGNORE and REPLACE
mysql-test/t/ndb_insert.test:
New tests for fduplicate inserts in combination with transaction
New tests for INSERT IGNORE and REPLACE
ndb/src/ndbapi/NdbConnection.cpp:
Return error 4350 "Transaction already aborted" if execute(Commit) is called when theCommitStatus==Aborted
Add DBUG_PRINT's
ndb/src/ndbapi/ndberror.c:
Add new error message indicating that the transaction already has been aborted.
sql/ha_ndbcluster.cc:
Map all error code 0 to 1 in order to catch errors caused by NdbApi returning -1 without having set an error code.
Use ndb object in THD in get_error_message
BUG# 4312 Return HA_ERR_WRONG_COMMAND if extra(HA_EXTRA_IGNORE_DUP_KEY) is called
Only use writeTuple if command is REPLACE
sql/ha_ndbcluster.h:
Added member variable to keep track of when HA_EXTRA_IGNORE_DUP_KEY is used, but NDB can't support it.
Diffstat (limited to 'mysql-test/r/ndb_insert.result')
-rw-r--r-- | mysql-test/r/ndb_insert.result | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index 87f27518ea3..179be627384 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -420,12 +420,130 @@ 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); ERROR 23000: Duplicate entry '10' for key 1 +select count(*) from t1; +count(*) +2000 begin; 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); ERROR 23000: Duplicate entry '10' for key 1 commit; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +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); +ERROR 23000: Duplicate entry '10' for key 1 +rollback; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +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); +ERROR 23000: Duplicate entry '10' for key 1 +SELECT * FROM t1 WHERE pk1=10; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +rollback; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +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); +ERROR 23000: Duplicate entry '10' for key 1 +SELECT * FROM t1 WHERE pk1=10; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +SELECT * FROM t1 WHERE pk1=10; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +commit; +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 +begin; +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); +ERROR 23000: Duplicate entry '10' for key 1 +INSERT INTO t1 values (4000, 40, 44); +ERROR HY000: Got error 4350 'Transaction already aborted' from ndbcluster +rollback; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +select * from t1 where pk1=10; +pk1 b c +10 10 10 +select count(*) from t1 where pk1 <= 10 order by pk1; +count(*) +11 +select count(*) from t1; +count(*) +2000 insert into t1 select * from t1 where b < 10 order by pk1; ERROR 23000: Duplicate entry '9' for key 1 +begin; +INSERT IGNORE INTO t1 VALUES(1,2,3); +ERROR HY000: Table storage engine for 't1' doesn't have this option +commit; +select * from t1 where pk1=1; +pk1 b c +1 1 1 +INSERT IGNORE INTO t1 VALUES(1,2,3); +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1 where pk1=1; +pk1 b c +1 1 1 +REPLACE INTO t1 values(1, 2, 3); +select * from t1 where pk1=1; +pk1 b c +1 2 3 +INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; +ERROR HY000: Table storage engine for 't1' doesn't have this option +select * from t1 where pk1=1; +pk1 b c +1 2 3 DROP TABLE t1; |