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/t/insert_update.test | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'mysql-test/t/insert_update.test') diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 550bce867cd..d2a70208022 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -26,3 +26,25 @@ SELECT *, VALUES(a) FROM t1; explain extended SELECT *, VALUES(a) FROM t1; explain extended select * from t1 where values(a); DROP TABLE t1; + +# +# test for Bug #2709 "Affected Rows for ON DUPL.KEY undocumented, +# perhaps illogical" +# +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; + +enable_info; +insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18) + on duplicate key update b=b+10; +disable_info; + +select * from t1; + +enable_info; +replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29); +disable_info; + +select * from t1; +drop table t1; -- cgit v1.2.1