mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Fix for INSERT with multiple values and start/end_bulk_insert
mysql-test/r/ndb_insert.result: Add tests for duplicate keys in combination with start/end_bulk_insert mysql-test/t/ndb_insert.test: Add tests for duplicate keys in combination with start/end_bulk_insert sql/ha_ndbcluster.cc: Set my_errno if error occurs in end_bulk_insert
This commit is contained in:
parent
af46c9c3b6
commit
235c5035b5
3 changed files with 42 additions and 1 deletions
|
@ -416,4 +416,16 @@ INSERT INTO t1 VALUES
|
|||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
2000
|
||||
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
|
||||
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;
|
||||
insert into t1 select * from t1 where b < 10 order by pk1;
|
||||
ERROR 23000: Duplicate entry '9' for key 1
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -429,5 +429,34 @@ INSERT INTO t1 VALUES
|
|||
SELECT COUNT(*) FROM t1;
|
||||
|
||||
|
||||
#
|
||||
# Insert duplicate rows
|
||||
#
|
||||
--error 1062
|
||||
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);
|
||||
|
||||
|
||||
|
||||
begin;
|
||||
|
||||
#
|
||||
# Insert duplicate rows, inside transaction
|
||||
#
|
||||
--error 1062
|
||||
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);
|
||||
|
||||
commit;
|
||||
|
||||
#
|
||||
# Insert duplicate rows using "insert .. select"
|
||||
|
||||
#
|
||||
--error 1062
|
||||
insert into t1 select * from t1 where b < 10 order by pk1;
|
||||
|
||||
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -2401,7 +2401,7 @@ int ha_ndbcluster::end_bulk_insert()
|
|||
rows_inserted, bulk_insert_rows));
|
||||
bulk_insert_not_flushed= false;
|
||||
if (trans->execute(NoCommit) != 0)
|
||||
error= ndb_err(trans);
|
||||
my_errno= error= ndb_err(trans);
|
||||
}
|
||||
|
||||
rows_inserted= 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue