From 22269d451af650f887a7679ba6fffe7577d1c007 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Tue, 2 Nov 2004 13:21:11 +0200 Subject: [PATCH] ha_innodb.cc: Backport Jan's fix of the LOAD DATA INFILE REPLACE duplicate key error bug (Bug #5835) to 4.0 --- sql/ha_innodb.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index e747ff3210c..d57a9f73c91 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2285,7 +2285,9 @@ ha_innobase::write_row( if (error == DB_DUPLICATE_KEY && (user_thd->lex.sql_command == SQLCOM_REPLACE || user_thd->lex.sql_command - == SQLCOM_REPLACE_SELECT)) { + == SQLCOM_REPLACE_SELECT + || (user_thd->lex.sql_command == SQLCOM_LOAD + && user_thd->lex.duplicates == DUP_REPLACE))) { skip_auto_inc_decr= TRUE; }