summaryrefslogtreecommitdiff
path: root/mysql-test/r/insert_update.result
diff options
context:
space:
mode:
authorunknown <gkodinov@dl145s.mysql.com>2006-09-15 14:14:38 +0200
committerunknown <gkodinov@dl145s.mysql.com>2006-09-15 14:14:38 +0200
commitc97cc113921a74ed2e2450045e57b5ddfb969351 (patch)
treec06f430053b575c0cd47f1bd8c68cf1146aedef3 /mysql-test/r/insert_update.result
parente4b044060ca806c3c6a78bc7fc89acf3641f62ad (diff)
parent341cc55ab6c3c04c92a40354153668d8e6f32d7e (diff)
downloadmariadb-git-c97cc113921a74ed2e2450045e57b5ddfb969351.tar.gz
Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-opt
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt mysql-test/r/query_cache.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/insert_update.test: Auto merged sql/item.h: Auto merged sql/log.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'mysql-test/r/insert_update.result')
-rw-r--r--mysql-test/r/insert_update.result26
1 files changed, 24 insertions, 2 deletions
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index dbe5d600a95..6be37450835 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -63,9 +63,9 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,values(`test`.`t1`.`a`) AS `VALUES(a)` from `test`.`t1`
explain extended select * from t1 where values(a);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1`
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where values(`test`.`t1`.`a`)
DROP TABLE t1;
create table t1(a int primary key, b int);
insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
@@ -197,3 +197,25 @@ PRIMARY KEY (a)
) ENGINE=MyISAM;
INSERT INTO t1 ( a ) SELECT 0 ON DUPLICATE KEY UPDATE a = a + VALUES (a) ;
DROP TABLE t1;
+CREATE TABLE t1
+(
+a BIGINT UNSIGNED,
+b BIGINT UNSIGNED,
+PRIMARY KEY (a)
+);
+INSERT INTO t1 VALUES (45, 1) ON DUPLICATE KEY UPDATE b =
+IF(VALUES(b) > t1.b, VALUES(b), t1.b);
+SELECT * FROM t1;
+a b
+45 1
+INSERT INTO t1 VALUES (45, 2) ON DUPLICATE KEY UPDATE b =
+IF(VALUES(b) > t1.b, VALUES(b), t1.b);
+SELECT * FROM t1;
+a b
+45 2
+INSERT INTO t1 VALUES (45, 1) ON DUPLICATE KEY UPDATE b =
+IF(VALUES(b) > t1.b, VALUES(b), t1.b);
+SELECT * FROM t1;
+a b
+45 2
+DROP TABLE t1;