Commit 56bd4b06 authored by Zardosht Kasheff's avatar Zardosht Kasheff

[t:4633], add test

git-svn-id: file:///svn/mysql/tests/mysql-test@41222 c7de825b-a66e-492c-adef-691d508d4ae1
parent 39d40992
SET STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(c1 TINYINT NOT NULL, c2 TINYINT NULL, c3 TINYINT NULL, PRIMARY KEY (c1), UNIQUE (c2)) engine=TokuDB;
INSERT INTO t1 (c1,c2,c3) VALUES(10,14,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,90,10);
INSERT INTO t1 (c1,c2,c3) VALUES(12,120,10);
INSERT INTO t1 (c1,c2,c3) VALUES(13,110,10);
INSERT INTO t1 (c1,c2,c3) VALUES(14,10,10);
select * from t1;
c1 c2 c3
10 14 10
11 90 10
12 120 10
13 110 10
14 10 10
INSERT INTO t1 (c1,c2,c3) VALUES(10,10,10) ON DUPLICATE KEY UPDATE c3=100;
select * from t1;
c1 c2 c3
10 14 100
11 90 10
12 120 10
13 110 10
14 10 10
INSERT INTO t1 (c1,c2,c3) VALUES(120,120,120) ON DUPLICATE KEY UPDATE c3=100;
select * from t1;
c1 c2 c3
10 14 100
11 90 10
12 120 100
13 110 10
14 10 10
INSERT INTO t1 (c1,c2,c3) VALUES(13,13,13) ON DUPLICATE KEY UPDATE c3=100;
select * from t1;
c1 c2 c3
10 14 100
11 90 10
12 120 100
13 110 100
14 10 10
DROP TABLE t1;
--source include/have_tokudb.inc
#
# Record inconsistency.
#
#
SET STORAGE_ENGINE = 'tokudb';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1(c1 TINYINT NOT NULL, c2 TINYINT NULL, c3 TINYINT NULL, PRIMARY KEY (c1), UNIQUE (c2)) engine=TokuDB;
INSERT INTO t1 (c1,c2,c3) VALUES(10,14,10);
INSERT INTO t1 (c1,c2,c3) VALUES(11,90,10);
INSERT INTO t1 (c1,c2,c3) VALUES(12,120,10);
INSERT INTO t1 (c1,c2,c3) VALUES(13,110,10);
INSERT INTO t1 (c1,c2,c3) VALUES(14,10,10);
select * from t1;
INSERT INTO t1 (c1,c2,c3) VALUES(10,10,10) ON DUPLICATE KEY UPDATE c3=100;
select * from t1;
INSERT INTO t1 (c1,c2,c3) VALUES(120,120,120) ON DUPLICATE KEY UPDATE c3=100;
select * from t1;
INSERT INTO t1 (c1,c2,c3) VALUES(13,13,13) ON DUPLICATE KEY UPDATE c3=100;
select * from t1;
# Final cleanup.
DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment