33
#include <drizzled/functions/func.h>
34
#include <drizzled/functions/additive_op.h>
35
#include <drizzled/functions/connection_id.h>
36
#include <drizzled/functions/decimal_typecast.h>
37
#include <drizzled/functions/divide.h>
38
#include <drizzled/functions/int.h>
39
#include <drizzled/functions/int_divide.h>
40
#include <drizzled/functions/length.h>
41
#include <drizzled/functions/min_max.h>
42
#include <drizzled/functions/minus.h>
43
#include <drizzled/functions/mod.h>
44
#include <drizzled/functions/multiply.h>
45
#include <drizzled/functions/neg.h>
46
#include <drizzled/functions/numhybrid.h>
47
#include <drizzled/functions/num_op.h>
48
#include <drizzled/functions/num1.h>
49
#include <drizzled/functions/abs.h>
50
#include <drizzled/functions/plus.h>
51
#include <drizzled/functions/real.h>
52
#include <drizzled/functions/dec.h>
53
#include <drizzled/functions/int_val.h>
54
#include <drizzled/functions/acos.h>
55
#include <drizzled/functions/asin.h>
56
#include <drizzled/functions/atan.h>
57
#include <drizzled/functions/ceiling.h>
58
#include <drizzled/functions/cos.h>
59
#include <drizzled/functions/exp.h>
60
#include <drizzled/functions/floor.h>
61
#include <drizzled/functions/ln.h>
62
#include <drizzled/functions/log.h>
63
#include <drizzled/functions/pow.h>
64
#include <drizzled/functions/rand.h>
65
#include <drizzled/functions/round.h>
66
#include <drizzled/functions/sin.h>
67
#include <drizzled/functions/sqrt.h>
68
#include <drizzled/functions/sign.h>
69
#include <drizzled/functions/signed.h>
70
#include <drizzled/functions/tan.h>
71
#include <drizzled/functions/unsigned.h>
30
class Item_func :public Item_result_field
33
Item **args, *tmp_arg[2];
35
Allowed numbers of columns in result (usually 1, which means scalar value)
36
0 means get this number from first argument
38
uint allowed_arg_cols;
41
table_map used_tables_cache, not_null_tables_cache;
42
bool const_item_cache;
43
enum Functype { UNKNOWN_FUNC,EQ_FUNC,EQUAL_FUNC,NE_FUNC,LT_FUNC,LE_FUNC,
44
GE_FUNC,GT_FUNC,FT_FUNC,
45
LIKE_FUNC,ISNULL_FUNC,ISNOTNULL_FUNC,
46
COND_AND_FUNC, COND_OR_FUNC, COND_XOR_FUNC,
47
BETWEEN, IN_FUNC, MULT_EQUAL_FUNC,
48
INTERVAL_FUNC, ISNOTNULLTEST_FUNC,
49
NOT_FUNC, NOT_ALL_FUNC,
50
NOW_FUNC, TRIG_COND_FUNC,
51
SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC,
52
EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC,
54
enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL,
56
enum Type type() const { return FUNC_ITEM; }
57
virtual enum Functype functype() const { return UNKNOWN_FUNC; }
59
allowed_arg_cols(1), arg_count(0)
64
allowed_arg_cols(1), arg_count(1)
68
with_sum_func= a->with_sum_func;
70
Item_func(Item *a,Item *b):
71
allowed_arg_cols(1), arg_count(2)
74
args[0]= a; args[1]= b;
75
with_sum_func= a->with_sum_func || b->with_sum_func;
77
Item_func(Item *a,Item *b,Item *c):
81
if ((args= (Item**) sql_alloc(sizeof(Item*)*3)))
84
args[0]= a; args[1]= b; args[2]= c;
85
with_sum_func= a->with_sum_func || b->with_sum_func || c->with_sum_func;
88
Item_func(Item *a,Item *b,Item *c,Item *d):
92
if ((args= (Item**) sql_alloc(sizeof(Item*)*4)))
95
args[0]= a; args[1]= b; args[2]= c; args[3]= d;
96
with_sum_func= a->with_sum_func || b->with_sum_func ||
97
c->with_sum_func || d->with_sum_func;
100
Item_func(Item *a,Item *b,Item *c,Item *d,Item* e):
104
if ((args= (Item**) sql_alloc(sizeof(Item*)*5)))
106
args[0]= a; args[1]= b; args[2]= c; args[3]= d; args[4]= e;
107
with_sum_func= a->with_sum_func || b->with_sum_func ||
108
c->with_sum_func || d->with_sum_func || e->with_sum_func ;
111
Item_func(List<Item> &list);
112
// Constructor used for Item_cond_and/or (see Item comment)
113
Item_func(THD *thd, Item_func *item);
114
bool fix_fields(THD *, Item **ref);
115
void fix_after_pullout(st_select_lex *new_parent, Item **ref);
116
table_map used_tables() const;
117
table_map not_null_tables() const;
118
void update_used_tables();
119
bool eq(const Item *item, bool binary_cmp) const;
120
virtual optimize_type select_optimize() const { return OPTIMIZE_NONE; }
121
virtual bool have_rev_func() const { return 0; }
122
virtual Item *key_item() const { return args[0]; }
124
This method is used for debug purposes to print the name of an
125
item to the debug log. The second use of this method is as
126
a helper function of print(), where it is applicable.
127
To suit both goals it should return a meaningful,
128
distinguishable and sintactically correct string. This method
129
should not be used for runtime type identification, use enum
130
{Sum}Functype and Item_func::functype()/Item_sum::sum_func()
133
virtual const char *func_name() const= 0;
134
virtual bool const_item() const { return const_item_cache; }
135
inline Item **arguments() const { return args; }
136
void set_arguments(List<Item> &list);
137
inline uint argument_count() const { return arg_count; }
138
inline void remove_arguments() { arg_count=0; }
139
void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields);
140
virtual void print(String *str, enum_query_type query_type);
141
void print_op(String *str, enum_query_type query_type);
142
void print_args(String *str, uint from, enum_query_type query_type);
143
virtual void fix_num_length_and_dec();
144
void count_only_length();
145
void count_real_length();
146
void count_decimal_length();
147
inline bool get_arg0_date(MYSQL_TIME *ltime, uint fuzzy_date)
149
return (null_value=args[0]->get_date(ltime, fuzzy_date));
151
inline bool get_arg0_time(MYSQL_TIME *ltime)
153
return (null_value=args[0]->get_time(ltime));
159
void signal_divide_by_null();
160
friend class udf_handler;
161
Field *tmp_table_field() { return result_field; }
162
Field *tmp_table_field(TABLE *t_arg);
163
Item *get_tmp_table_item(THD *thd);
165
my_decimal *val_decimal(my_decimal *);
167
bool agg_arg_collations(DTCollation &c, Item **items, uint nitems,
170
return agg_item_collations(c, func_name(), items, nitems, flags, 1);
172
bool agg_arg_collations_for_comparison(DTCollation &c,
173
Item **items, uint nitems,
176
return agg_item_collations_for_comparison(c, func_name(),
177
items, nitems, flags);
179
bool agg_arg_charsets(DTCollation &c, Item **items, uint nitems,
180
uint flags, int item_sep)
182
return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep);
184
bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
185
Item *transform(Item_transformer transformer, uchar *arg);
186
Item* compile(Item_analyzer analyzer, uchar **arg_p,
187
Item_transformer transformer, uchar *arg_t);
188
void traverse_cond(Cond_traverser traverser,
189
void * arg, traverse_order order);
190
inline double fix_result(double value)
200
class Item_real_func :public Item_func
203
Item_real_func() :Item_func() {}
204
Item_real_func(Item *a) :Item_func(a) {}
205
Item_real_func(Item *a,Item *b) :Item_func(a,b) {}
206
Item_real_func(List<Item> &list) :Item_func(list) {}
207
String *val_str(String*str);
208
my_decimal *val_decimal(my_decimal *decimal_value);
210
{ assert(fixed == 1); return (int64_t) rint(val_real()); }
211
enum Item_result result_type () const { return REAL_RESULT; }
212
void fix_length_and_dec()
213
{ decimals= NOT_FIXED_DEC; max_length= float_length(decimals); }
217
class Item_func_numhybrid: public Item_func
220
Item_result hybrid_type;
222
Item_func_numhybrid(Item *a) :Item_func(a), hybrid_type(REAL_RESULT)
224
Item_func_numhybrid(Item *a,Item *b)
225
:Item_func(a,b), hybrid_type(REAL_RESULT)
227
Item_func_numhybrid(List<Item> &list)
228
:Item_func(list), hybrid_type(REAL_RESULT)
231
enum Item_result result_type () const { return hybrid_type; }
232
void fix_length_and_dec();
233
void fix_num_length_and_dec();
234
virtual void find_num_type()= 0; /* To be called from fix_length_and_dec */
238
my_decimal *val_decimal(my_decimal *);
239
String *val_str(String*str);
242
@brief Performs the operation that this functions implements when the
245
@return The result of the operation.
247
virtual int64_t int_op()= 0;
250
@brief Performs the operation that this functions implements when the
253
@return The result of the operation.
255
virtual double real_op()= 0;
258
@brief Performs the operation that this functions implements when the
259
result type is DECIMAL.
261
@param A pointer where the DECIMAL value will be allocated.
263
- 0 If the result is NULL
264
- The same pointer it was given, with the area initialized to the
265
result of the operation.
267
virtual my_decimal *decimal_op(my_decimal *)= 0;
270
@brief Performs the operation that this functions implements when the
271
result type is a string type.
273
@return The result of the operation.
275
virtual String *str_op(String *)= 0;
276
bool is_null() { update_null_value(); return null_value; }
279
/* function where type of result detected by first argument */
280
class Item_func_num1: public Item_func_numhybrid
283
Item_func_num1(Item *a) :Item_func_numhybrid(a) {}
284
Item_func_num1(Item *a, Item *b) :Item_func_numhybrid(a, b) {}
286
void fix_num_length_and_dec();
287
void find_num_type();
288
String *str_op(String *str __attribute__((__unused__)))
289
{ assert(0); return 0; }
293
/* Base class for operations like '+', '-', '*' */
294
class Item_num_op :public Item_func_numhybrid
297
Item_num_op(Item *a,Item *b) :Item_func_numhybrid(a, b) {}
298
virtual void result_precision()= 0;
300
virtual inline void print(String *str, enum_query_type query_type)
302
print_op(str, query_type);
305
void find_num_type();
306
String *str_op(String *str __attribute__((__unused__)))
307
{ assert(0); return 0; }
311
class Item_int_func :public Item_func
314
Item_int_func() :Item_func() { max_length= 21; }
315
Item_int_func(Item *a) :Item_func(a) { max_length= 21; }
316
Item_int_func(Item *a,Item *b) :Item_func(a,b) { max_length= 21; }
317
Item_int_func(Item *a,Item *b,Item *c) :Item_func(a,b,c)
319
Item_int_func(List<Item> &list) :Item_func(list) { max_length= 21; }
320
Item_int_func(THD *thd, Item_int_func *item) :Item_func(thd, item) {}
322
String *val_str(String*str);
323
enum Item_result result_type () const { return INT_RESULT; }
324
void fix_length_and_dec() {}
328
class Item_func_connection_id :public Item_int_func
333
Item_func_connection_id() {}
334
const char *func_name() const { return "connection_id"; }
335
void fix_length_and_dec();
336
bool fix_fields(THD *thd, Item **ref);
337
int64_t val_int() { assert(fixed == 1); return value; }
341
class Item_func_signed :public Item_int_func
344
Item_func_signed(Item *a) :Item_int_func(a) {}
345
const char *func_name() const { return "cast_as_signed"; }
347
int64_t val_int_from_str(int *error);
348
void fix_length_and_dec()
349
{ max_length=args[0]->max_length; unsigned_flag=0; }
350
virtual void print(String *str, enum_query_type query_type);
351
uint decimal_precision() const { return args[0]->decimal_precision(); }
355
class Item_func_unsigned :public Item_func_signed
358
Item_func_unsigned(Item *a) :Item_func_signed(a) {}
359
const char *func_name() const { return "cast_as_unsigned"; }
360
void fix_length_and_dec()
361
{ max_length=args[0]->max_length; unsigned_flag=1; }
363
virtual void print(String *str, enum_query_type query_type);
367
class Item_decimal_typecast :public Item_func
369
my_decimal decimal_value;
371
Item_decimal_typecast(Item *a, int len, int dec) :Item_func(a)
374
max_length= my_decimal_precision_to_length(len, dec, unsigned_flag);
376
String *val_str(String *str);
379
my_decimal *val_decimal(my_decimal*);
380
enum Item_result result_type () const { return DECIMAL_RESULT; }
381
enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; }
382
void fix_length_and_dec() {};
383
const char *func_name() const { return "decimal_typecast"; }
384
virtual void print(String *str, enum_query_type query_type);
388
class Item_func_additive_op :public Item_num_op
391
Item_func_additive_op(Item *a,Item *b) :Item_num_op(a,b) {}
392
void result_precision();
396
class Item_func_plus :public Item_func_additive_op
399
Item_func_plus(Item *a,Item *b) :Item_func_additive_op(a,b) {}
400
const char *func_name() const { return "+"; }
403
my_decimal *decimal_op(my_decimal *);
406
class Item_func_minus :public Item_func_additive_op
409
Item_func_minus(Item *a,Item *b) :Item_func_additive_op(a,b) {}
410
const char *func_name() const { return "-"; }
413
my_decimal *decimal_op(my_decimal *);
414
void fix_length_and_dec();
418
class Item_func_mul :public Item_num_op
421
Item_func_mul(Item *a,Item *b) :Item_num_op(a,b) {}
422
const char *func_name() const { return "*"; }
425
my_decimal *decimal_op(my_decimal *);
426
void result_precision();
430
class Item_func_div :public Item_num_op
434
Item_func_div(Item *a,Item *b) :Item_num_op(a,b) {}
435
int64_t int_op() { assert(0); return 0; }
437
my_decimal *decimal_op(my_decimal *);
438
const char *func_name() const { return "/"; }
439
void fix_length_and_dec();
440
void result_precision();
444
class Item_func_int_div :public Item_int_func
447
Item_func_int_div(Item *a,Item *b) :Item_int_func(a,b)
450
const char *func_name() const { return "DIV"; }
451
void fix_length_and_dec();
453
virtual inline void print(String *str, enum_query_type query_type)
455
print_op(str, query_type);
461
class Item_func_mod :public Item_num_op
464
Item_func_mod(Item *a,Item *b) :Item_num_op(a,b) {}
467
my_decimal *decimal_op(my_decimal *);
468
const char *func_name() const { return "%"; }
469
void result_precision();
470
void fix_length_and_dec();
474
class Item_func_neg :public Item_func_num1
477
Item_func_neg(Item *a) :Item_func_num1(a) {}
480
my_decimal *decimal_op(my_decimal *);
481
const char *func_name() const { return "-"; }
482
enum Functype functype() const { return NEG_FUNC; }
483
void fix_length_and_dec();
484
void fix_num_length_and_dec();
485
uint decimal_precision() const { return args[0]->decimal_precision(); }
489
class Item_func_abs :public Item_func_num1
492
Item_func_abs(Item *a) :Item_func_num1(a) {}
495
my_decimal *decimal_op(my_decimal *);
496
const char *func_name() const { return "abs"; }
497
void fix_length_and_dec();
500
// A class to handle logarithmic and trigonometric functions
502
class Item_dec_func :public Item_real_func
505
Item_dec_func(Item *a) :Item_real_func(a) {}
506
Item_dec_func(Item *a,Item *b) :Item_real_func(a,b) {}
507
void fix_length_and_dec()
509
decimals=NOT_FIXED_DEC; max_length=float_length(decimals);
514
class Item_func_exp :public Item_dec_func
517
Item_func_exp(Item *a) :Item_dec_func(a) {}
519
const char *func_name() const { return "exp"; }
523
class Item_func_ln :public Item_dec_func
526
Item_func_ln(Item *a) :Item_dec_func(a) {}
528
const char *func_name() const { return "ln"; }
532
class Item_func_log :public Item_dec_func
535
Item_func_log(Item *a) :Item_dec_func(a) {}
536
Item_func_log(Item *a,Item *b) :Item_dec_func(a,b) {}
538
const char *func_name() const { return "log"; }
542
class Item_func_log2 :public Item_dec_func
545
Item_func_log2(Item *a) :Item_dec_func(a) {}
547
const char *func_name() const { return "log2"; }
551
class Item_func_log10 :public Item_dec_func
554
Item_func_log10(Item *a) :Item_dec_func(a) {}
556
const char *func_name() const { return "log10"; }
560
class Item_func_sqrt :public Item_dec_func
563
Item_func_sqrt(Item *a) :Item_dec_func(a) {}
565
const char *func_name() const { return "sqrt"; }
569
class Item_func_pow :public Item_dec_func
572
Item_func_pow(Item *a,Item *b) :Item_dec_func(a,b) {}
574
const char *func_name() const { return "pow"; }
578
class Item_func_acos :public Item_dec_func
581
Item_func_acos(Item *a) :Item_dec_func(a) {}
583
const char *func_name() const { return "acos"; }
586
class Item_func_asin :public Item_dec_func
589
Item_func_asin(Item *a) :Item_dec_func(a) {}
591
const char *func_name() const { return "asin"; }
594
class Item_func_atan :public Item_dec_func
597
Item_func_atan(Item *a) :Item_dec_func(a) {}
598
Item_func_atan(Item *a,Item *b) :Item_dec_func(a,b) {}
600
const char *func_name() const { return "atan"; }
603
class Item_func_cos :public Item_dec_func
606
Item_func_cos(Item *a) :Item_dec_func(a) {}
608
const char *func_name() const { return "cos"; }
611
class Item_func_sin :public Item_dec_func
614
Item_func_sin(Item *a) :Item_dec_func(a) {}
616
const char *func_name() const { return "sin"; }
619
class Item_func_tan :public Item_dec_func
622
Item_func_tan(Item *a) :Item_dec_func(a) {}
624
const char *func_name() const { return "tan"; }
73
627
class Item_func_integer :public Item_int_func
307
984
const char *func_name() const { return "benchmark"; }
308
985
void fix_length_and_dec() { max_length=1; maybe_null=0; }
309
986
virtual void print(String *str, enum_query_type query_type);
310
bool check_vcol_func_processor(unsigned char *int_arg __attribute__((unused)))
992
class Item_udf_func :public Item_func
996
bool is_expensive_processor(uchar *arg __attribute__((__unused__)))
1000
Item_udf_func(udf_func *udf_arg)
1001
:Item_func(), udf(udf_arg) {}
1002
Item_udf_func(udf_func *udf_arg, List<Item> &list)
1003
:Item_func(list), udf(udf_arg) {}
1004
const char *func_name() const { return udf.name(); }
1005
enum Functype functype() const { return UDF_FUNC; }
1006
bool fix_fields(THD *thd, Item **ref __attribute__((__unused__)))
1009
bool res= udf.fix_fields(thd, this, arg_count, args);
1010
used_tables_cache= udf.used_tables_cache;
1011
const_item_cache= udf.const_item_cache;
1015
void update_used_tables()
1018
TODO: Make a member in UDF_INIT and return if a UDF is deterministic or
1020
Currently UDF_INIT has a member (const_item) that is an in/out
1021
parameter to the init() call.
1022
The code in udf_handler::fix_fields also duplicates the arguments
1023
handling code in Item_func::fix_fields().
1025
The lack of information if a UDF is deterministic makes writing
1026
a correct update_used_tables() for UDFs impossible.
1027
One solution to this would be :
1028
- Add a is_deterministic member of UDF_INIT
1029
- (optionally) deprecate the const_item member of UDF_INIT
1030
- Take away the duplicate code from udf_handler::fix_fields() and
1031
make Item_udf_func call Item_func::fix_fields() to process its
1032
arguments as for any other function.
1033
- Store the deterministic flag returned by <udf>_init into the
1035
- Don't implement Item_udf_func::fix_fields, implement
1036
Item_udf_func::fix_length_and_dec() instead (similar to non-UDF
1038
- Override Item_func::update_used_tables to call
1039
Item_func::update_used_tables() and add a RAND_TABLE_BIT to the
1040
result of Item_func::update_used_tables() if the UDF is
1042
- (optionally) rename RAND_TABLE_BIT to NONDETERMINISTIC_BIT to
1043
better describe its usage.
1045
The above would require a change of the UDF API.
1046
Until that change is done here's how the current code works:
1047
We call Item_func::update_used_tables() only when we know that
1048
the function depends on real non-const tables and is deterministic.
1049
This can be done only because we know that the optimizer will
1050
call update_used_tables() only when there's possibly a new const
1051
table. So update_used_tables() can only make a Item_func more
1052
constant than it is currently.
1053
That's why we don't need to do anything if a function is guaranteed
1054
to return non-constant (it's non-deterministic) or is already a
1057
if ((used_tables_cache & ~PSEUDO_TABLE_BITS) &&
1058
!(used_tables_cache & RAND_TABLE_BIT))
1060
Item_func::update_used_tables();
1061
if (!const_item_cache && !used_tables_cache)
1062
used_tables_cache= RAND_TABLE_BIT;
1066
Item_result result_type () const { return udf.result_type(); }
1067
table_map not_null_tables() const { return 0; }
1068
virtual void print(String *str, enum_query_type query_type);
1072
class Item_func_udf_float :public Item_udf_func
1075
Item_func_udf_float(udf_func *udf_arg)
1076
:Item_udf_func(udf_arg) {}
1077
Item_func_udf_float(udf_func *udf_arg,
1079
:Item_udf_func(udf_arg, list) {}
1083
return (int64_t) rint(Item_func_udf_float::val_real());
1085
my_decimal *val_decimal(my_decimal *dec_buf)
1087
double res=val_real();
1090
double2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
1094
String *val_str(String *str);
1095
void fix_length_and_dec() { fix_num_length_and_dec(); }
1099
class Item_func_udf_int :public Item_udf_func
1102
Item_func_udf_int(udf_func *udf_arg)
1103
:Item_udf_func(udf_arg) {}
1104
Item_func_udf_int(udf_func *udf_arg,
1106
:Item_udf_func(udf_arg, list) {}
1108
double val_real() { return (double) Item_func_udf_int::val_int(); }
1109
String *val_str(String *str);
1110
enum Item_result result_type () const { return INT_RESULT; }
1111
void fix_length_and_dec() { decimals= 0; max_length= 21; }
1115
class Item_func_udf_decimal :public Item_udf_func
1118
Item_func_udf_decimal(udf_func *udf_arg)
1119
:Item_udf_func(udf_arg) {}
1120
Item_func_udf_decimal(udf_func *udf_arg, List<Item> &list)
1121
:Item_udf_func(udf_arg, list) {}
1124
my_decimal *val_decimal(my_decimal *);
1125
String *val_str(String *str);
1126
enum Item_result result_type () const { return DECIMAL_RESULT; }
1127
void fix_length_and_dec();
1131
class Item_func_udf_str :public Item_udf_func
1134
Item_func_udf_str(udf_func *udf_arg)
1135
:Item_udf_func(udf_arg) {}
1136
Item_func_udf_str(udf_func *udf_arg, List<Item> &list)
1137
:Item_udf_func(udf_arg, list) {}
1138
String *val_str(String *);
1144
res= val_str(&str_value);
1145
return res ? my_strntod(res->charset(),(char*) res->ptr(),
1146
res->length(), &end_not_used, &err_not_used) : 0.0;
1151
String *res; res=val_str(&str_value);
1152
return res ? my_strntoll(res->charset(),res->ptr(),res->length(),10,
1153
(char**) 0, &err_not_used) : (int64_t) 0;
1155
my_decimal *val_decimal(my_decimal *dec_buf)
1157
String *res=val_str(&str_value);
1160
string2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
1163
enum Item_result result_type () const { return STRING_RESULT; }
1164
void fix_length_and_dec();
1167
#else /* Dummy functions to get sql_yacc.cc compiled */
1169
class Item_func_udf_float :public Item_real_func
1172
Item_func_udf_float(udf_func *udf_arg)
1173
:Item_real_func() {}
1174
Item_func_udf_float(udf_func *udf_arg, List<Item> &list)
1175
:Item_real_func(list) {}
1176
double val_real() { assert(fixed == 1); return 0.0; }
1180
class Item_func_udf_int :public Item_int_func
1183
Item_func_udf_int(udf_func *udf_arg)
1185
Item_func_udf_int(udf_func *udf_arg, List<Item> &list)
1186
:Item_int_func(list) {}
1187
int64_t val_int() { assert(fixed == 1); return 0; }
1191
class Item_func_udf_decimal :public Item_int_func
1194
Item_func_udf_decimal(udf_func *udf_arg)
1196
Item_func_udf_decimal(udf_func *udf_arg, List<Item> &list)
1197
:Item_int_func(list) {}
1198
my_decimal *val_decimal(my_decimal *) { assert(fixed == 1); return 0; }
1202
class Item_func_udf_str :public Item_func
1205
Item_func_udf_str(udf_func *udf_arg)
1207
Item_func_udf_str(udf_func *udf_arg, List<Item> &list)
1209
String *val_str(String *)
1210
{ assert(fixed == 1); null_value=1; return 0; }
1211
double val_real() { assert(fixed == 1); null_value= 1; return 0.0; }
1212
int64_t val_int() { assert(fixed == 1); null_value=1; return 0; }
1213
enum Item_result result_type () const { return STRING_RESULT; }
1214
void fix_length_and_dec() { maybe_null=1; max_length=0; }
1217
#endif /* HAVE_DLOPEN */
314
1219
/* replication functions */