diff options
author | unknown <mskold@mysql.com> | 2005-01-10 20:55:05 +0100 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2005-01-10 20:55:05 +0100 |
commit | f360ee773c46237aa88e1ed8068c7668a07106dc (patch) | |
tree | 9223470c2afd48b72d564c17164bad09c6bd74ec /sql/sql_insert.cc | |
parent | 0b7895b9b14981926c34fbd833aed0d9235da68a (diff) | |
download | mariadb-git-f360ee773c46237aa88e1ed8068c7668a07106dc.tar.gz |
Fix for failing INSERT IGNORE
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 2b30b4e6981..ceb31f76953 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -292,7 +292,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, error=0; id=0; thd->proc_info="update"; - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); /* let's *try* to start bulk inserts. It won't necessary @@ -471,7 +471,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, table->next_number_field=0; thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->next_insert_id=0; // Reset this if wrongly used - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); /* Reset value of LAST_INSERT_ID if no rows where inserted */ @@ -1606,7 +1606,7 @@ bool delayed_insert::handle_inserts(void) info.ignore= row->ignore; info.handle_duplicates= row->dup; if (info.ignore || - info.handle_duplicates == DUP_REPLACE) + info.handle_duplicates != DUP_ERROR) { table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); using_ignore=1; @@ -1806,7 +1806,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u) restore_record(table,s->default_values); // Get empty record table->next_number_field=table->found_next_number_field; thd->cuted_fields=0; - if (info.ignore || info.handle_duplicates == DUP_REPLACE) + if (info.ignore || info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); thd->no_trans_update= 0; @@ -2008,7 +2008,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) restore_record(table,s->default_values); // Get empty record thd->cuted_fields=0; - if (info.ignore || info.handle_duplicates == DUP_REPLACE) + if (info.ignore || info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); thd->no_trans_update= 0; |