summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-06-28 10:06:00 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-06-28 10:06:00 +0300
commit952398629915bb7138a76b21c5a0b426ed1d83f4 (patch)
tree0345f6d49b9d0bb08af601d6bac34d7321a5a7ac /sql/sp_head.cc
parentb3563098400b8fd954fb779c6868be0c7bd318e5 (diff)
parentac0af4ec4ab5073fa74289f93a7dd183a30c98f3 (diff)
downloadmariadb-git-952398629915bb7138a76b21c5a0b426ed1d83f4.tar.gz
Merge 10.7 into 10.8
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index ec69730a702..141245979e5 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -411,6 +411,26 @@ Item *THD::sp_fix_func_item(Item **it_addr)
/**
+ Prepare an Item for evaluation as an assignment source,
+ for assignment to the given target.
+
+ @param to - the assignment target
+ @param it_addr - a pointer on item refernce
+
+ @retval - NULL on error
+ @retval - a prepared item pointer on success
+*/
+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)))
+ DBUG_RETURN(res);
+ DBUG_RETURN(NULL);
+}
+
+
+/**
Evaluate an expression and store the result in the field.
@param result_field the field to store the result
@@ -4128,7 +4148,7 @@ sp_instr_jump_if_not::exec_core(THD *thd, uint *nextp)
Item *it;
int res;
- it= thd->sp_prepare_func_item(&m_expr);
+ it= thd->sp_prepare_func_item(&m_expr, 1);
if (! it)
{
res= -1;