mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
0004600074
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1 mysql-test/r/ndb_update.result: Auto merged storage/ndb/src/common/util/socket_io.cpp: Auto merged
41 lines
802 B
Text
41 lines
802 B
Text
DROP TABLE IF EXISTS t1;
|
|
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;
|
|
pk1 b c
|
|
0 0 0
|
|
1 1 1
|
|
2 2 2
|
|
UPDATE t1 set pk1 = 4 where pk1 = 1;
|
|
select * from t1 order by pk1;
|
|
pk1 b c
|
|
0 0 0
|
|
2 2 2
|
|
4 1 1
|
|
UPDATE t1 set pk1 = 4 where pk1 = 2;
|
|
ERROR 23000: Duplicate entry '4' for key 1
|
|
UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
|
|
select * from t1 order by pk1;
|
|
pk1 b c
|
|
0 0 0
|
|
2 2 2
|
|
4 1 1
|
|
UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
|
|
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
|
|
select * from t1 order by pk1;
|
|
pk1 b c
|
|
0 0 0
|
|
2 2 2
|
|
4 1 1
|
|
UPDATE t1 set pk1 = pk1 + 10;
|
|
select * from t1 order by pk1;
|
|
pk1 b c
|
|
10 0 0
|
|
12 2 2
|
|
14 1 1
|
|
DROP TABLE IF EXISTS t1;
|