summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorpem@mysql.com <>2003-02-26 19:22:29 +0100
committerpem@mysql.com <>2003-02-26 19:22:29 +0100
commitca2e77ca7a4cd4cbdb08425044ca71f3d38def64 (patch)
tree21d88c3a00a56c11d4f65d0c77e082899658ec01 /sql/item_func.h
parentd8c75ec8aa867ec002c543e7931d54fd7144fd46 (diff)
downloadmariadb-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.h66
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();
+
+};