diff options
author | bell@sanja.is.com.ua <> | 2004-10-04 13:56:48 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-10-04 13:56:48 +0300 |
commit | 9062e99ee6fab7ffaa83c141e8ff05d83c588b19 (patch) | |
tree | 2339a9b67770ece89b7e96ac64db90238c5d64f9 /sql/sql_update.cc | |
parent | 03394ebe12b010a3a187cfbfa10191616eb60d3d (diff) | |
parent | 9d9c9504452a8eaa5da2c48b9e87d1608765f40b (diff) | |
download | mariadb-git-9062e99ee6fab7ffaa83c141e8ff05d83c588b19.tar.gz |
merge
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 024d220b08d..babfe1722a3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -97,10 +97,12 @@ int mysql_update(THD *thd, ha_rows limit, enum enum_duplicates handle_duplicates) { - bool using_limit=limit != HA_POS_ERROR; + bool using_limit= limit != HA_POS_ERROR; bool safe_update= thd->options & OPTION_SAFE_UPDATES; bool used_key_is_modified, transactional_table, log_delayed; + bool ignore_err= (thd->lex->duplicates == DUP_IGNORE); int error=0; + int res; uint used_index; #ifndef NO_EMBEDDED_ACCESS_CHECKS uint want_privilege; @@ -152,7 +154,7 @@ int mysql_update(THD *thd, #endif { thd->lex->select_lex.no_wrap_view_item= 1; - int res= setup_fields(thd, 0, table_list, fields, 1, 0, 0); + res= setup_fields(thd, 0, table_list, fields, 1, 0, 0); thd->lex->select_lex.no_wrap_view_item= 0; if (res) DBUG_RETURN(-1); /* purecov: inspected */ @@ -369,6 +371,18 @@ int mysql_update(THD *thd, if (compare_record(table, query_id)) { + if ((res= table_list->view_check_option(thd, ignore_err)) != + VIEW_CHECK_OK) + { + found--; + if (res == VIEW_CHECK_SKIP) + continue; + else if (res == VIEW_CHECK_ERROR) + { + error= 1; + break; + } + } if (!(error=table->file->update_row((byte*) table->record[1], (byte*) table->record[0]))) { @@ -979,6 +993,7 @@ multi_update::~multi_update() bool multi_update::send_data(List<Item> ¬_used_values) { TABLE_LIST *cur_table; + bool ignore_err= (thd->lex->duplicates == DUP_IGNORE); DBUG_ENTER("multi_update::send_data"); for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local) @@ -1011,6 +1026,15 @@ bool multi_update::send_data(List<Item> ¬_used_values) if (compare_record(table, thd->query_id)) { int error; + if ((error= cur_table->view_check_option(thd, ignore_err)) != + VIEW_CHECK_OK) + { + found--; + if (error == VIEW_CHECK_SKIP) + continue; + else if (error == VIEW_CHECK_ERROR) + DBUG_RETURN(1); + } if (!updated++) { /* |