From 3ebbfd88a0360938e3a5a480265beb2a71b1268a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 2 Aug 2022 16:23:08 +0400 Subject: 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. --- sql/sp_head.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sp_head.cc') diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 3557e21d53b..340aca29c03 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -424,7 +424,7 @@ Item *THD::sp_fix_func_item_for_assignment(const Field *to, Item **it_addr) { DBUG_ENTER("THD::sp_fix_func_item_for_assignment"); Item *res= sp_fix_func_item(it_addr); - if (res && (!res->check_assignability_to(to))) + if (res && (!res->check_assignability_to(to, false))) DBUG_RETURN(res); DBUG_RETURN(NULL); } -- cgit v1.2.1