From 85de222334f89a95bb60554b537d84c3bdc5a627 Mon Sep 17 00:00:00 2001 From: "monty@narttu.mysql.fi" <> Date: Tue, 18 Mar 2003 02:51:16 +0200 Subject: Fix of 'halloween bug' with UPDATE of InnoDB tables. --- mysql-test/r/innodb.result | 10 ++++++++++ mysql-test/t/innodb.test | 11 +++++++++++ 2 files changed, 21 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 0930e3aa5fd..06663e36007 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -501,3 +501,13 @@ table type possible_keys key key_len ref rows Extra t1 ALL NULL NULL NULL NULL 4 Field Type Null Key Default Extra testint int(11) 1 +a b +1 1 +102 2 +103 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index a962f120d4e..0362ec69ebf 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -537,3 +537,14 @@ drop table t1; create table t1 (testint int not null default 1) type=innodb; desc t1; drop table t1; + +# +# Check update with conflicting key +# + +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) type=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +# We need the a < 1000 test here to quard against the halloween problems +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +drop table t1; -- cgit v1.2.1