summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-08-02 16:23:08 +0400
committerAlexander Barkov <bar@mariadb.com>2022-08-25 11:34:09 +0400
commitcc94b619758a04659fa9218ede838fadf461d3de (patch)
treed1899b63ff9c7f176868504debf2e9e0898f0d52 /sql/sql_update.cc
parent2426547f857ac01516eb5b14072e68a47e9f892f (diff)
downloadmariadb-git-bb-10.6-bar-assign.tar.gz
Backporting MDEV-29159 from 10.7 to 10.6bb-10.6-bar-assign
MDEV-29159 Patch for MDEV-28918 introduces more inconsistency than it solves, breaks usability 1. Store assignment failures on incompatible data types now raise errors if: - STRICT_ALL_TABLES or STRICT_TRANS_TABLES sql_mode is used, and - IGNORE is not used Otherwise, only a warning is raised and the statement continues. 2. Changing the error/warning test as follows: -ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET' +ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `db`.`t`.`col` so in case of a big table it's easier to see which column has the problem. The new error text is also applied to SP variables.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 24ba59a5bfd..fdec4014521 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -523,7 +523,8 @@ int mysql_update(THD *thd,
DBUG_RETURN(1); /* purecov: inspected */
}
- if (table_list->table->check_assignability_explicit_fields(fields, values))
+ if (table_list->table->check_assignability_explicit_fields(fields, values,
+ ignore))
DBUG_RETURN(true);
if (check_unique_table(thd, table_list))
@@ -2085,7 +2086,8 @@ int multi_update::prepare(List<Item> &not_used_values,
int error= setup_fields(thd, Ref_ptr_array(),
*values, MARK_COLUMNS_READ, 0, NULL, 0) ||
- TABLE::check_assignability_explicit_fields(*fields, *values);
+ TABLE::check_assignability_explicit_fields(*fields, *values,
+ ignore);
ti.rewind();
while ((table_ref= ti++))