mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
f9c8d1dd7f
into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge mysql-test/t/innodb.test: Auto merged mysql-test/t/ndb_basic.test: Auto merged mysql-test/t/ndb_charset.test: Auto merged mysql-test/t/ndb_index_unique.test: Auto merged mysql-test/t/ndb_insert.test: Auto merged mysql-test/t/ndb_replace.test: Auto merged mysql-test/t/ndb_update.test: Auto merged mysql-test/t/rpl_000015.test: Auto merged mysql-test/t/rpl_rotate_logs.test: Auto merged mysql-test/t/rpl_row_inexist_tbl.test: Auto merged sql/Makefile.am: Auto merged BitKeeper/deleted/.del-ndb_binlog_basic2.test: Auto merged sql/field.cc: Auto merged sql/handler.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged sql/item_create.cc: Manual merge
42 lines
963 B
Text
42 lines
963 B
Text
-- source include/have_ndb.inc
|
|
-- source include/have_binlog_format_row.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
|