2004-11-28 22:28:36 +01:00
|
|
|
-- source include/have_ndb.inc
|
2005-04-19 17:23:49 +02:00
|
|
|
-- source include/not_embedded.inc
|
2004-11-28 22:28:36 +01:00
|
|
|
|
|
|
|
--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,
|
2005-04-19 11:21:26 +02:00
|
|
|
c INT NOT NULL UNIQUE
|
2004-11-28 22:28:36 +01:00
|
|
|
) ENGINE=ndbcluster;
|
|
|
|
|
2005-04-19 11:21:26 +02:00
|
|
|
INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
|
2004-11-28 22:28:36 +01:00
|
|
|
UPDATE t1 set b = c;
|
|
|
|
select * from t1 order by pk1;
|
2005-04-19 11:21:26 +02:00
|
|
|
UPDATE t1 set pk1 = 4 where pk1 = 1;
|
|
|
|
select * from t1 order by pk1;
|
|
|
|
-- error 1062
|
|
|
|
UPDATE 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
|
2005-07-28 02:22:47 +02:00
|
|
|
|
|
|
|
# End of 4.1 tests
|