summaryrefslogtreecommitdiff
path: root/sql/item_create.h
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2017-07-07 17:52:23 +0300
committerGitHub <noreply@github.com>2017-07-07 17:52:23 +0300
commitdcb54040bcb6927e1fafe039979b816865c7c805 (patch)
tree317000323dfbe92cd59ceaae998c68eaa4348720 /sql/item_create.h
parent42a0289de9789979fedd51240be52347c5330995 (diff)
downloadmariadb-git-dcb54040bcb6927e1fafe039979b816865c7c805.tar.gz
SQL: VTQ testing iface moved to plugin [closes #224]
Diffstat (limited to 'sql/item_create.h')
-rw-r--r--sql/item_create.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/sql/item_create.h b/sql/item_create.h
index 05fe48f656a..b8749a4513a 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -19,6 +19,8 @@
#ifndef ITEM_CREATE_H
#define ITEM_CREATE_H
+#include "item_func.h" // Cast_target
+
typedef struct st_udf_func udf_func;
/**
@@ -67,6 +69,37 @@ protected:
/**
+ Adapter for native functions with a variable number of arguments.
+ The main use of this class is to discard the following calls:
+ <code>foo(expr1 AS name1, expr2 AS name2, ...)</code>
+ which are syntactically correct (the syntax can refer to a UDF),
+ but semantically invalid for native functions.
+*/
+
+class Create_native_func : public Create_func
+{
+public:
+ virtual Item *create_func(THD *thd, LEX_STRING name, List<Item> *item_list);
+
+ /**
+ Builder method, with no arguments.
+ @param thd The current thread
+ @param name The native function name
+ @param item_list The function parameters, none of which are named
+ @return An item representing the function call
+ */
+ virtual Item *create_native(THD *thd, LEX_STRING name,
+ List<Item> *item_list) = 0;
+
+protected:
+ /** Constructor. */
+ Create_native_func() {}
+ /** Destructor. */
+ virtual ~Create_native_func() {}
+};
+
+
+/**
Function builder for qualified functions.
This builder is used with functions call using a qualified function name
syntax, as in <code>db.func(expr, expr, ...)</code>.
@@ -183,7 +216,14 @@ Item *create_temporal_literal(THD *thd, const String *str,
type, send_error);
}
+struct Native_func_registry
+{
+ LEX_STRING name;
+ Create_func *builder;
+};
+
int item_create_init();
+int item_create_append(Native_func_registry array[]);
void item_create_cleanup();
Item *create_func_dyncol_create(THD *thd, List<DYNCALL_CREATE_DEF> &list);