--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1(c1 DATE NULL, c2 DATE NULL, c3 DATE NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01');
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01');
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 YEAR NULL, c2 YEAR NULL, c3 YEAR NULL, UNIQUE(c1,c2,c3));
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999) ON DUPLICATE KEY UPDATE c1=2011,c2=2011,c3=2011;
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000) ON DUPLICATE KEY UPDATE c1=2011,c2=2011;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL, c3 TIME NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01');
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01');
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 YEAR NULL, c2 YEAR NULL, c3 YEAR NULL, UNIQUE(c1,c2,c3));
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999) ON DUPLICATE KEY UPDATE c1=2011,c2=2011,c3=2011;
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000) ON DUPLICATE KEY UPDATE c1=2011,c2=2011;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 DATETIME NULL, c2 DATETIME NULL, c3 DATETIME NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01');
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01');
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 YEAR NULL, c2 YEAR NULL, c3 YEAR NULL, UNIQUE(c1,c2,c3));
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999) ON DUPLICATE KEY UPDATE c1=2011,c2=2011,c3=2011;
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000) ON DUPLICATE KEY UPDATE c1=2011,c2=2011;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 TIMESTAMP NULL, c2 TIMESTAMP NULL, c3 TIMESTAMP NULL, UNIQUE(c1,c2,c3));
SET TIMESTAMP=1171346973; # 2007-02-13 15:09:33
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01'));
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'1 01:01:01'),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),NOW(),NOW());
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01'),c3=ADDTIME(NOW(),'2 02:01:01');
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),ADDTIME(NOW(),'1 01:01:01')) ON DUPLICATE KEY UPDATE c1=ADDTIME(NOW(),'2 02:01:01'),c2=ADDTIME(NOW(),'2 02:01:01');
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 YEAR NULL, c2 YEAR NULL, c3 YEAR NULL, UNIQUE(c1,c2,c3));
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,2000,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(2000,1999,1999);
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,1999) ON DUPLICATE KEY UPDATE c1=2011,c2=2011,c3=2011;
INSERT INTO t1 (c1,c2,c3) VALUES(1999,1999,2000) ON DUPLICATE KEY UPDATE c1=2011,c2=2011;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;

