summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2004-10-21 08:49:57 +0300
committerunknown <jan@hundin.mysql.fi>2004-10-21 08:49:57 +0300
commit433aec148f687712f324a2b9443d577c23d8c598 (patch)
tree4a3cc1564bd75bba945c737108ed1dde6e6b6bcf /sql/ha_innodb.cc
parentffd77c4679615ba3e4dd7614dadc735af5d4aa9c (diff)
parentc144e1a23c7255bff6daddcdac705c2ec80ed08f (diff)
downloadmariadb-git-433aec148f687712f324a2b9443d577c23d8c598.tar.gz
Merge jlindstrom@bk-internal.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/jan/talle/mysql-4.1 sql/ha_innodb.cc: Auto merged
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 04a1c6a9014..c87d1c4b6cc 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2461,9 +2461,10 @@ ha_innobase::write_row(
/* If the insert did not succeed we restore the value of
the auto-inc counter we used; note that this behavior was
introduced only in version 4.0.4.
- NOTE that a REPLACE command handles a duplicate key error
+ NOTE that a REPLACE command and LOAD DATA INFILE REPLACE
+ handles a duplicate key error
itself, and we must not decrement the autoinc counter
- if we are performing a REPLACE statement.
+ if we are performing a those statements.
NOTE 2: if there was an error, for example a deadlock,
which caused InnoDB to roll back the whole transaction
already in the call of row_insert_for_mysql(), we may no
@@ -2475,7 +2476,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;
}
@@ -5501,6 +5504,7 @@ innobase_query_is_replace(void)
thd = (THD *)innobase_current_thd();
if ( thd->lex->sql_command == SQLCOM_REPLACE ||
+ thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
( thd->lex->sql_command == SQLCOM_LOAD &&
thd->lex->duplicates == DUP_REPLACE )) {
return true;