MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
item_create.h
1 /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 /* Functions to create an item. Used by sql/sql_yacc.yy */
17 
18 #ifndef ITEM_CREATE_H
19 #define ITEM_CREATE_H
20 
21 typedef struct st_udf_func udf_func;
22 
35 {
36 public:
58  virtual Item *create_func(THD *thd, LEX_STRING name, List<Item> *item_list) = 0;
59 
60 protected:
64  virtual ~Create_func() {}
65 };
66 
67 
74 class Create_qfunc : public Create_func
75 {
76 public:
85  virtual Item *create_func(THD *thd, LEX_STRING name, List<Item> *item_list);
86 
96  virtual Item* create(THD *thd, LEX_STRING db, LEX_STRING name,
97  bool use_explicit_name, List<Item> *item_list) = 0;
98 
99 protected:
103  virtual ~Create_qfunc() {}
104 };
105 
106 
114 
115 
122 
123 
124 #ifdef HAVE_DLOPEN
125 
129 class Create_udf_func : public Create_func
130 {
131 public:
132  virtual Item *create_func(THD *thd, LEX_STRING name, List<Item> *item_list);
133 
141  Item *create(THD *thd, udf_func *fct, List<Item> *item_list);
142 
144  static Create_udf_func s_singleton;
145 
146 protected:
148  Create_udf_func() {}
150  virtual ~Create_udf_func() {}
151 };
152 #endif
153 
154 
164 Item *
165 create_func_cast(THD *thd, Item *a, Cast_target cast_type,
166  const char *len, const char *dec,
167  const CHARSET_INFO *cs);
168 
169 Item *create_temporal_literal(THD *thd,
170  const char *str, uint length,
171  const CHARSET_INFO *cs,
172  enum_field_types type, bool send_error);
173 
174 int item_create_init();
175 void item_create_cleanup();
176 
177 #endif
178