mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
1f6ecc0cd3
Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names. changed store_warning() -> push_warning_print()
24 lines
805 B
Text
24 lines
805 B
Text
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
|
|
CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B));
|
|
INSERT t1 VALUES (1,2,10), (3,4,20);
|
|
INSERT t1 VALUES (5,6,30) ON DUPLICATE KEY UPDATE c=c+100;
|
|
SELECT * FROM t1;
|
|
INSERT t1 VALUES (5,7,40) ON DUPLICATE KEY UPDATE c=c+100;
|
|
SELECT * FROM t1;
|
|
INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000;
|
|
SELECT * FROM t1;
|
|
INSERT t1 VALUES (1,4,60) ON DUPLICATE KEY UPDATE c=c+10000;
|
|
SELECT * FROM t1;
|
|
-- error 1062
|
|
INSERT t1 VALUES (1,9,70) ON DUPLICATE KEY UPDATE c=c+100000, b=4;
|
|
SELECT * FROM t1;
|
|
TRUNCATE TABLE t1;
|
|
INSERT t1 VALUES (1,2,10), (3,4,20);
|
|
INSERT t1 VALUES (5,6,30), (7,4,40), (8,9,60) ON DUPLICATE KEY UPDATE c=c+100;
|
|
SELECT * FROM t1;
|
|
INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
|
|
SELECT * FROM t1;
|
|
DROP TABLE t1;
|