summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-10-04 13:56:48 +0300
committerunknown <bell@sanja.is.com.ua>2004-10-04 13:56:48 +0300
commitfaea84119ba2779ed76e91e44af0928919868442 (patch)
tree2339a9b67770ece89b7e96ac64db90238c5d64f9 /sql/sql_update.cc
parent99bf885bf5044d99d0597f5e177162c851e32359 (diff)
parent50cc3e4ab0765fb987b739fdf163e4e1a609fd76 (diff)
downloadmariadb-git-faea84119ba2779ed76e91e44af0928919868442.tar.gz
merge
sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc28
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> &not_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> &not_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++)
{
/*