#include <assert.h>
#include <sys/types.h>
#include <cstring>
#include <memory>
#include "field_types.h"
#include "my_alloc.h"
#include "my_compiler.h"
#include "my_inttypes.h"
#include "my_table_map.h"
#include "my_time.h"
#include "mysql/udf_registration_types.h"
#include "mysql_time.h"
#include "sql/enum_query_type.h"
#include "sql/item.h"
#include "sql/item_func.h"
#include "sql/item_row.h"
#include "sql/mem_root_array.h"
#include "sql/my_decimal.h"
#include "sql/parse_location.h"
#include "sql/sql_const.h"
#include "sql/sql_list.h"
#include "sql/table.h"
#include "sql_string.h"
#include "template_utils.h"
Go to the source code of this file.
|
Item * | make_condition (Parse_context *pc, Item *item) |
| Ensure that all expressions involved in conditions are boolean functions. More...
|
|
Item * | and_conds (Item *a, Item *b) |
| Builds condition: (a AND b) IS TRUE. More...
|
|
longlong | get_datetime_value (THD *thd, Item ***item_arg, Item **, const Item *warn_item, bool *is_null) |
| Retrieve correct DATETIME value from given item. More...
|
|
bool | get_mysql_time_from_str_no_warn (THD *thd, String *str, MYSQL_TIME *l_time, MYSQL_TIME_STATUS *status) |
| A minion of get_mysql_time_from_str, see its description. More...
|
|
bool | get_mysql_time_from_str (THD *thd, String *str, enum_mysql_timestamp_type warn_type, const char *warn_name, MYSQL_TIME *l_time) |
| Parse date provided in a string to a MYSQL_TIME. More...
|
|
void | find_and_adjust_equal_fields (Item *item, table_map available_tables, bool replace, bool *found) |
|
bool | IsAnd (const Item *item) |
| Returns true if the item is a conjunction. More...
|
|
template<class Func > |
bool | WalkConjunction (Item *condition, Func func) |
| Calls "func" on each term in "condition" if it's a conjunction (and recursively on any conjunction directly contained in it, thereby flattening nested AND structures). More...
|
|
◆ arg_cmp_func
typedef int(Arg_comparator::* arg_cmp_func) () |
◆ and_conds()
Builds condition: (a AND b) IS TRUE.
◆ find_and_adjust_equal_fields()
void find_and_adjust_equal_fields |
( |
Item * |
item, |
|
|
table_map |
available_tables, |
|
|
bool |
replace, |
|
|
bool * |
found |
|
) |
| |
◆ get_datetime_value()
Retrieve correct DATETIME value from given item.
- Parameters
-
| thd | thread handle |
| item_arg | item to retrieve DATETIME value from |
| warn_item | item for issuing the conversion warning |
[out] | is_null | true <=> the item_arg is null |
Retrieves the correct DATETIME value from given item for comparison by the compare_datetime() function. If item's result can be compared as longlong then its int value is used and its string value is used otherwise. Strings are always parsed and converted to int values by the get_date_from_str() function. This allows us to compare correctly string dates with missed insignificant zeros. In order to compare correctly DATE and DATETIME items the result of the former are treated as a DATETIME with zero time (00:00:00).
- Returns
- the DATETIME value, all ones if Item is NULL
◆ get_mysql_time_from_str()
Parse date provided in a string to a MYSQL_TIME.
- Parameters
-
[in] | thd | Thread handle |
[in] | str | A string to convert |
[in] | warn_type | Type of the timestamp for issuing the warning |
[in] | warn_name | Field name for issuing the warning |
[out] | l_time | The MYSQL_TIME objects is initialized. |
Parses a date provided in the string str into a MYSQL_TIME object. If the string contains an incorrect date or doesn't correspond to a date at all then a warning is issued. The warn_type and the warn_name arguments are used as the name and the type of the field when issuing the warning. If any input was discarded (trailing or non-timestamp-y characters), return value will be true.
- Returns
- Status flag
- Return values
-
false | Success. |
True | Indicates failure. |
◆ get_mysql_time_from_str_no_warn()
A minion of get_mysql_time_from_str, see its description.
This version doesn't issue any warnings, leaving that to its parent. This method has one extra argument which return warnings.
- Parameters
-
[in] | thd | Thread handle |
[in] | str | A string to convert |
[out] | l_time | The MYSQL_TIME objects is initialized. |
[in,out] | status | Any warnings given are returned here |
- Returns
- true if error
◆ IsAnd()
bool IsAnd |
( |
const Item * |
item | ) |
|
|
inline |
Returns true if the item is a conjunction.
◆ make_condition()
Ensure that all expressions involved in conditions are boolean functions.
Specifically, change <non-bool-expr> to (0 <> <non-bool-expr>)
- Parameters
-
pc | Parse context, including memroot for Item construction |
item | Any expression, if not a boolean expression, convert it |
- Returns
- = NULL Error <> NULL A boolean expression, possibly constructed as described above
- Note
- Due to the special conditions of a MATCH expression (it is both a function returning a floating point value and it may be used standalone in the WHERE clause), it is wrapped inside a special Item_func_match_predicate, instead of forming a non-equality.
◆ WalkConjunction()
template<class Func >
bool WalkConjunction |
( |
Item * |
condition, |
|
|
Func |
func |
|
) |
| |
Calls "func" on each term in "condition" if it's a conjunction (and recursively on any conjunction directly contained in it, thereby flattening nested AND structures).
Otherwise, calls "func" on "condition". It aborts and returns true as soon as a call to "func" returns true.
◆ eq_creator
◆ equal_creator
◆ ge_creator
◆ gt_creator
◆ le_creator
◆ lt_creator
◆ ne_creator
◆ UNKNOWN