summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-01-29 02:19:00 +0200
committerunknown <heikki@hundin.mysql.fi>2003-01-29 02:19:00 +0200
commit6dc436fa86ed69a5c0a9fcb3f831ae45a091505b (patch)
tree258de9ea2b3a94dc979e1a7f8e55af0d119a668a /sql/ha_innodb.cc
parent25aa3098be426882d6abd402ee78a0ecc665bb57 (diff)
downloadmariadb-git-6dc436fa86ed69a5c0a9fcb3f831ae45a091505b.tar.gz
ha_innodb.cc:
Cleanup of the previous bug fix: replace code is either SQLCOM_REPLACE or SQLCOM_REPLACE_SELECT sql/ha_innodb.cc: Cleanup of the previous bug fix: replace code is either SQLCOM_REPLACE or SQLCOM_REPLACE_SELECT
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index fb1f99f2160..caddd77fab8 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -1733,7 +1733,6 @@ ha_innobase::write_row(
ibool incremented_auto_inc_for_stat = FALSE;
ibool incremented_auto_inc_counter = FALSE;
ibool skip_auto_inc_decr;
- ibool success;
DBUG_ENTER("ha_innobase::write_row");
@@ -1910,14 +1909,10 @@ ha_innobase::write_row(
skip_auto_inc_decr = FALSE;
- /* Note that MySQL classifies in lex.sql_command a query
- of type REPLACE INTO ... SELECT as simply SQLCOM_QUERY.
- We have to scan the query string if the query is actually
- a REPLACE. */
-
- dict_accept(user_thd->query, "REPLACE", &success);
-
- if (error == DB_DUPLICATE_KEY && success) {
+ if (error == DB_DUPLICATE_KEY
+ && (user_thd->lex.sql_command == SQLCOM_REPLACE
+ || user_thd->lex.sql_command
+ == SQLCOM_REPLACE_SELECT)) {
skip_auto_inc_decr= TRUE;
}