mirror of
https://github.com/MariaDB/server.git
synced 2026-04-28 03:05:33 +02:00
Fix bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE produces bad results
Temporary field wasn't restored to default values after ON DUPLICATE KEY UPDATE event, which results in wrong data being inserted in new record. sql/sql_insert.cc: Fix bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE produces bad results mysql-test/t/insert_select.test: Test case for bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE produces bad results mysql-test/r/insert_select.result: Test case for bug #10886 - INSERT ... SELECT ... ON DUPLICATE KEY UPDATE produces bad results
This commit is contained in:
parent
c7a681ff94
commit
8e45c0572b
3 changed files with 33 additions and 4 deletions
|
|
@ -625,3 +625,12 @@ select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
|
|||
ID NO SEQ
|
||||
1 1 1
|
||||
drop table t1;
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue