From fdb4d307ab8c7639ced6e08c61528bfe81823fae Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 7 Aug 2005 03:16:15 +0100 Subject: Bug#10109 "INSERT .. SELECT ... ON DUPLICATE KEY UPDATE fails" Ensure that check_insert_fields() is only called once when doing an INSERT..SELECT mysql-test/r/insert_update.result: Test for bug 10109 mysql-test/t/insert_update.test: Test for bug 10109 sql/sql_class.h: select_insert needs more state sql/sql_insert.cc: ensure that check_insert_fields() is only called once when doing an INSERT...SELECT sql/sql_parse.cc: more args for select_insert constructor --- mysql-test/t/insert_update.test | 14 ++++++++++++++ 1 file changed, 14 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 d0e75f0fa2a..8038bd7bfe7 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -101,4 +101,18 @@ insert into t1 select a from t1 on duplicate key update a=a+1 ; insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ; drop table t1; +# +# Bug#10109 - INSERT .. SELECT ... ON DUPLICATE KEY UPDATE fails +# Bogus "Duplicate columns" error message +# + +CREATE TABLE t1 ( + a BIGINT(20) NOT NULL DEFAULT 0, + PRIMARY KEY (a) +) ENGINE=MyISAM; + +INSERT INTO t1 ( a ) SELECT 0 ON DUPLICATE KEY UPDATE a = a + VALUES (a) ; + +DROP TABLE t1; + # End of 4.1 tests -- cgit v1.2.1