1
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
1
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
3
3
This program is free software; you can redistribute it and/or modify
4
4
it under the terms of the GNU General Public License as published by
12
12
You should have received a copy of the GNU General Public License
13
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
18
/* Function items used by mysql */
124
125
virtual optimize_type select_optimize() const { return OPTIMIZE_NONE; }
125
126
virtual bool have_rev_func() const { return 0; }
126
127
virtual Item *key_item() const { return args[0]; }
128
This method is used for debug purposes to print the name of an
129
item to the debug log. The second use of this method is as
130
a helper function of print(), where it is applicable.
131
To suit both goals it should return a meaningful,
132
distinguishable and sintactically correct string. This method
133
should not be used for runtime type identification, use enum
134
{Sum}Functype and Item_func::functype()/Item_sum::sum_func()
137
virtual const char *func_name() const= 0;
138
128
virtual bool const_item() const { return const_item_cache; }
139
129
inline Item **arguments() const { return args; }
140
130
void set_arguments(List<Item> &list);
194
bool has_timestamp_args()
196
DBUG_ASSERT(fixed == TRUE);
197
for (uint i= 0; i < arg_count; i++)
199
if (args[i]->type() == Item::FIELD_ITEM &&
200
args[i]->field_type() == MYSQL_TYPE_TIMESTAMP)
208
DBUG_ASSERT(fixed == TRUE);
209
for (uint i= 0; i < arg_count; i++)
211
if (args[i]->type() == Item::FIELD_ITEM &&
212
(args[i]->field_type() == MYSQL_TYPE_DATE ||
213
args[i]->field_type() == MYSQL_TYPE_DATETIME))
221
DBUG_ASSERT(fixed == TRUE);
222
for (uint i= 0; i < arg_count; i++)
224
if (args[i]->type() == Item::FIELD_ITEM &&
225
(args[i]->field_type() == MYSQL_TYPE_TIME ||
226
args[i]->field_type() == MYSQL_TYPE_DATETIME))
232
bool has_datetime_args()
234
DBUG_ASSERT(fixed == TRUE);
235
for (uint i= 0; i < arg_count; i++)
237
if (args[i]->type() == Item::FIELD_ITEM &&
238
args[i]->field_type() == MYSQL_TYPE_DATETIME)
245
We assume the result of any function that has a TIMESTAMP argument to be
246
timezone-dependent, since a TIMESTAMP value in both numeric and string
247
contexts is interpreted according to the current timezone.
248
The only exception is UNIX_TIMESTAMP() which returns the internal
249
representation of a TIMESTAMP argument verbatim, and thus does not depend on
252
virtual bool check_valid_arguments_processor(uchar *bool_arg)
254
return has_timestamp_args();
257
virtual bool find_function_processor (uchar *arg)
259
return functype() == *(Functype *) arg;
1513
1572
join_key(0), ft_handler(0), table(0), master(0), concat_ws(0) { }
1516
DBUG_ENTER("Item_func_match");
1575
DBUG_ENTER("Item_func_match::cleanup");
1517
1576
Item_real_func::cleanup();
1518
1577
if (!master && ft_handler)
1519
1578
ft_handler->please->close_search(ft_handler);