Below is the list of changes that have just been committed into a local
4.1 repository of acurtis. When acurtis does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2195 05/04/18 23:17:35 acurtis@stripped +3 -0
Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update"
INSERT IGNORE...UPDATE causes break in protocol or unknown error message.
Fix so that protocol doesn't break by properly ignoring dups.
sql/sql_insert.cc
1.156 05/04/18 23:17:22 acurtis@stripped +4 -0
Ignore the failure in update_row when IGNORE is set.
mysql-test/t/insert_update.test
1.12 05/04/18 23:17:22 acurtis@stripped +12 -0
Test for Bug#9725
mysql-test/r/insert_update.result
1.12 05/04/18 23:17:22 acurtis@stripped +13 -0
Test for Bug#9725
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: acurtis
# Host: ltantony.xiphis.org
# Root: /.amd_mnt/bk.anubis/host/work-acurtis/bug9725
--- 1.155/sql/sql_insert.cc 2005-02-28 09:59:41 +00:00
+++ 1.156/sql/sql_insert.cc 2005-04-18 23:17:22 +01:00
@@ -559,7 +559,11 @@
if (fill_record(*info->update_fields, *info->update_values, 0))
goto err;
if
((error=table->file->update_row(table->record[1],table->record[0])))
+ {
+ if ((error == HA_ERR_FOUND_DUPP_KEY) && info->ignore)
+ break;
goto err;
+ }
info->updated++;
break;
}
--- 1.11/mysql-test/r/insert_update.result 2005-02-17 01:33:45 +00:00
+++ 1.12/mysql-test/r/insert_update.result 2005-04-18 23:17:22 +01:00
@@ -167,3 +167,16 @@
2 1 11 NULL
DROP TABLE t1;
DROP TABLE t2;
+create table t1 (a int not null unique);
+insert into t1 values (1),(2);
+insert ignore into t1 select 1 on duplicate key update a=2;
+select * from t1;
+a
+1
+2
+insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
+select * from t1;
+a
+1
+3
+drop table t1;
--- 1.11/mysql-test/t/insert_update.test 2005-02-17 01:33:46 +00:00
+++ 1.12/mysql-test/t/insert_update.test 2005-04-18 23:17:22 +01:00
@@ -80,3 +80,15 @@
SELECT *, VALUES(a) FROM t1;
DROP TABLE t1;
DROP TABLE t2;
+
+#
+# Bug#9725 - "disapearing query/hang" and "unknown error" with "on duplicate key update"
+# INSERT INGORE...UPDATE gives bad error or breaks protocol.
+#
+create table t1 (a int not null unique);
+insert into t1 values (1),(2);
+insert ignore into t1 select 1 on duplicate key update a=2;
+select * from t1;
+insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
+select * from t1;
+drop table t1;
| Thread |
|---|
| • bk commit into 4.1 tree (acurtis:1.2195) BUG#9725 | antony | 19 Apr |