summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-08-02 16:23:08 +0400
committerAlexander Barkov <bar@mariadb.com>2022-08-05 22:23:40 +0400
commit3ebbfd88a0360938e3a5a480265beb2a71b1268a (patch)
tree2168fd64b64e21aa391746019414055b326fb0b8 /sql/item.h
parent97d16c7544c40430facda441dab89fa4b23468a0 (diff)
downloadmariadb-git-3ebbfd88a0360938e3a5a480265beb2a71b1268a.tar.gz
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/item.h')
-rw-r--r--sql/item.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/item.h b/sql/item.h
index 117a252c025..c720ab47a92 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1838,14 +1838,14 @@ public:
*/
virtual bool is_evaluable_expression() const { return true; }
- virtual bool check_assignability_to(const Field *to) const
+ virtual bool check_assignability_to(const Field *to, bool ignore) const
{
/*
"this" must be neither DEFAULT/IGNORE,
nor Item_param bound to DEFAULT/IGNORE.
*/
DBUG_ASSERT(is_evaluable_expression());
- return to->check_assignability_from(type_handler());
+ return to->check_assignability_from(type_handler(), ignore);
}
/**
@@ -4101,7 +4101,7 @@ class Item_param :public Item_basic_value,
const String *value_query_val_str(THD *thd, String* str) const;
Item *value_clone_item(THD *thd);
bool is_evaluable_expression() const override;
- bool check_assignability_to(const Field *field) const override;
+ bool check_assignability_to(const Field *field, bool ignore) const override;
bool can_return_value() const;
public:
@@ -6782,7 +6782,7 @@ public:
{
str->append(STRING_WITH_LEN("default"));
}
- bool check_assignability_to(const Field *to) const override
+ bool check_assignability_to(const Field *to, bool ignore) const override
{
return false;
}
@@ -6819,7 +6819,7 @@ public:
{
str->append(STRING_WITH_LEN("ignore"));
}
- bool check_assignability_to(const Field *to) const override
+ bool check_assignability_to(const Field *to, bool ignore) const override
{
return false;
}