mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
a043cd152d
into mysql.com:/home/my/mysql-5.1 BUILD/SETUP.sh: Auto merged mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Auto merged mysql-test/extra/rpl_tests/rpl_row_basic.test: Auto merged mysql-test/include/mix1.inc: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/ctype_utf8.test: Auto merged mysql-test/t/delayed.test: Auto merged mysql-test/t/innodb.test: Auto merged mysql-test/t/insert_select.test: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/ndb_index_unique.test: Auto merged mysql-test/t/rpl_row_create_table.test: Auto merged mysql-test/t/rpl_sp.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/type_binary.test: Auto merged mysql-test/t/type_varchar.test: Auto merged mysql-test/t/view.test: Auto merged sql/handler.cc: Auto merged sql/sql_table.cc: Auto merged mysql-test/r/rpl_sp.result: Manual merge mysql-test/t/ndb_update.test: Manual merge sql/share/errmsg.txt: Manual merge
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
|