summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.h
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2003-02-26 19:22:29 +0100
committerunknown <pem@mysql.com>2003-02-26 19:22:29 +0100
commit76b037dc4288fada1b64efbef422cb8b4bd0d5b5 (patch)
tree21d88c3a00a56c11d4f65d0c77e082899658ec01 /sql/sp_rcontext.h
parent0521fb5444df9a97e0682307242700bd94c6595e (diff)
downloadmariadb-git-76b037dc4288fada1b64efbef422cb8b4bd0d5b5.tar.gz
Made stored FUNCTION invokation work almost always. Still buggy and unstable, and
various known problems, but good enough for a checkpoint commit. mysql-test/r/sp.result: New tests for invoking simple FUNCTIONs. mysql-test/t/sp.test: New tests for invoking simple FUNCTIONs. sql/item_func.cc: New Item_func_sp for stored FUNCTIONs. sql/item_func.h: New Item_func_sp for stored FUNCTIONs. sql/sp.cc: Close mysql.proc table earlier so recursive find_function calls work. Added temporary sp_function_exists() function for checking without parsing. sql/sp.h: Added temporary sp_function_exists() function for checking without parsing. sql/sp_head.cc: New code for executing a FUNCTION. (And reworked some of the old code in the process.) sql/sp_head.h: New code for executing a FUNCTION. sql/sp_rcontext.h: Added result slot for FUNCTIONs. sql/sql_lex.cc: Added check for stored FUNCTION, analogous to UDFs. sql/sql_parse.cc: sp_head::execute was renamed into execute_procedure. sql/sql_yacc.yy: Added parsing of stored FUNCTION invocation and code generation for RETURN statement.
Diffstat (limited to 'sql/sp_rcontext.h')
-rw-r--r--sql/sp_rcontext.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 5ffbb0266e6..78485fdd090 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -26,7 +26,7 @@ class sp_rcontext : public Sql_alloc
public:
sp_rcontext(uint size)
- : m_count(0), m_size(size)
+ : m_count(0), m_size(size), m_result(NULL)
{
m_frame = (Item **)sql_alloc(size * sizeof(Item*));
m_outs = (int *)sql_alloc(size * sizeof(int));
@@ -70,12 +70,25 @@ class sp_rcontext : public Sql_alloc
return m_outs[idx];
}
+ inline void
+ set_result(Item *it)
+ {
+ m_result= it;
+ }
+
+ inline Item *
+ get_result()
+ {
+ return m_result;
+ }
+
private:
uint m_count;
uint m_size;
Item **m_frame;
int *m_outs;
+ Item *m_result; // For FUNCTIONs
}; // class sp_rcontext : public Sql_alloc