diff options
author | unknown <holyfoot/hf@hfmain.(none)> | 2007-05-11 17:48:20 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@hfmain.(none)> | 2007-05-11 17:48:20 +0500 |
commit | 62db8d6db5366850691e7c5ead13417c55f7271f (patch) | |
tree | b0d602acfe8228c733fde1a7ca89a2425a65fd9f /mysql-test/t/insert_update.test | |
parent | f4ded1f2a1983f36b928265537c1e8c9867b8add (diff) | |
parent | 563b1297bbeef6f162513be314676d0d2c39b4a9 (diff) | |
download | mariadb-git-62db8d6db5366850691e7c5ead13417c55f7271f.tar.gz |
Merge mysql.com:/home/hf/work/27957/my50-27957
into mysql.com:/home/hf/work/27957/my51-27957
mysql-test/r/insert_update.result:
Auto merged
mysql-test/t/insert_update.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
mysql-test/include/mix1.inc:
merging
mysql-test/r/innodb_mysql.result:
SCCS merged
sql/sql_select.cc:
merging
Diffstat (limited to 'mysql-test/t/insert_update.test')
-rw-r--r-- | mysql-test/t/insert_update.test | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index de4e73dca93..ff6ddf35c7b 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -264,3 +264,29 @@ INSERT INTO t1 (c1) VALUES ('A'), ('X'), ('Y'), ('Z') ON DUPLICATE KEY UPDATE cnt=cnt+1; SELECT * FROM t1; DROP TABLE t1; + +# +# Bug#28000: INSERT IGNORE ... SELECT ... ON DUPLICATE +# with erroneous UPDATE: NOT NULL field with NULL value. +# +CREATE TABLE t1 ( + id INT AUTO_INCREMENT PRIMARY KEY, + c1 INT NOT NULL, + cnt INT DEFAULT 1 +); +INSERT INTO t1 (id,c1) VALUES (1,10); +SELECT * FROM t1; +CREATE TABLE t2 (id INT, c1 INT); +INSERT INTO t2 VALUES (1,NULL), (2,2); +--error 1048 +INSERT INTO t1 (id,c1) SELECT 1,NULL + ON DUPLICATE KEY UPDATE c1=NULL; +SELECT * FROM t1; +INSERT IGNORE INTO t1 (id,c1) SELECT 1,NULL + ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1; +SELECT * FROM t1; +INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2 + ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1; +SELECT * FROM t1; + +DROP TABLE t1; |