summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorpem@mysql.com <>2006-04-11 12:17:57 +0200
committerpem@mysql.com <>2006-04-11 12:17:57 +0200
commit57107fc9754e472527a8cbe2c75d0e02e2ede734 (patch)
treec228a8c6c4b9e239c5d4b7467900a97fba73cb91 /sql/item_func.cc
parent739ee02cf6a718670712538b3c9c2c865e60c690 (diff)
downloadmariadb-git-57107fc9754e472527a8cbe2c75d0e02e2ede734.tar.gz
Fixed BUG#18787: Server crashed when calling a stored procedure containing
a misnamed function ... in the presence of a continue handler. The problem was that with a handler, it continued to execute as if function existed and had set a useful return value (which it hadn't). The fix is to set a null return value and do an error return when a function wasn't found.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index f40f868f75f..8d30fafbe63 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4722,7 +4722,9 @@ Item_func_sp::sp_result_field(void) const
share->table_cache_key = empty_name;
share->table_name = empty_name;
}
- field= m_sp->create_result_field(max_length, name, dummy_table);
+ if (!(field= m_sp->create_result_field(max_length, name, dummy_table)))
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+
DBUG_RETURN(field);
}
@@ -4750,8 +4752,9 @@ Item_func_sp::execute(Field **flp)
{
if (!(*flp= f= sp_result_field()))
{
- my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
- return 0;
+ /* Error set by sp_result_field() */
+ null_value= 1;
+ return TRUE;
}
f->move_field((f->pack_length() > sizeof(result_buf)) ?
@@ -4915,6 +4918,9 @@ Item_func_sp::tmp_table_field(TABLE *t_arg)
if (!res)
res= Item_func::tmp_table_field(t_arg);
+ if (!res)
+ my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+
DBUG_RETURN(res);
}