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/item_func.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/item_func.h')
-rw-r--r-- | sql/item_func.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 68804b83d26..07201093473 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1147,3 +1147,69 @@ enum Item_cast ITEM_CAST_BINARY, ITEM_CAST_SIGNED_INT, ITEM_CAST_UNSIGNED_INT, ITEM_CAST_DATE, ITEM_CAST_TIME, ITEM_CAST_DATETIME, ITEM_CAST_CHAR }; + + +/* + * + * Stored FUNCTIONs + * + */ + +class sp_head; + +class Item_func_sp :public Item_func +{ +private: + LEX_STRING m_name; + sp_head *m_sp; + + int execute(Item **itp); + +public: + + Item_func_sp(LEX_STRING name) + :Item_func(), m_name(name), m_sp(NULL) + {} + + Item_func_sp(LEX_STRING name, List<Item> &list) + :Item_func(list), m_name(name), m_sp(NULL) + {} + + virtual ~Item_func_sp() + {} + + const char *func_name() const + { + return m_name.str; + } + + Item_result result_type() const; + + longlong val_int() + { + return (longlong)Item_func_sp::val(); + } + + double val() + { + Item *it; + + if (execute(&it)) + return 0.0; + return it->val(); + } + + String *val_str(String *str) + { + Item *it; + + if (execute(&it)) + return NULL; + return it->val_str(str); + } + + void make_field(Send_field *field); + + void fix_length_and_dec(); + +}; |