mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
7df1dbcd74
into mysql.com:/home/my/mysql-5.1
41 lines
946 B
Text
41 lines
946 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_WITH_KEY_NAME
|
|
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_WITH_KEY_NAME
|
|
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
|