mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
3c93323d28
The patch for WL 1563 added a new duplicate key error message so that the key name could be provided instead of the key number. But the error code for the new message was used even though that did not need to change. This could cause unnecessary problems for applications that used the old ER_DUP_ENTRY error code to detect duplicate key errors.
41 lines
918 B
Text
41 lines
918 B
Text
-- source include/have_ndb.inc
|
|
-- source include/not_embedded.inc
|
|
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
|
|
#
|
|
# Basic test of INSERT in NDB
|
|
#
|
|
|
|
#
|
|
# Create a normal table with primary key
|
|
#
|
|
CREATE TABLE t1 (
|
|
pk1 INT NOT NULL PRIMARY KEY,
|
|
b INT NOT NULL,
|
|
c INT NOT NULL UNIQUE
|
|
) ENGINE=ndbcluster;
|
|
|
|
INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
|
|
UPDATE t1 set b = c;
|
|
select * from t1 order by pk1;
|
|
UPDATE t1 set pk1 = 4 where pk1 = 1;
|
|
select * from t1 order by pk1;
|
|
--error ER_DUP_ENTRY
|
|
UPDATE t1 set pk1 = 4 where pk1 = 2;
|
|
UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
|
|
select * from t1 order by pk1;
|
|
--error ER_DUP_ENTRY
|
|
UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
|
|
UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
|
|
select * from t1 order by pk1;
|
|
UPDATE t1 set pk1 = pk1 + 10;
|
|
select * from t1 order by pk1;
|
|
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
|
|
# End of 4.1 tests
|