From 1d3b16335a824df832bb94c447248cef925bdfaf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Mar 2004 21:36:16 +0400 Subject: actions for bug #2709 Affected Rows for ON DUPL. KEY undocumented, perheps illogical 1. added COPY_INFO::updated to work with it in 'insert .. on duplicate' instead of COPY_INFO::deleted 2. added affected rows to output of "info:" in mysqltest.c client/mysqltest.c: added "affected rows" to output of "info : ".. mysql-test/r/insert_update.result: added tests for affected rows with insert .. duplicate (bug #2709) mysql-test/t/insert_update.test: added tests for affected rows with insert .. duplicate (bug #2709) sql/sql_class.h: added COPY_INFO::updated sql/sql_insert.cc: get write_record to work with COPY_INFO::updated instead of COPY_INFO::deleted for 'insert ... duplicate' statement --- mysql-test/r/insert_update.result | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'mysql-test/r/insert_update.result') diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 3a7679ce1e3..53867bf4546 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -67,3 +67,41 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1 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); +select * from t1; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18) +on duplicate key update b=b+10; +affected rows: 7 +info: Records: 5 Duplicates: 2 Warnings: 0 +select * from t1; +a b +1 1 +2 2 +3 3 +4 14 +5 15 +6 16 +7 17 +8 18 +replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29); +affected rows: 9 +info: Records: 5 Duplicates: 4 Warnings: 0 +select * from t1; +a b +1 1 +2 2 +3 3 +4 14 +5 25 +6 26 +7 27 +8 28 +9 29 +drop table t1; -- cgit v1.2.1