diff options
author | pem@mysql.com <> | 2003-02-26 19:22:29 +0100 |
---|---|---|
committer | pem@mysql.com <> | 2003-02-26 19:22:29 +0100 |
commit | ca2e77ca7a4cd4cbdb08425044ca71f3d38def64 (patch) | |
tree | 21d88c3a00a56c11d4f65d0c77e082899658ec01 /sql/sp_head.h | |
parent | d8c75ec8aa867ec002c543e7931d54fd7144fd46 (diff) | |
download | mariadb-git-ca2e77ca7a4cd4cbdb08425044ca71f3d38def64.tar.gz |
Made stored FUNCTION invokation work almost always. Still buggy and unstable, and
various known problems, but good enough for a checkpoint commit.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index b0f57757f98..fa2a76753e7 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -29,6 +29,9 @@ #define TYPE_ENUM_FUNCTION 1 #define TYPE_ENUM_PROCEDURE 2 +Item_result +sp_map_result_type(enum enum_field_types type); + struct sp_label; class sp_instr; @@ -62,7 +65,10 @@ public: create(THD *thd); int - execute(THD *thd); + execute_function(THD *thd, Item **args, uint argcount, Item **resp); + + int + execute_procedure(THD *thd, List<Item> *args); inline void add_instr(sp_instr *i) @@ -103,6 +109,11 @@ public: return n->c_ptr(); } + inline Item_result result() + { + return sp_map_result_type(m_returns); + } + private: Item_string *m_name; @@ -122,10 +133,14 @@ private: { sp_instr *in= NULL; - get_dynamic(&m_instr, (gptr)&in, i); + if (i < m_instr.elements) + get_dynamic(&m_instr, (gptr)&in, i); return in; } + int + execute(THD *thd); + }; // class sp_head : public Sql_alloc @@ -319,4 +334,28 @@ private: }; // class sp_instr_jump_if_not : public sp_instr_jump + +class sp_instr_return : public sp_instr +{ + sp_instr_return(const sp_instr_return &); /* Prevent use of these */ + void operator=(sp_instr_return &); + +public: + + sp_instr_return(uint ip, Item *val, enum enum_field_types type) + : sp_instr(ip), m_value(val), m_type(type) + {} + + virtual ~sp_instr_return() + {} + + virtual int execute(THD *thd, uint *nextp); + +protected: + + Item *m_value; + enum enum_field_types m_type; + +}; // class sp_instr_return : public sp_instr + #endif /* _SP_HEAD_H_ */ |