summaryrefslogtreecommitdiff
path: root/mysql-test/r/insert_update.result
diff options
context:
space:
mode:
authorunknown <ibabaev@bk-internal.mysql.com>2007-05-12 23:42:36 +0200
committerunknown <ibabaev@bk-internal.mysql.com>2007-05-12 23:42:36 +0200
commitde34385a565a07536f314813e02f63aec1d0f369 (patch)
tree59d9e31c78caca8be26a8746fa5e83ac54aabb1a /mysql-test/r/insert_update.result
parent0f6e518a3ba975d84ef192ee295bf330368855b3 (diff)
parent3d501aece0f68183d0a74aa37d0938ccd91733ac (diff)
downloadmariadb-git-clone-5.0.42-build.tar.gz
Merge bk-internal.mysql.com:/data0/bk/mysql-5.0clone-5.0.42-build
into bk-internal.mysql.com:/data0/bk/mysql-5.0-opt
Diffstat (limited to 'mysql-test/r/insert_update.result')
-rw-r--r--mysql-test/r/insert_update.result35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index 4a3e87d9d48..375961292a3 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -358,3 +358,38 @@ id c1 cnt
5 Y 1
6 Z 1
DROP TABLE t1;
+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;
+id c1 cnt
+1 10 1
+CREATE TABLE t2 (id INT, c1 INT);
+INSERT INTO t2 VALUES (1,NULL), (2,2);
+INSERT INTO t1 (id,c1) SELECT 1,NULL
+ON DUPLICATE KEY UPDATE c1=NULL;
+ERROR 23000: Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 10 1
+INSERT IGNORE INTO t1 (id,c1) SELECT 1,NULL
+ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+Warnings:
+Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c1' at row 1
+Error 1048 Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 0 2
+INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
+ON DUPLICATE KEY UPDATE c1=NULL, cnt=cnt+1;
+Warnings:
+Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c1' at row 1
+Error 1048 Column 'c1' cannot be null
+SELECT * FROM t1;
+id c1 cnt
+1 0 3
+2 2 1
+DROP TABLE t1;