summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-09-04 09:55:59 +0400
committerAlexander Barkov <bar@mariadb.com>2019-09-04 10:19:58 +0400
commit7e08ac0b41b50195aa79f6ac185bc69a91a960ca (patch)
tree3a399827dc8e6bd89bbb6d142f21eda8bd659119 /sql/item_func.cc
parenta071e0e029cd7c155cff1054d9f7f8a6aa898620 (diff)
parentef00ac4c86daf3294c46a45358da636763fb0049 (diff)
downloadmariadb-git-7e08ac0b41b50195aa79f6ac185bc69a91a960ca.tar.gz
Merge 10.2 (up to commit ef00ac4c86daf3294c46a45358da636763fb0049) into 10.3
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 7cab72718c6..6a5cfeac118 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -562,6 +562,15 @@ void Item_args::propagate_equal_fields(THD *thd,
}
+Sql_mode_dependency Item_args::value_depends_on_sql_mode_bit_or() const
+{
+ Sql_mode_dependency res;
+ for (uint i= 0; i < arg_count; i++)
+ res|= args[i]->value_depends_on_sql_mode();
+ return res;
+}
+
+
/**
See comments in Item_cond::split_sum_func()
*/
@@ -1329,6 +1338,13 @@ bool Item_func_minus::fix_length_and_dec()
if (Item_func_minus::type_handler()->Item_func_minus_fix_length_and_dec(this))
DBUG_RETURN(TRUE);
DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
+ m_sql_mode_dependency= Item_func::value_depends_on_sql_mode();
+ if (unsigned_flag)
+ {
+ m_sql_mode_dependency|= Sql_mode_dependency(0,MODE_NO_UNSIGNED_SUBTRACTION);
+ if (current_thd->variables.sql_mode & MODE_NO_UNSIGNED_SUBTRACTION)
+ unsigned_flag= false;
+ }
DBUG_RETURN(FALSE);
}