Below is the list of changes that have just been committed into a local
4.1 repository of evgen. When evgen 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.2293 05/06/16 00:11:21 evgen@stripped +3 -0
Fix bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE produces bad results
Have to restore default values after update ON DUPLICATE KEY
mysql-test/r/insert_select.result
1.25 05/06/16 00:10:28 evgen@stripped +13 -0
Test case for bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
produces bad results
mysql-test/t/insert_select.test
1.18 05/06/16 00:09:48 evgen@stripped +11 -0
Test case for bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY
UPDATE produces bad results
sql/sql_insert.cc
1.167 05/06/16 00:04:14 evgen@stripped +4 -0
Fix bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE produces bad results
# 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: evgen
# Host: moonbone.local
# Root: /work/mysql-4.1-bug-10886
--- 1.166/sql/sql_insert.cc 2005-06-04 09:23:30 +04:00
+++ 1.167/sql/sql_insert.cc 2005-06-16 00:04:14 +04:00
@@ -1625,6 +1625,10 @@
store_values(values);
error=thd->net.report_error || write_record(table,&info);
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
+
+ if (info.handle_duplicates == DUP_UPDATE)
+ restore_record(table, default_values);
+
if (!error && table->next_number_field) // Clear for next record
{
table->next_number_field->reset();
--- 1.24/mysql-test/r/insert_select.result 2005-03-31 05:32:40 +04:00
+++ 1.25/mysql-test/r/insert_select.result 2005-06-16 00:10:28 +04:00
@@ -625,3 +625,16 @@
ID NO SEQ
1 1 1
drop table t1;
+drop table if exists t1, t2;
+Warnings:
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
+create table t1 (f1 int);
+create table t2 (ff1 int unique, ff2 int default 1);
+insert into t1 values (1),(1),(2);
+insert into t2(ff1) select f1 from t1 on duplicate key update ff2=ff2+1;
+select * from t2;
+ff1 ff2
+1 2
+2 1
+drop table t1, t2;
--- 1.17/mysql-test/t/insert_select.test 2005-03-31 05:32:41 +04:00
+++ 1.18/mysql-test/t/insert_select.test 2005-06-16 00:09:48 +04:00
@@ -166,3 +166,14 @@
select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
drop table t1;
+#
+# Bug#10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE produces bad results
+#
+
+drop table if exists t1, t2;
+create table t1 (f1 int);
+create table t2 (ff1 int unique, ff2 int default 1);
+insert into t1 values (1),(1),(2);
+insert into t2(ff1) select f1 from t1 on duplicate key update ff2=ff2+1;
+select * from t2;
+drop table t1, t2;
| Thread |
|---|
| • bk commit into 4.1 tree (evgen:1.2293) BUG#10886 | eugene | 15 Jun |