summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-12-31 12:04:35 +0200
committerunknown <monty@mysql.com>2004-12-31 12:04:35 +0200
commit2419fa2684413f103a5bee470a330f00310c3f6e (patch)
tree15ba897ee442fcca24c0923eecba6bd94786608f /sql/sql_class.h
parent7a3ad6eb8422b28e8f15aa873393001fac193963 (diff)
downloadmariadb-git-2419fa2684413f103a5bee470a330f00310c3f6e.tar.gz
Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
This allows use to use INSERT IGNORE ... ON DUPLICATE ... mysql-test/r/drop.result: safety fix mysql-test/t/drop.test: safety fix mysql-test/t/multi_update.test: ensure we cover all possible errors sql/log_event.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/log_event.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/mysql_priv.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_class.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_delete.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_insert.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_lex.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_lex.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_load.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_parse.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_repl.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_repl.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_select.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_table.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_union.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_update.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_yacc.yy: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 169835f3324..f7d25077238 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -29,7 +29,7 @@ class Slave_log_event;
enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
-enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE, DUP_UPDATE };
+enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
enum enum_log_type { LOG_CLOSED, LOG_TO_BE_OPENED, LOG_NORMAL, LOG_NEW, LOG_BIN};
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
DELAY_KEY_WRITE_ALL };
@@ -201,7 +201,8 @@ typedef struct st_copy_info {
ha_rows error_count;
enum enum_duplicates handle_duplicates;
int escape_char, last_errno;
-/* for INSERT ... UPDATE */
+ bool ignore;
+ /* for INSERT ... UPDATE */
List<Item> *update_fields;
List<Item> *update_values;
} COPY_INFO;
@@ -1232,19 +1233,21 @@ class select_insert :public select_result_interceptor {
COPY_INFO info;
select_insert(TABLE *table_par, List<Item> *fields_par,
- enum_duplicates duplic)
+ enum_duplicates duplic, bool ignore)
:table(table_par), fields(fields_par), last_insert_id(0)
{
bzero((char*) &info,sizeof(info));
+ info.ignore= ignore;
info.handle_duplicates=duplic;
}
select_insert(TABLE *table_par, List<Item> *fields_par,
List<Item> *update_fields, List<Item> *update_values,
- enum_duplicates duplic)
+ enum_duplicates duplic, bool ignore)
:table(table_par), fields(fields_par), last_insert_id(0)
{
bzero((char*) &info,sizeof(info));
- info.handle_duplicates=duplic;
+ info.ignore= ignore;
+ info.handle_duplicates= duplic;
info.update_fields= update_fields;
info.update_values= update_values;
}
@@ -1273,8 +1276,8 @@ public:
HA_CREATE_INFO *create_info_par,
List<create_field> &fields_par,
List<Key> &keys_par,
- List<Item> &select_fields,enum_duplicates duplic)
- :select_insert (NULL, &select_fields, duplic), db(db_name),
+ List<Item> &select_fields,enum_duplicates duplic, bool ignore)
+ :select_insert (NULL, &select_fields, duplic, ignore), db(db_name),
name(table_name), extra_fields(&fields_par),keys(&keys_par),
create_info(create_info_par), lock(0)
{}
@@ -1525,11 +1528,11 @@ class multi_update :public select_result_interceptor
uint table_count;
Copy_field *copy_field;
enum enum_duplicates handle_duplicates;
- bool do_update, trans_safe, transactional_tables, log_delayed;
+ bool do_update, trans_safe, transactional_tables, log_delayed, ignore;
public:
multi_update(THD *thd_arg, TABLE_LIST *ut, List<Item> *fields,
- List<Item> *values, enum_duplicates handle_duplicates);
+ List<Item> *values, enum_duplicates handle_duplicates, bool ignore);
~multi_update();
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &items);