1#ifndef ITEM_CMPFUNC_INCLUDED
2#define ITEM_CMPFUNC_INCLUDED
239 if ((*left)->is_temporal()) (*left)->cmp_context =
INT_RESULT;
240 if ((*right)->is_temporal()) (*right)->cmp_context =
INT_RESULT;
262 bool *is_null)
const;
283 const Item *warn_item,
bool *is_null){
nullptr};
288 const Item *warn_item,
bool *is_null){
nullptr};
383 const char *
func_name()
const override {
return "true"; }
398 const char *
func_name()
const override {
return "false"; }
402 str->append(
"false");
519 const char *
func_name()
const override {
return "<in_optimizer>"; }
531 virtual const char *
symbol(
bool invert)
const = 0;
540 bool eqne_op()
const override {
return true; }
541 bool l_op()
const override {
return false; }
557 const char *
symbol(
bool invert)
const override {
return invert ?
"<>" :
"="; }
566 const char *
symbol(
bool invert [[maybe_unused]])
const override {
579 const char *
symbol(
bool invert)
const override {
return invert ?
"=" :
"<>"; }
589 const char *
symbol(
bool invert)
const override {
return invert ?
"<=" :
">"; }
590 bool eqne_op()
const override {
return false; }
591 bool l_op()
const override {
return false; }
597 const char *
symbol(
bool invert)
const override {
return invert ?
">=" :
"<"; }
598 bool eqne_op()
const override {
return false; }
599 bool l_op()
const override {
return true; }
605 const char *
symbol(
bool invert)
const override {
return invert ?
"<" :
">="; }
606 bool eqne_op()
const override {
return false; }
607 bool l_op()
const override {
return false; }
613 const char *
symbol(
bool invert)
const override {
return invert ?
">" :
"<="; }
614 bool eqne_op()
const override {
return false; }
615 bool l_op()
const override {
return true; }
720 const char *
func_name()
const override {
return "xor"; }
729 double rows_in_table)
override;
739 const char *
func_name()
const override {
return "not"; }
747 double rows_in_table)
override;
768 const char *
func_name()
const override {
return "match"; }
777 double rows_in_table)
override {
779 fields_to_ignore, rows_in_table);
873 const char *
func_name()
const override {
return "<if>"; }
885 assert(
m_join !=
nullptr);
934 const char *
func_name()
const override {
return "<not>"; }
971 const char *
func_name()
const override {
return "<nop>"; }
1009 bool is_multi_column_key,
1010 String *join_key_buffer) const;
1065 double rows_in_table)
override;
1135 double rows_in_table)
override;
1155 double rows_in_table)
override;
1175 double rows_in_table)
override;
1195 double rows_in_table)
override;
1208 const char *
func_name()
const override {
return "reject_if"; }
1216 double rows_in_table)
override;
1247 double rows_in_table)
override;
1267 double rows_in_table)
override;
1285 :
Item_int_func(pos, a, b, c), negated(false), pred_level(false) {
1286 if (is_negation) negate();
1290 if (is_negation) negate();
1302 bool eq(
const Item *item,
bool binary_cmp)
const override;
1321 compare_as_dates_with_strings(false),
1322 compare_as_temporal_dates(false),
1323 compare_as_temporal_times(false) {}
1327 const char *
func_name()
const override {
return "between"; }
1344 double rows_in_table)
override;
1349 if (pred_level && !negated)
return;
1397 :
super(pos, alloc_row(pos,
mem_root, expr1, expr2, opt_expr_list)),
1406 const char *
func_name()
const override {
return "interval"; }
1441 double real_op()
override;
1456 const char *
func_name()
const override {
return "coalesce"; }
1467 double real_op()
override;
1487 const char *
func_name()
const override {
return "any_value"; }
1634 bool fill(
Item **items,
uint item_count);
1660 bool find_item(
Item *item)
override;
1661 bool compare_elems(
uint pos1,
uint pos2)
const override;
1666 void sort_array()
override;
1690 down_cast<Item_int *>(item)->value = base[pos].val;
1693 bool find_item(
Item *item)
override;
1694 bool compare_elems(
uint pos1,
uint pos2)
const override;
1697 void set(
uint pos,
Item *item)
override { val_item(item, &base[pos]); }
1698 void sort_array()
override;
1699 virtual void val_item(
Item *item, packed_longlong *
result);
1711 void val_item(
Item *item, packed_longlong *
result)
override;
1723 void val_item(
Item *item, packed_longlong *
result)
override;
1743 void val_item(
Item *item, packed_longlong *
result)
override;
1756 down_cast<Item_float *>(item)->value = base[pos];
1758 bool find_item(
Item *item)
override;
1759 bool compare_elems(
uint pos1,
uint pos2)
const override;
1763 void sort_array()
override;
1776 down_cast<Item_decimal *>(item)->set_decimal_value(&base[pos]);
1778 bool find_item(
Item *item)
override;
1779 bool compare_elems(
uint pos1,
uint pos2)
const override;
1783 void sort_array()
override;
1850 const cmp_item_string *l_cmp = down_cast<const cmp_item_string *>(ci);
1856 if (res && (res != &value || !res->
is_alloced())) {
1889 void store_value(
Item *item)
override;
1903 const bool rc = value != arg->
val_int();
1907 const cmp_item_int *l_cmp = down_cast<const cmp_item_int *>(ci);
1908 return (value < l_cmp->value) ? -1 : ((value == l_cmp->
value) ? 0 : 1);
1928 void store_value(
Item *item)
override;
1943 const bool rc = value != arg->
val_real();
1947 const cmp_item_real *l_cmp = down_cast<const cmp_item_real *>(ci);
1948 return (value < l_cmp->value) ? -1 : ((value == l_cmp->
value) ? 0 : 1);
1957 void store_value(
Item *item)
override;
1994 Item *first_expr_arg,
Item *else_expr_arg)
2002 ncases =
list->size();
2003 if (first_expr_arg) {
2004 first_expr_num =
list->size();
2005 list->push_back(first_expr_arg);
2007 if (else_expr_arg) {
2008 else_expr_num =
list->size();
2009 list->push_back(else_expr_arg);
2012 memset(&cmp_items, 0,
sizeof(cmp_items));
2063 bool have_null{
false};
2065 bool m_populated{
false};
2069 bool m_values_are_const{
true};
2071 bool m_need_populate{
false};
2077 bool dep_subq_in_list{
false};
2079 bool first_resolve_call{
true};
2088 memset(&cmp_items, 0,
sizeof(cmp_items));
2108 bool populate_bisection(
THD *thd);
2124 double rows_in_table)
override;
2128 if (pred_level && negated)
return;
2134 for (
Item **arg =
args + 1; arg != arg_end; arg++)
2145 bool list_contains_null();
2167 float get_single_col_filtering_effect(
Item_ident *fieldref,
2170 double rows_in_table);
2171 void cleanup_arrays();
2185 allocate_template_comparators(thd, item);
2190 : comparators(other.comparators),
n(other.
n) {
2191 other.comparators =
nullptr;
2196 Item *arg)
override;
2197 void store_value(
Item *item)
override;
2201 void store_value_by_template(
cmp_item *tmpl,
Item *)
override;
2213 bool allocate_template_comparators(
THD *thd,
Item *item);
2235 bool find_item(
Item *item)
override;
2236 bool compare_elems(
uint pos1,
uint pos2)
const override;
2248 void sort_array()
override;
2256 bool cache_used =
false;
2274 double rows_in_table)
override;
2300 const char *
func_name()
const override {
return "<is_not_null_test>"; }
2330 const char *
func_name()
const override {
return "isnotnull"; }
2344 double rows_in_table)
override;
2349 bool escape_is_const =
false;
2351 bool escape_evaluated =
false;
2352 bool eval_escape_clause(
THD *thd);
2360 assert(escape_arg !=
nullptr);
2364 assert(escape_arg !=
nullptr);
2391 assert(escape_is_evaluated());
2406 double rows_in_table)
override;
2418 bool check_covering_prefix_keys(
THD *thd);
2446 return list.push_back(item);
2450 return list.push_front(item);
2454 list.prepend(nlist);
2465 bool eq(
const Item *item,
bool binary_cmp)
const override;
2477 bool truth_transform_arguments(
THD *thd,
Bool_test test);
2481 bool remove_const_conds(
THD *thd,
Item *item,
Item **new_item);
2571 bool cond_false{
false};
2573 bool compare_as_dates{
false};
2584 bool compare_const(
THD *thd,
Item *c);
2598 bool update_const(
THD *thd);
2601 const char *
func_name()
const override {
return "multiple equal"; }
2611 return const_arg() ==
nullptr;
2629 template <
typename Node_cmp_func>
2641 return m_fields->cbegin();
2645 return m_fields->cbegin();
2648 return m_fields->cend();
2657 : m_fields(&item->fields) {}
2659 return m_fields->cbegin();
2663 return m_fields->cbegin();
2666 return m_fields->cend();
2668 size_t size()
const {
return m_fields->size(); }
2682 bool eq(
const Item *item,
bool binary_cmp)
const override;
2684 return fields.
head()->collation.collation;
2694 double rows_in_table)
override;
2738 double rows_in_table)
override;
2767 double rows_in_table)
override;
2776 if (item ==
nullptr)
return nullptr;
2815 down_cast<const Item_cond *>(item)->functype() ==
2825template <
class Func>
2827 if (condition ==
nullptr) {
2829 }
else if (
IsAnd(condition)) {
2830 for (
Item &item : *down_cast<Item_cond_and *>(condition)->argument_list()) {
2837 return func(condition);
Definition: item_cmpfunc.h:140
bool inject_cast_nodes()
Comparison function are expected to operate on arguments having the same data types.
Definition: item_cmpfunc.cc:1320
int compare_time_packed()
Compare arguments using numeric packed temporal representation.
Definition: item_cmpfunc.cc:1858
void cleanup()
Definition: item_cmpfunc.cc:748
uint get_child_comparator_count() const
Definition: item_cmpfunc.h:245
int compare_int_signed_unsigned()
Compare signed (*left) with unsigned (*B)
Definition: item_cmpfunc.cc:1921
String value1
Definition: item_cmpfunc.h:168
void set_datetime_cmp_func(Item_result_field *owner_arg, Item **a1, Item **b1)
Definition: item_cmpfunc.cc:1478
Item * left_cache
Definition: item_cmpfunc.h:149
longlong(* get_value_a_func)(THD *thd, Item ***item_arg, Item **cache_arg, const Item *warn_item, bool *is_null)
A function pointer that is used for retrieving the value from argument "left".
Definition: item_cmpfunc.h:282
int compare_int_unsigned_signed()
Compare unsigned (*left) with signed (*B)
Definition: item_cmpfunc.cc:1942
Arg_comparator * comparators
Definition: item_cmpfunc.h:145
Item_result m_compare_type
Definition: item_cmpfunc.h:292
Arg_comparator * get_child_comparators() const
Definition: item_cmpfunc.h:247
static bool can_compare_as_dates(const Item *a, const Item *b)
Checks whether compare_datetime() can be used to compare items.
Definition: item_cmpfunc.cc:1061
double precision
Definition: item_cmpfunc.h:147
int compare_datetime()
Compare item values as dates.
Definition: item_cmpfunc.cc:1602
uint16 comparator_count
Definition: item_cmpfunc.h:146
Item ** right
Definition: item_cmpfunc.h:142
arg_cmp_func func
Definition: item_cmpfunc.h:143
String value2
Definition: item_cmpfunc.h:168
Item ** left
Definition: item_cmpfunc.h:141
Item ** get_left_ptr() const
Definition: item_cmpfunc.h:264
Json_scalar_holder * json_scalar
Only used by compare_json() in the case where a JSON value is compared to an SQL value.
Definition: item_cmpfunc.h:163
void set_cmp_context_for_datetime()
Definition: item_cmpfunc.h:237
bool set_cmp_func(Item_result_field *owner_arg, Item **left, Item **right, Item_result type)
Sets compare functions for various datatypes.
Definition: item_cmpfunc.cc:1131
static arg_cmp_func comparator_matrix[5]
Definition: item_cmpfunc.h:232
bool use_custom_value_extractors() const
Definition: item_cmpfunc.h:253
int compare()
Definition: item_cmpfunc.h:211
Item_result get_compare_type() const
Definition: item_cmpfunc.h:243
int compare_int_signed()
Definition: item_cmpfunc.cc:1832
int compare_binary_string()
Compare strings byte by byte.
Definition: item_cmpfunc.cc:1761
bool compare_as_json() const
Definition: item_cmpfunc.h:249
Item * get_right() const
Definition: item_cmpfunc.h:265
int compare_json()
Compare two Item objects as JSON.
Definition: item_cmpfunc.cc:1694
int compare_real()
Definition: item_cmpfunc.cc:1779
bool set_null
Definition: item_cmpfunc.h:151
static bool get_date_from_const(Item *date_arg, Item *str_arg, ulonglong *const_value)
Check if str_arg is a constant and convert it to datetime packed value.
Definition: item_cmpfunc.cc:987
bool try_year_cmp_func(Item_result type)
Definition: item_cmpfunc.cc:1421
Item * right_cache
Definition: item_cmpfunc.h:150
Item_result_field * owner
Definition: item_cmpfunc.h:144
longlong(* get_value_b_func)(THD *thd, Item ***item_arg, Item **cache_arg, const Item *warn_item, bool *is_null)
Definition: item_cmpfunc.h:287
int compare_real_fixed()
Definition: item_cmpfunc.cc:1814
longlong extract_value_from_argument(THD *thd, Item *item, bool left_argument, bool *is_null) const
Definition: item_cmpfunc.cc:7873
int compare_string()
Definition: item_cmpfunc.cc:1729
int compare_decimal()
Definition: item_cmpfunc.cc:1797
int compare_row()
Definition: item_cmpfunc.cc:1960
bool compare_null_values()
Compare NULL values for two arguments.
Definition: item_cmpfunc.cc:2052
bool set_compare_func(Item_result_field *owner, Item_result type)
Definition: item_cmpfunc.cc:764
DTCollation cmp_collation
Definition: item_cmpfunc.h:166
Arg_comparator(Item **left, Item **right)
Definition: item_cmpfunc.h:172
int compare_int_unsigned()
Compare values as BIGINT UNSIGNED.
Definition: item_cmpfunc.cc:1894
Definition: item_cmpfunc.h:2701
uint max_members
Definition: item_cmpfunc.h:2703
COND_EQUAL * upper_levels
Definition: item_cmpfunc.h:2705
List< Item_equal > current_level
Definition: item_cmpfunc.h:2706
COND_EQUAL()
Definition: item_cmpfunc.h:2708
Abstract factory interface for creating comparison predicates.
Definition: item_cmpfunc.h:525
virtual ~Comp_creator()=default
virtual bool l_op() const =0
virtual bool eqne_op() const =0
virtual Item_bool_func * create(Item *a, Item *b) const =0
virtual const char * symbol(bool invert) const =0
This interface is only used by Item_allany_subselect.
const CHARSET_INFO * collation
Definition: item.h:177
Definition: item_cmpfunc.h:555
Item_bool_func * create_scalar_predicate(Item *a, Item *b) const override
Creates only an item tree node, without attempting to rewrite row constructors.
Definition: item_cmpfunc.cc:283
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:557
Item_bool_func * combine(List< Item > list) const override
Combines a list of conditions exp op exp.
Definition: item_cmpfunc.cc:288
Definition: item_cmpfunc.h:564
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:566
Item_bool_func * create_scalar_predicate(Item *a, Item *b) const override
Creates only an item tree node, without attempting to rewrite row constructors.
Definition: item_cmpfunc.cc:292
Item_bool_func * combine(List< Item > list) const override
Combines a list of conditions exp op exp.
Definition: item_cmpfunc.cc:297
Definition: item_cmpfunc.h:602
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:318
bool l_op() const override
Definition: item_cmpfunc.h:607
bool eqne_op() const override
Definition: item_cmpfunc.h:606
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:605
Definition: item_cmpfunc.h:586
bool l_op() const override
Definition: item_cmpfunc.h:591
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:310
bool eqne_op() const override
Definition: item_cmpfunc.h:590
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:589
A class that represents a join condition in a hash join.
Definition: item_cmpfunc.h:87
const size_t m_max_character_length
Definition: item_cmpfunc.h:126
const table_map m_right_used_tables
Definition: item_cmpfunc.h:120
Item_eq_base * m_join_condition
Definition: item_cmpfunc.h:112
Item * right_extractor() const
Definition: item_cmpfunc.h:94
HashJoinCondition(Item_eq_base *join_condition, MEM_ROOT *mem_root)
Definition: item_cmpfunc.cc:7838
const table_map m_left_used_tables
Definition: item_cmpfunc.h:119
bool store_full_sort_key() const
Definition: item_cmpfunc.h:105
bool left_uses_any_table(table_map tables) const
Definition: item_cmpfunc.h:95
bool m_store_full_sort_key
Definition: item_cmpfunc.h:134
Item * left_extractor() const
Definition: item_cmpfunc.h:93
Item_eq_base * join_condition() const
Definition: item_cmpfunc.h:91
bool m_null_equals_null
Definition: item_cmpfunc.h:137
Item * m_right_extractor
Definition: item_cmpfunc.h:114
bool right_uses_any_table(table_map tables) const
Definition: item_cmpfunc.h:99
Item * m_left_extractor
Definition: item_cmpfunc.h:113
size_t max_character_length() const
Definition: item_cmpfunc.h:103
bool null_equals_null() const
Returns true if this join condition evaluates to TRUE if both operands are NULL.
Definition: item_cmpfunc.h:109
void set_str_value(String *str)
Definition: item.h:3647
Base class for functions that usually take two arguments, which are possibly strings,...
Definition: item_cmpfunc.h:624
bool have_rev_func() const override
Definition: item_cmpfunc.h:658
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:654
bool abort_on_null
Definition: item_cmpfunc.h:631
void apply_is_true() override
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item_cmpfunc.h:670
bool convert_constant_arg(THD *thd, Item *field, Item **item, bool *converted)
Definition: item_cmpfunc.cc:608
Item_result compare_type() const
Definition: item_cmpfunc.h:669
Arg_comparator cmp
Definition: item_cmpfunc.h:630
Item_bool_func2(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:642
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.cc:626
Item_bool_func2(Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:636
Item_bool_func2(Item *a, Item *b)
Definition: item_cmpfunc.h:633
virtual bool set_cmp_func()
Sets up a comparator of the correct type based on the type of the function's arguments.
Definition: item_cmpfunc.h:651
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:666
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.h:665
Item_bool_func2(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:639
virtual enum Functype rev_functype() const
Definition: item_cmpfunc.h:657
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:672
const Arg_comparator * get_comparator() const
Definition: item_cmpfunc.h:677
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:660
Item * replace_scalar_subquery(uchar *) override
When walking the item tree seeing an Item_singlerow_subselect matching a target, replace it with a su...
Definition: item_cmpfunc.cc:743
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_cmpfunc.h:673
Definition: item_cmpfunc.h:295
Item_bool_func(Item *a)
Definition: item_cmpfunc.h:302
Item_bool_func(Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:307
Item_bool_func(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:313
bool m_created_by_in2exists
True <=> this item was added by IN->EXISTS subquery transformation, and should thus be deleted if we ...
Definition: item_cmpfunc.h:349
void set_created_by_in2exists()
Definition: item_cmpfunc.cc:2058
bool created_by_in2exists() const override
Whether this Item was created by the IN->EXISTS subquery transformation.
Definition: item_cmpfunc.h:334
Item_bool_func(const POS &pos)
Definition: item_cmpfunc.h:298
Item_bool_func(THD *thd, Item_bool_func *item)
Definition: item_cmpfunc.h:321
Item_bool_func(Item *a, Item *b)
Definition: item_cmpfunc.h:310
Item_bool_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:316
uint decimal_precision() const override
Definition: item_cmpfunc.h:333
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:329
Item_bool_func(const POS &pos, Item *a)
Definition: item_cmpfunc.h:303
bool is_bool_func() const override
Definition: item_cmpfunc.h:328
Item_bool_func()
Definition: item_cmpfunc.h:297
static const Bool_test bool_transform[10][8]
Array that transforms a boolean test according to another.
Definition: item_cmpfunc.h:342
static const char * bool_transform_names[10]
Definition: item_cmpfunc.h:337
Definition: item_cmpfunc.h:2711
Item * copy_andor_structure(THD *thd) override
Definition: item_cmpfunc.h:2726
Item_cond_and(List< Item > &list_arg)
Definition: item_cmpfunc.h:2722
COND_EQUAL cond_equal
Definition: item_cmpfunc.h:2713
const char * func_name() const override
Definition: item_cmpfunc.h:2725
enum Functype functype() const override
Definition: item_cmpfunc.h:2723
Item_cond_and()
Definition: item_cmpfunc.h:2716
Item_cond_and(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2719
Item_cond_and(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2718
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2733
Item_cond_and(THD *thd, Item_cond_and *item)
Definition: item_cmpfunc.h:2721
Definition: item_cmpfunc.h:2743
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2762
enum Functype functype() const override
Definition: item_cmpfunc.h:2752
Item_cond_or(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2747
Item * copy_andor_structure(THD *thd) override
Definition: item_cmpfunc.h:2755
Item_cond_or(List< Item > &list_arg)
Definition: item_cmpfunc.h:2751
Item_cond_or(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2748
Item_cond_or()
Definition: item_cmpfunc.h:2745
const char * func_name() const override
Definition: item_cmpfunc.h:2754
Item_cond_or(THD *thd, Item_cond_or *item)
Definition: item_cmpfunc.h:2750
Definition: item_cmpfunc.h:2421
void add_at_head(List< Item > *nlist)
Definition: item_cmpfunc.h:2452
bool add_at_head(Item *item)
Definition: item_cmpfunc.h:2448
void apply_is_true() override
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item_cmpfunc.h:2472
Item_cond(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2431
Item_bool_func super
Definition: item_cmpfunc.h:2422
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:2483
void copy_andor_arguments(THD *thd, Item_cond *item)
Definition: item_cmpfunc.cc:5488
table_map used_tables() const override
Definition: item_cmpfunc.h:2466
Item_cond(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2435
Item_cond(List< Item > &nlist)
Definition: item_cmpfunc.h:2442
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:2478
List< Item > * argument_list()
Definition: item_cmpfunc.h:2464
Type type() const override
Definition: item_cmpfunc.h:2463
Item_cond()
Definition: item_cmpfunc.h:2430
List< Item > list
Definition: item_cmpfunc.h:2425
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:2484
bool add(Item *item)
Definition: item_cmpfunc.h:2444
bool abort_on_null
Definition: item_cmpfunc.h:2426
Base class for the equality comparison operators = and <=>.
Definition: item_cmpfunc.h:983
Item_eq_base(Item *a, Item *b)
Definition: item_cmpfunc.h:985
Item_equal * source_multiple_equality
If this equality originally came from a multi-equality, this documents which one it came from (otherw...
Definition: item_cmpfunc.h:1042
bool contains_only_equi_join_condition() const final
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.cc:7424
Item_eq_base(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:986
Item * create_cast_if_needed(MEM_ROOT *mem_root, Item *argument) const
Wrap the argument in a typecast, if needed.
Definition: item_cmpfunc.cc:7810
bool append_join_key_for_hash_join(THD *thd, table_map tables, const HashJoinCondition &join_condition, bool is_multi_column_key, String *join_key_buffer) const
Read the value from the join condition, and append it to the output vector "join_key_buffer".
Definition: item_cmpfunc.cc:7784
Definition: item_cmpfunc.h:2654
ConstFieldProxy(const Item_equal *item)
Definition: item_cmpfunc.h:2656
List_STL_Iterator< const Item_field > cbegin() const
Definition: item_cmpfunc.h:2662
List_STL_Iterator< const Item_field > cend() const
Definition: item_cmpfunc.h:2665
List_STL_Iterator< const Item_field > begin() const
Definition: item_cmpfunc.h:2658
size_t size() const
Definition: item_cmpfunc.h:2668
const List< Item_field > * m_fields
Definition: item_cmpfunc.h:2671
List_STL_Iterator< const Item_field > end() const
Definition: item_cmpfunc.h:2661
Definition: item_cmpfunc.h:2635
List_STL_Iterator< Item_field > begin()
Definition: item_cmpfunc.h:2638
List_STL_Iterator< Item_field > end()
Definition: item_cmpfunc.h:2639
List< Item_field > * m_fields
Definition: item_cmpfunc.h:2652
List_STL_Iterator< const Item_field > begin() const
Definition: item_cmpfunc.h:2640
List_STL_Iterator< const Item_field > cbegin() const
Definition: item_cmpfunc.h:2644
List_STL_Iterator< const Item_field > cend() const
Definition: item_cmpfunc.h:2647
List_STL_Iterator< const Item_field > end() const
Definition: item_cmpfunc.h:2643
FieldProxy(Item_equal *item)
Definition: item_cmpfunc.h:2637
Definition: item_cmpfunc.h:2561
ConstFieldProxy get_fields() const
Definition: item_cmpfunc.h:2674
bool contains_only_equi_join_condition() const override
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.h:2610
void set_const_arg(Item *c)
Definition: item_cmpfunc.h:2583
void check_covering_prefix_keys()
bool cast_incompatible_args(uchar *) override
Wrap incompatible arguments in CAST nodes to the expected data types.
Definition: item_cmpfunc.h:2603
Item * const_arg() const
Definition: item_cmpfunc.h:2582
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2683
void sort(Node_cmp_func compare)
Order field items in multiple equality according to a sorting criteria.
Definition: item_cmpfunc.h:2630
Arg_comparator cmp
Helper for comparing constants.
Definition: item_cmpfunc.h:2569
Item_field * get_first()
Get the first field of multiple equality, use for semantic checking.
Definition: item_cmpfunc.h:2595
const char * func_name() const override
Definition: item_cmpfunc.h:2601
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2602
List< Item_field > fields
List of equal field items.
Definition: item_cmpfunc.h:2563
FieldProxy get_fields()
Definition: item_cmpfunc.h:2673
enum Functype functype() const override
Definition: item_cmpfunc.h:2599
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:2687
ANY_VALUE(expr) is like expr except that it is not checked by aggregate_check logic.
Definition: item_cmpfunc.h:1483
const char * func_name() const override
Definition: item_cmpfunc.h:1487
Item_func_any_value(const POS &pos, Item *a)
Definition: item_cmpfunc.h:1485
Item_func_any_value(Item *a)
Definition: item_cmpfunc.h:1486
Definition: item_cmpfunc.h:1306
Arg_comparator ge_cmp
Definition: item_cmpfunc.h:1318
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1325
bool compare_as_dates_with_strings
Definition: item_cmpfunc.h:1313
bool is_bool_func() const override
Definition: item_cmpfunc.h:1334
Item_func_between(const POS &pos, Item *a, Item *b, Item *c, bool is_negation)
Definition: item_cmpfunc.h:1319
Item_result cmp_type
Definition: item_cmpfunc.h:1310
bool compare_as_temporal_dates
Definition: item_cmpfunc.h:1314
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:1335
String value0
Definition: item_cmpfunc.h:1311
const char * func_name() const override
Definition: item_cmpfunc.h:1327
void update_not_null_tables()
Definition: item_cmpfunc.h:1347
uint decimal_precision() const override
Definition: item_cmpfunc.h:1338
DTCollation cmp_collation
Definition: item_cmpfunc.h:1307
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1339
bool compare_as_temporal_times
Definition: item_cmpfunc.h:1315
enum Functype functype() const override
Definition: item_cmpfunc.h:1326
A predicate that is "always true" or "always false".
Definition: item_cmpfunc.h:358
Item_func_bool_const(const POS &pos)
Definition: item_cmpfunc.h:366
Item_func_bool_const()
Definition: item_cmpfunc.h:360
bool fix_fields(THD *, Item **) override
Definition: item_cmpfunc.h:372
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_cmpfunc.h:374
bool basic_const_item() const override
Returns true if this is a simple constant item like an integer, not a constant expression.
Definition: item_cmpfunc.h:373
CASE ... WHEN ... THEN ... END function implementation.
Definition: item_cmpfunc.h:1980
Item_result cmp_type
Definition: item_cmpfunc.h:1987
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:2025
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2036
cmp_item * case_item
Definition: item_cmpfunc.h:1990
int else_expr_num
Definition: item_cmpfunc.h:1983
DTCollation cmp_collation
Definition: item_cmpfunc.h:1988
Item_func super
Definition: item_cmpfunc.h:1981
Item_func_case(const POS &pos, mem_root_deque< Item * > *list, Item *first_expr_arg, Item *else_expr_arg)
Definition: item_cmpfunc.h:1993
int get_first_expr_num() const
Definition: item_cmpfunc.h:2015
const char * func_name() const override
Definition: item_cmpfunc.h:2032
enum Item_result result_type() const override
Definition: item_cmpfunc.h:2031
enum Item_result cached_result_type left_result_type
Definition: item_cmpfunc.h:1984
uint ncases
Definition: item_cmpfunc.h:1986
String tmp_value
Definition: item_cmpfunc.h:1985
enum Functype functype() const override
Definition: item_cmpfunc.h:2039
int get_else_expr_num() const
Definition: item_cmpfunc.h:2016
Definition: item_cmpfunc.h:1418
Item_func_coalesce(const POS &pos, Item *a)
Definition: item_cmpfunc.h:1424
Item_func_coalesce(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1420
enum Item_result result_type() const override
Definition: item_cmpfunc.h:1455
Item_func_coalesce(Item *a, Item *b)
Definition: item_cmpfunc.h:1437
const char * func_name() const override
Definition: item_cmpfunc.h:1456
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1434
Item_func_coalesce(Item *a)
Definition: item_cmpfunc.h:1427
Item_func_coalesce(const POS &pos, PT_item_list *list)
Definition: item_cmpfunc.h:1430
enum Functype functype() const override
Definition: item_cmpfunc.h:1457
void set_numeric_type() override
Definition: item_cmpfunc.h:1454
Item_func_comparison is a class for comparison functions that take two arguments and return a boolean...
Definition: item_cmpfunc.h:688
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:700
Item_func_comparison(Item *a, Item *b)
Definition: item_cmpfunc.h:690
Item_func_comparison(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:693
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.cc:6698
Item * truth_transformer(THD *, Bool_test) override
Informs an item that it is wrapped in a truth test, in case it wants to transforms itself to implemen...
Definition: item_cmpfunc.cc:6573
virtual Item * negated_item()
just fake method, should never be called.
Definition: item_cmpfunc.cc:6693
bool cast_incompatible_args(uchar *) override
Wrap incompatible arguments in CAST nodes to the expected data types.
Definition: item_cmpfunc.cc:6713
Implements the comparison operator equals (=)
Definition: item_cmpfunc.h:1048
enum Functype functype() const override
Definition: item_cmpfunc.h:1053
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1060
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1055
Item_func_eq(Item *a, Item *b)
Definition: item_cmpfunc.h:1050
Item_func_eq(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1051
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1054
const char * func_name() const override
Definition: item_cmpfunc.h:1056
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:1058
The <=> operator evaluates the same as.
Definition: item_cmpfunc.h:1111
Item * truth_transformer(THD *, Bool_test) override
Informs an item that it is wrapped in a truth test, in case it wants to transforms itself to implemen...
Definition: item_cmpfunc.h:1129
bool set_cmp_func() override
Sets up a comparator of the correct type based on the type of the function's arguments.
Definition: item_cmpfunc.h:1120
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1127
enum Functype functype() const override
Definition: item_cmpfunc.h:1125
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1126
const char * func_name() const override
Definition: item_cmpfunc.h:1128
Item_func_equal(Item *a, Item *b)
Definition: item_cmpfunc.h:1113
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.h:1130
Item_func_equal(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1116
A predicate that is "always false".
Definition: item_cmpfunc.h:394
longlong val_int() override
Definition: item_cmpfunc.h:400
Item_func_false()
Definition: item_cmpfunc.h:396
const char * func_name() const override
Definition: item_cmpfunc.h:398
Item_func_false(const POS &pos)
Definition: item_cmpfunc.h:397
enum Functype functype() const override
Definition: item_cmpfunc.h:404
bool val_bool() override
Definition: item_cmpfunc.h:399
void print(const THD *, String *str, enum_query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:401
Implements the comparison operator greater than or equals (>=)
Definition: item_cmpfunc.h:1141
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1150
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1146
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1147
Item_func_ge(Item *a, Item *b)
Definition: item_cmpfunc.h:1143
const char * func_name() const override
Definition: item_cmpfunc.h:1148
enum Functype functype() const override
Definition: item_cmpfunc.h:1145
Implements the comparison operator greater than (>)
Definition: item_cmpfunc.h:1161
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1170
Item_func_gt(Item *a, Item *b)
Definition: item_cmpfunc.h:1163
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1167
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1166
const char * func_name() const override
Definition: item_cmpfunc.h:1168
enum Functype functype() const override
Definition: item_cmpfunc.h:1165
Definition: item_cmpfunc.h:1492
Item_func_if(Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:1496
enum Functype functype() const override
Definition: item_cmpfunc.h:1523
enum Item_result result_type() const override
Definition: item_cmpfunc.h:1512
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1514
const char * func_name() const override
Definition: item_cmpfunc.h:1522
void update_not_null_tables()
Definition: item_cmpfunc.h:1527
enum Item_result cached_result_type
Definition: item_cmpfunc.h:1493
Item_func_if(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:1500
Definition: item_cmpfunc.h:1460
bool field_type_defined
Definition: item_cmpfunc.h:1462
Item_func_ifnull(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1465
const char * func_name() const override
Definition: item_cmpfunc.h:1474
in_expr [NOT] IN (in_value_list).
Definition: item_cmpfunc.h:2053
DTCollation cmp_collation
Definition: item_cmpfunc.h:2083
Item_func_in(const POS &pos, PT_item_list *list, bool is_negation)
Definition: item_cmpfunc.h:2086
enum Functype functype() const override
Definition: item_cmpfunc.h:2113
const char * func_name() const override
Definition: item_cmpfunc.h:2114
Item_result left_result_type
Definition: item_cmpfunc.h:2081
bool is_bool_func() const override
Definition: item_cmpfunc.h:2115
uint decimal_precision() const override
Definition: item_cmpfunc.h:2098
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2116
void update_not_null_tables()
Definition: item_cmpfunc.h:2126
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2110
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2119
Definition: item_cmpfunc.h:1387
Item_row * row
Definition: item_cmpfunc.h:1390
bool use_decimal_comparison
Definition: item_cmpfunc.h:1391
const char * func_name() const override
Definition: item_cmpfunc.h:1406
interval_range * intervals
Definition: item_cmpfunc.h:1392
uint decimal_precision() const override
Definition: item_cmpfunc.h:1407
Item_int_func super
Definition: item_cmpfunc.h:1388
Item_func_interval(const POS &pos, MEM_ROOT *mem_root, Item *expr1, Item *expr2, class PT_item_list *opt_expr_list=nullptr)
Definition: item_cmpfunc.h:1395
Definition: item_cmpfunc.h:2317
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2335
void apply_is_true() override
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item_cmpfunc.h:2338
const char * func_name() const override
Definition: item_cmpfunc.h:2330
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2331
Item_func_isnotnull(Item *a)
Definition: item_cmpfunc.h:2319
enum Functype functype() const override
Definition: item_cmpfunc.h:2325
Item_func_isnotnull(const POS &pos, Item *a)
Definition: item_cmpfunc.h:2320
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:2326
Definition: item_cmpfunc.h:2253
Item_func_isnull(Item *a)
Definition: item_cmpfunc.h:2260
Item_func_isnull(const POS &pos, Item *a)
Definition: item_cmpfunc.h:2261
const char * func_name() const override
Definition: item_cmpfunc.h:2267
Item_bool_func super
Definition: item_cmpfunc.h:2254
enum Functype functype() const override
Definition: item_cmpfunc.h:2265
bool cached_value
Definition: item_cmpfunc.h:2257
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2279
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2275
Implements the comparison operator less than or equals (<=)
Definition: item_cmpfunc.h:1181
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1190
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1187
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1186
Item_func_le(Item *a, Item *b)
Definition: item_cmpfunc.h:1183
const char * func_name() const override
Definition: item_cmpfunc.h:1188
enum Functype functype() const override
Definition: item_cmpfunc.h:1185
Definition: item_cmpfunc.h:2347
Item_func_like(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:2366
int escape() const
Returns the escape character.
Definition: item_cmpfunc.h:2390
int m_escape
The escape character (0 if no escape character).
Definition: item_cmpfunc.h:2354
enum Functype functype() const override
Definition: item_cmpfunc.h:2370
bool escape_was_used_in_parsing() const
Definition: item_cmpfunc.h:2387
Item_func_like(Item *a, Item *b, Item *escape_arg)
Definition: item_cmpfunc.h:2358
Item_func_like(Item *a, Item *b)
Definition: item_cmpfunc.h:2357
cond_result eq_cmp_result() const override
Result may be not equal with equal inputs if ESCAPE character is present.
Definition: item_cmpfunc.h:2373
const char * func_name() const override
Definition: item_cmpfunc.h:2374
bool escape_is_evaluated() const
Has the escape clause been evaluated? It only needs to be evaluated once per execution,...
Definition: item_cmpfunc.h:2401
Item_func_like(const POS &pos, Item *a, Item *b, Item *escape_arg)
Definition: item_cmpfunc.h:2362
Implements the comparison operator less than (<)
Definition: item_cmpfunc.h:1233
Item_func_lt(Item *a, Item *b)
Definition: item_cmpfunc.h:1235
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1239
enum Functype functype() const override
Definition: item_cmpfunc.h:1237
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1242
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1238
const char * func_name() const override
Definition: item_cmpfunc.h:1240
Wrapper class when MATCH function is used in WHERE clause.
Definition: item_cmpfunc.h:762
float get_filtering_effect(THD *thd, table_map filter_for_table, table_map read_tables, const MY_BITMAP *fields_to_ignore, double rows_in_table) override
Calculate the filter contribution that is relevant for table 'filter_for_table' for this item.
Definition: item_cmpfunc.h:774
Item_func_match_predicate(Item *a)
Definition: item_cmpfunc.h:764
const char * func_name() const override
Definition: item_cmpfunc.h:768
longlong val_int() override
Definition: item_cmpfunc.cc:7110
enum Functype functype() const override
Definition: item_cmpfunc.h:767
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:769
Implements the comparison operator not equals (<>)
Definition: item_cmpfunc.h:1253
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1258
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1259
const char * func_name() const override
Definition: item_cmpfunc.h:1261
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1260
Item_func_ne(Item *a, Item *b)
Definition: item_cmpfunc.h:1255
enum Functype functype() const override
Definition: item_cmpfunc.h:1257
Definition: item_cmpfunc.h:967
table_map not_null_tables() const override
Return table map of tables that can't be NULL tables (tables that are used in a context where if they...
Definition: item_cmpfunc.h:972
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6634
Item_func_nop_all(Item *a)
Definition: item_cmpfunc.h:969
const char * func_name() const override
Definition: item_cmpfunc.h:971
longlong val_int() override
Special NOP (No OPeration) for ALL subquery.
Definition: item_cmpfunc.cc:434
Definition: item_cmpfunc.h:912
bool empty_underlying_subquery()
Definition: item_cmpfunc.cc:398
bool abort_on_null
Definition: item_cmpfunc.h:917
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:417
const char * func_name() const override
Definition: item_cmpfunc.h:934
Item_subselect * subselect
Definition: item_cmpfunc.h:916
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6645
longlong val_int() override
special NOT for ALL subquery.
Definition: item_cmpfunc.cc:384
void set_subselect(Item_subselect *item)
Definition: item_cmpfunc.h:939
table_map not_null_tables() const override
Return table map of tables that can't be NULL tables (tables that are used in a context where if they...
Definition: item_cmpfunc.h:940
void set_sum_test(Item_sum_hybrid *item)
Definition: item_cmpfunc.h:937
bool show
Definition: item_cmpfunc.h:920
void apply_is_true() override
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item_cmpfunc.h:929
enum Functype functype() const override
Definition: item_cmpfunc.h:933
void set_sub_test(Item_maxmin_subselect *item)
Definition: item_cmpfunc.h:938
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:931
Item_sum_hybrid * test_sum_item
Definition: item_cmpfunc.h:914
Item_func_not_all(Item *a)
Definition: item_cmpfunc.h:922
Item_maxmin_subselect * test_sub_item
Definition: item_cmpfunc.h:915
Definition: item_cmpfunc.h:732
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6567
enum Functype functype() const override
Definition: item_cmpfunc.h:738
const char * func_name() const override
Definition: item_cmpfunc.h:739
longlong val_int() override
Definition: item_cmpfunc.cc:352
Item_func_not(Item *a)
Definition: item_cmpfunc.h:734
float get_filtering_effect(THD *thd, table_map filter_for_table, table_map read_tables, const MY_BITMAP *fields_to_ignore, double rows_in_table) override
Calculate the filter contribution that is relevant for table 'filter_for_table' for this item.
Definition: item_cmpfunc.cc:326
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:373
Item_func_not(const POS &pos, Item *a)
Definition: item_cmpfunc.h:735
Definition: item_cmpfunc.h:1533
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1547
enum Functype functype() const override
Definition: item_cmpfunc.h:1553
Item_result result_type() const override
Definition: item_cmpfunc.h:1546
bool is_bool_func() const override
This is a workaround for the broken inheritance hierarchy: this should inherit from Item_func instead...
Definition: item_cmpfunc.h:1568
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:1558
enum Item_result cached_result_type
Definition: item_cmpfunc.h:1534
Item_func_nullif(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1537
const char * func_name() const override
Definition: item_cmpfunc.h:1552
uint decimal_precision() const override
Definition: item_cmpfunc.h:1556
Definition: item_func.h:788
Definition: item_cmpfunc.h:1279
void negate()
Definition: item_cmpfunc.h:1294
bool ignore_unknown() const
Definition: item_cmpfunc.h:1296
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:1303
Item * truth_transformer(THD *, Bool_test test) override
Informs an item that it is wrapped in a truth test, in case it wants to transforms itself to implemen...
Definition: item_cmpfunc.h:1297
bool pred_level
Definition: item_cmpfunc.h:1282
Item_func_opt_neg(const POS &pos, Item *a, Item *b, Item *c, bool is_negation)
Definition: item_cmpfunc.h:1284
void apply_is_true() override
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item_cmpfunc.h:1295
Item_func_opt_neg(const POS &pos, PT_item_list *list, bool is_negation)
Definition: item_cmpfunc.h:1288
bool negated
Definition: item_cmpfunc.h:1281
Internal function used by subquery to derived transformation to check if a subquery is scalar.
Definition: item_cmpfunc.h:1204
table_map get_initial_pseudo_tables() const override
We add RAND_TABLE_BIT to prevent moving this item from the JOIN condition: it might raise an error to...
Definition: item_cmpfunc.h:1225
const char * func_name() const override
Definition: item_cmpfunc.h:1208
bool is_valid_for_pushdown(uchar *arg) override
Redefine to avoid pushing into derived table.
Definition: item_cmpfunc.h:1210
Item_func_reject_if(Item *a)
Definition: item_cmpfunc.h:1206
Definition: item_cmpfunc.h:1358
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:1367
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:1373
const char * func_name() const override
Definition: item_cmpfunc.h:1364
Item_func_strcmp(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1360
enum Functype functype() const override
Definition: item_cmpfunc.h:1365
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1363
Definition: item_cmpfunc.h:814
bool fix_fields(THD *thd, Item **ref) override
Definition: item_cmpfunc.h:878
enum_trig_type
Definition: item_cmpfunc.h:816
@ FOUND_MATCH
This trigger type deactivates predicated from WHERE condition when no row satisfying the join conditi...
Definition: item_cmpfunc.h:831
@ IS_NOT_NULL_COMPL
This trigger type deactivates join conditions when a row has been NULL-complemented.
Definition: item_cmpfunc.h:822
@ OUTER_FIELD_IS_NOT_NULL
In IN->EXISTS subquery transformation, new predicates are added: WHERE inner_field=outer_field OR inn...
Definition: item_cmpfunc.h:840
const char * func_name() const override
'<if>', to distinguish from the if() SQL function
Definition: item_cmpfunc.h:873
void add_trig_func_tables()
Definition: item_cmpfunc.h:883
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_cmpfunc.h:892
enum enum_trig_type get_trig_type() const
Definition: item_cmpfunc.h:902
bool contains_only_equi_join_condition() const override
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.cc:7464
Item_func_trig_cond(Item *a, bool *f, const JOIN *join, plan_idx idx, enum_trig_type trig_type_arg)
Definition: item_cmpfunc.h:863
table_map get_inner_tables() const
Get table_map of inner tables spanned by associated outer join operation.
Definition: item_cmpfunc.cc:7156
const JOIN * get_join() const
Definition: item_cmpfunc.h:901
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:7176
void get_table_range(Table_ref **first_table, Table_ref **last_table) const
Get range of inner tables spanned by associated outer join operation.
Definition: item_cmpfunc.cc:7135
bool * get_trig_var()
Definition: item_cmpfunc.h:903
plan_idx idx() const
Definition: item_cmpfunc.h:907
plan_idx m_idx
Optional: if join!=NULL: index of table.
Definition: item_cmpfunc.h:849
void fix_after_pullout(Query_block *parent_query_block, Query_block *removed_query_block) override
Fix after tables have been moved from one query_block level to the parent level, e....
Definition: item_cmpfunc.h:896
longlong val_int() override
Definition: item_cmpfunc.cc:7121
enum_trig_type trig_type
Type of trig_var; for printing.
Definition: item_cmpfunc.h:851
enum Functype functype() const override
Definition: item_cmpfunc.h:871
bool * trig_var
Pointer to trigger variable.
Definition: item_cmpfunc.h:845
enum_trig_type get_trig_type()
Definition: item_cmpfunc.h:904
const JOIN * m_join
Optional: JOIN of table which is the source of trig_var.
Definition: item_cmpfunc.h:847
A predicate that is "always true".
Definition: item_cmpfunc.h:379
bool val_bool() override
Definition: item_cmpfunc.h:384
enum Functype functype() const override
Definition: item_cmpfunc.h:389
Item_func_true()
Definition: item_cmpfunc.h:381
void print(const THD *, String *str, enum_query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:386
Item_func_true(const POS &pos)
Definition: item_cmpfunc.h:382
const char * func_name() const override
Definition: item_cmpfunc.h:383
longlong val_int() override
Definition: item_cmpfunc.h:385
Item class, to represent X IS [NOT] (TRUE | FALSE) boolean predicates.
Definition: item_cmpfunc.h:411
Bool_test truth_test
The value we're testing for.
Definition: item_cmpfunc.h:470
Item_bool_func super
Definition: item_cmpfunc.h:412
longlong val_int() override
Definition: item_cmpfunc.cc:2122
void apply_is_true() override
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item_cmpfunc.h:454
enum Functype functype() const override
Definition: item_cmpfunc.h:426
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:2112
Item_func_truth(const POS &pos, Item *a, Bool_test truth_test)
Definition: item_cmpfunc.h:428
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.cc:2106
Item * truth_transformer(THD *, Bool_test test) override
Informs an item that it is wrapped in a truth test, in case it wants to transforms itself to implemen...
Definition: item_cmpfunc.h:419
Item_func_truth(Item *a, Bool_test truth_test)
Definition: item_cmpfunc.h:441
const char * func_name() const override
Definition: item_cmpfunc.h:423
XOR inherits from Item_bool_func2 because it is not optimized yet.
Definition: item_cmpfunc.h:711
Item_bool_func2 super
Definition: item_cmpfunc.h:712
const char * func_name() const override
Definition: item_cmpfunc.h:720
longlong val_int() override
Make a logical XOR of the arguments.
Definition: item_cmpfunc.cc:6526
float get_filtering_effect(THD *thd, table_map filter_for_table, table_map read_tables, const MY_BITMAP *fields_to_ignore, double rows_in_table) override
Calculate the filter contribution that is relevant for table 'filter_for_table' for this item.
Definition: item_cmpfunc.cc:6488
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_cmpfunc.cc:6473
enum Functype functype() const override
Definition: item_cmpfunc.h:719
void apply_is_true() override
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item_cmpfunc.h:723
Item_func_xor(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:716
Item_func_xor(Item *i1, Item *i2)
Definition: item_cmpfunc.h:715
Item * truth_transformer(THD *, Bool_test) override
XOR can be negated by negating one of the operands:
Definition: item_cmpfunc.cc:6585
Definition: item_func.h:102
my_decimal * val_decimal(my_decimal *) override
Definition: item_func.cc:813
void split_sum_func(THD *thd, Ref_item_array ref_item_array, mem_root_deque< Item * > *fields) override
See comments in Item_cmp_func::split_sum_func()
Definition: item_func.cc:704
Item ** args
Array of pointers to arguments.
Definition: item_func.h:109
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_func.cc:711
void traverse_cond(Cond_traverser traverser, void *arg, traverse_order order) override
Definition: item_func.cc:623
Item * compile(Item_analyzer analyzer, uchar **arg_p, Item_transformer transformer, uchar *arg_t) override
Compile Item_func object with a processor and a transformer callback functions.
Definition: item_func.cc:681
Functype
Definition: item_func.h:185
@ TRIG_COND_FUNC
Definition: item_func.h:228
@ NOT_ALL_FUNC
Definition: item_func.h:225
@ LIKE_FUNC
Definition: item_func.h:196
@ FALSE_FUNC
Definition: item_func.h:307
@ NULLIF_FUNC
Definition: item_func.h:269
@ NOT_FUNC
Definition: item_func.h:224
@ XOR_FUNC
Definition: item_func.h:202
@ COND_OR_FUNC
Definition: item_func.h:201
@ COND_AND_FUNC
Definition: item_func.h:200
@ EQ_FUNC
Definition: item_func.h:187
@ TRUE_FUNC
Definition: item_func.h:306
@ IN_FUNC
Definition: item_func.h:204
@ LE_FUNC
Definition: item_func.h:191
@ MATCH_FUNC
Definition: item_func.h:195
@ LT_FUNC
Definition: item_func.h:190
@ ISNULL_FUNC
Definition: item_func.h:197
@ ISNOTNULLTEST_FUNC
Definition: item_func.h:207
@ MULT_EQUAL_FUNC
Definition: item_func.h:205
@ ISTRUTH_FUNC
Definition: item_func.h:199
@ BETWEEN
Definition: item_func.h:203
@ IF_FUNC
Definition: item_func.h:268
@ STRCMP_FUNC
Definition: item_func.h:305
@ NE_FUNC
Definition: item_func.h:189
@ GE_FUNC
Definition: item_func.h:192
@ EQUAL_FUNC
Definition: item_func.h:188
@ GT_FUNC
Definition: item_func.h:193
@ UNKNOWN_FUNC
Definition: item_func.h:186
@ ISNOTNULL_FUNC
Definition: item_func.h:198
@ CASE_FUNC
Definition: item_func.h:270
@ COALESCE_FUNC
Definition: item_func.h:299
void print_op(const THD *thd, String *str, enum_query_type query_type) const
Definition: item_func.cc:740
table_map used_tables_cache
Value used in calculation of result of used_tables()
Definition: item_func.h:171
optimize_type
Definition: item_func.h:309
@ OPTIMIZE_NONE
Definition: item_func.h:310
@ OPTIMIZE_EQUAL
Definition: item_func.h:314
@ OPTIMIZE_NULL
Definition: item_func.h:313
@ OPTIMIZE_KEY
Definition: item_func.h:311
@ OPTIMIZE_OP
Definition: item_func.h:312
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_func.h:633
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_func.cc:724
bool fix_fields(THD *, Item **ref) override
Definition: item_func.cc:397
void fix_after_pullout(Query_block *parent_query_block, Query_block *removed_query_block) override
Fix after tables have been moved from one query_block level to the parent level, e....
Definition: item_func.cc:451
bool set_arguments(mem_root_deque< Item * > *list, bool context_free)
Copy arguments from list to args array.
Definition: item_func.cc:320
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_func.cc:352
uint arg_count
How many arguments in 'args'.
Definition: item_func.h:132
Field * tmp_table_field(TABLE *t_arg) override
Definition: item_func.cc:771
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_func.cc:754
table_map not_null_tables_cache
Value used in calculation of result of not_null_tables()
Definition: item_func.h:173
bool null_on_null
Affects how to determine that NULL argument implies a NULL function return.
Definition: item_func.h:164
bool walk(Item_processor processor, enum_walk walk, uchar *arg) override
Traverses a tree of Items in prefix and/or postfix order.
Definition: item_func.cc:612
Item * transform(Item_transformer transformer, uchar *arg) override
Transform an Item_func object with a transformer callback function.
Definition: item_func.cc:656
virtual bool resolve_type_inner(THD *)
Resolve type of function after all arguments have had their data types resolved.
Definition: item_func.h:465
uint allowed_arg_cols
Definition: item_func.h:169
Definition: item_cmpfunc.h:492
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.cc:2422
Item_cache * cache
Definition: item_cmpfunc.h:494
const char * func_name() const override
Definition: item_cmpfunc.h:519
longlong val_int() override
The implementation of optimized <outer expression> [NOT] IN <subquery> predicates.
Definition: item_cmpfunc.cc:2337
Item_in_optimizer(Item_in_subselect *item)
Definition: item_cmpfunc.h:504
int result_for_null_param
Stores the value of "NULL IN (SELECT ...)" for uncorrelated subqueries: UNKNOWN - "NULL in (SELECT ....
Definition: item_cmpfunc.h:501
void fix_after_pullout(Query_block *parent_query_block, Query_block *removed_query_block) override
Fix after tables have been moved from one query_block level to the parent level, e....
Definition: item_cmpfunc.cc:2234
bool fix_left(THD *thd, Item **ref)
Definition: item_cmpfunc.cc:2155
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_cmpfunc.cc:2427
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_cmpfunc.cc:2417
void split_sum_func(THD *thd, Ref_item_array ref_item_array, mem_root_deque< Item * > *fields) override
Definition: item_cmpfunc.cc:2245
Item_cache ** get_cache()
Definition: item_cmpfunc.h:520
bool fix_fields(THD *, Item **) override
Definition: item_cmpfunc.cc:2197
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:2252
Representation of IN subquery predicates of the form "left_expr IN (SELECT ...)".
Definition: item_subselect.h:526
Definition: item_func.h:935
String * val_str(String *str) override
Definition: item_func.cc:1440
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_func.h:983
double val_real() override
Definition: item_func.cc:1434
enum Item_result result_type() const override
Definition: item_func.h:987
bool get_time(MYSQL_TIME *ltime) override
Definition: item_func.h:986
Definition: item_cmpfunc.h:2292
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:2311
Item_in_subselect * owner
Definition: item_cmpfunc.h:2293
const char * func_name() const override
Definition: item_cmpfunc.h:2300
Item_is_not_null_test(Item_in_subselect *ow, Item *a)
Definition: item_cmpfunc.h:2296
table_map get_initial_pseudo_tables() const override
We add RAND_TABLE_BIT to prevent moving this item from HAVING to WHERE.
Definition: item_cmpfunc.h:2308
enum Functype functype() const override
Definition: item_cmpfunc.h:2298
Definition: item_subselect.h:371
Item with result field.
Definition: item.h:5628
Field * result_field
Definition: item.h:5630
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item.cc:10680
Item which stores (x,y,...) and ROW(x,y,...).
Definition: item_row.h:54
Definition: item_subselect.h:80
Abstract base class for the MIN and MAX aggregate functions.
Definition: item_sum.h:1536
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
virtual double val_real()=0
virtual float get_filtering_effect(THD *thd, table_map filter_for_table, table_map read_tables, const MY_BITMAP *fields_to_ignore, double rows_in_table)
Calculate the filter contribution that is relevant for table 'filter_for_table' for this item.
Definition: item.h:1957
void set_nullable(bool nullable)
Definition: item.h:3472
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3374
void set_data_type_bool()
Definition: item.h:1405
bool is_nullable() const
Definition: item.h:3471
void set_subquery()
Set the "has subquery" property.
Definition: item.h:3246
void fix_char_length(uint32 max_char_length_arg)
Definition: item.h:3196
virtual Item * equality_substitution_transformer(uchar *)
Definition: item.h:2828
virtual uint decimal_precision() const
Definition: item.cc:651
virtual bool val_json(Json_wrapper *result)
Get a JSON value from an Item.
Definition: item.h:1929
virtual longlong val_int()=0
virtual void print(const THD *, String *str, enum_query_type) const
This method is used for to:
Definition: item.h:2323
bool fixed
True if item has been resolved.
Definition: item.h:3460
bool null_value
True if item is null.
Definition: item.h:3497
Type
Definition: item.h:889
@ COND_ITEM
Definition: item.h:903
virtual void apply_is_true()
Apply the IS TRUE truth property, meaning that an UNKNOWN result and a FALSE result are treated the s...
Definition: item.h:2394
virtual table_map not_null_tables() const
Return table map of tables that can't be NULL tables (tables that are used in a context where if they...
Definition: item.h:2212
virtual TYPELIB * get_typelib() const
Get the typelib information for an item of type set or enum.
Definition: item.h:1657
bool unsigned_flag
Definition: item.h:3498
virtual bool aggregate_check_group(uchar *)
Definition: item.h:2758
virtual bool is_null()
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item.h:2375
virtual bool aggregate_check_distinct(uchar *)
Definition: item.h:2756
cond_result
Definition: item.h:922
@ COND_TRUE
Definition: item.h:922
@ COND_FALSE
Definition: item.h:922
@ COND_OK
Definition: item.h:922
traverse_order
Definition: item.h:924
Bool_test
< Modifier for result transformation
Definition: item.h:937
@ BOOL_NOT_FALSE
Definition: item.h:942
@ BOOL_NOT_TRUE
Definition: item.h:941
@ BOOL_IS_TRUE
Definition: item.h:938
@ BOOL_IS_FALSE
Definition: item.h:939
@ BOOL_NEGATED
Definition: item.h:945
uint32 max_length
Maximum length of result of evaluating this item, in number of bytes.
Definition: item.h:3392
virtual enum Type type() const =0
virtual uint cols() const
Definition: item.h:2993
Definition: sql_optimizer.h:133
A class that is capable of holding objects of any sub-type of Json_scalar.
Definition: json_dom.h:1893
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1161
Definition: item_cmpfunc.h:610
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:322
bool l_op() const override
Definition: item_cmpfunc.h:615
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:613
bool eqne_op() const override
Definition: item_cmpfunc.h:614
Abstract base class for the comparison operators =, <> and <=>.
Definition: item_cmpfunc.h:537
virtual Item_bool_func * create_scalar_predicate(Item *a, Item *b) const =0
Creates only an item tree node, without attempting to rewrite row constructors.
virtual Item_bool_func * combine(List< Item > list) const =0
Combines a list of conditions exp op exp.
bool eqne_op() const override
Definition: item_cmpfunc.h:540
Item_bool_func * create(Item *a, Item *b) const override
This implementation of the factory method also implements flattening of row constructors.
Definition: item_cmpfunc.cc:264
bool l_op() const override
Definition: item_cmpfunc.h:541
Definition: sql_list.h:620
Definition: sql_list.h:434
void sort(Node_cmp_func cmp)
Sort the list.
Definition: sql_list.h:534
T * head()
Definition: sql_list.h:460
Definition: item_cmpfunc.h:594
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:314
bool l_op() const override
Definition: item_cmpfunc.h:599
bool eqne_op() const override
Definition: item_cmpfunc.h:598
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:597
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:61
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
Definition: item_cmpfunc.h:577
Item_bool_func * create_scalar_predicate(Item *a, Item *b) const override
Creates only an item tree node, without attempting to rewrite row constructors.
Definition: item_cmpfunc.cc:301
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:579
Item_bool_func * combine(List< Item > list) const override
Combines a list of conditions exp op exp.
Definition: item_cmpfunc.cc:306
Wrapper class for an Item list head, used to allocate Item lists in the parser in a context-independe...
Definition: parse_tree_helpers.h:105
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:139
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1156
String class wrapper with a preallocated buffer of size buff_sz.
Definition: sql_string.h:660
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
bool copy()
Definition: sql_string.cc:192
bool is_alloced() const
Definition: sql_string.h:416
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
uint elements
Definition: sql_list.h:136
Definition: item_cmpfunc.h:1918
longlong value
Definition: item_cmpfunc.h:1919
bool has_date
Distinguish between DATE/DATETIME/TIMESTAMP and TIME.
Definition: item_cmpfunc.h:1925
const Item * warn_item
Definition: item_cmpfunc.h:1923
Definition: item_cmpfunc.h:1953
my_decimal value
Definition: item_cmpfunc.h:1954
Definition: item_cmpfunc.h:1894
longlong value
Definition: item_cmpfunc.h:1895
void store_value(Item *item) override
Definition: item_cmpfunc.h:1898
int cmp(Item *arg) override
Definition: item_cmpfunc.h:1902
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1906
Definition: item_cmpfunc.h:1868
unique_ptr_destroy_only< Json_wrapper > m_value
Cached JSON value to look up.
Definition: item_cmpfunc.h:1871
~cmp_item_json() override
String m_str_value
String buffer.
Definition: item_cmpfunc.h:1875
unique_ptr_destroy_only< Json_scalar_holder > m_holder
Cache for the value above.
Definition: item_cmpfunc.h:1873
Definition: item_cmpfunc.h:1934
int cmp(Item *arg) override
Definition: item_cmpfunc.h:1942
double value
Definition: item_cmpfunc.h:1935
void store_value(Item *item) override
Definition: item_cmpfunc.h:1938
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1946
Definition: item_cmpfunc.h:2174
cmp_item_row(cmp_item_row &&other)
Definition: item_cmpfunc.h:2189
uint n
Definition: item_cmpfunc.h:2176
cmp_item_row(THD *thd, Item *item)
Definition: item_cmpfunc.h:2184
cmp_item_row()
Definition: item_cmpfunc.h:2179
cmp_item which stores a scalar (i.e. non-ROW).
Definition: item_cmpfunc.h:1834
void set_null_value(bool nv)
Definition: item_cmpfunc.h:1837
bool m_null_value
If stored value is NULL.
Definition: item_cmpfunc.h:1836
Definition: item_cmpfunc.h:1840
const String * value_res
Definition: item_cmpfunc.h:1842
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1849
cmp_item_string(const CHARSET_INFO *cs)
Definition: item_cmpfunc.h:1847
void store_value(Item *item) override
Definition: item_cmpfunc.h:1854
const CHARSET_INFO * cmp_charset
Definition: item_cmpfunc.h:1844
StringBuffer< STRING_BUFFER_USUAL_SIZE > value
Definition: item_cmpfunc.h:1843
Definition: item_cmpfunc.h:1790
virtual void store_value(Item *item)=0
virtual int compare(const cmp_item *item) const =0
virtual int cmp(Item *item)=0
virtual ~cmp_item()=default
virtual cmp_item * make_same()=0
virtual void store_value_by_template(cmp_item *, Item *item)
Definition: item_cmpfunc.h:1828
Definition: item_cmpfunc.h:1702
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1706
in_datetime_as_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1704
Definition: item_cmpfunc.h:1730
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1737
Item * warn_item
An item used to issue warnings.
Definition: item_cmpfunc.h:1732
in_datetime(MEM_ROOT *mem_root, Item *warn_item_arg, uint elements)
Definition: item_cmpfunc.h:1735
Definition: item_cmpfunc.h:1766
Mem_root_array< my_decimal > base
Definition: item_cmpfunc.h:1767
in_decimal(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1770
void value_to_item(uint pos, Item_basic_constant *item) const override
Store the value at position pos into provided item object.
Definition: item_cmpfunc.h:1775
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1772
Definition: item_cmpfunc.h:1746
in_double(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1750
void value_to_item(uint pos, Item_basic_constant *item) const override
Store the value at position pos into provided item object.
Definition: item_cmpfunc.h:1755
Mem_root_array< double > base
Definition: item_cmpfunc.h:1747
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1752
Definition: item_cmpfunc.h:1669
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1682
in_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1680
void value_to_item(uint pos, Item_basic_constant *item) const override
Store the value at position pos into provided item object.
Definition: item_cmpfunc.h:1689
void set(uint pos, Item *item) override
Definition: item_cmpfunc.h:1697
Mem_root_array< packed_longlong > base
Definition: item_cmpfunc.h:1677
Definition: item_cmpfunc.h:2216
Mem_root_array< cmp_item_row * > base_pointers
Definition: item_cmpfunc.h:2220
Mem_root_array< cmp_item_row > base_objects
Definition: item_cmpfunc.h:2218
Item_basic_constant * create_item(MEM_ROOT *) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:2238
unique_ptr_destroy_only< cmp_item_row > tmp
Definition: item_cmpfunc.h:2217
bool is_row_result() const override
Definition: item_cmpfunc.h:2224
void value_to_item(uint, Item_basic_constant *) const override
Store the value at position pos into provided item object.
Definition: item_cmpfunc.h:2242
Definition: item_cmpfunc.h:1644
Mem_root_array< String * > base_pointers
Definition: item_cmpfunc.h:1649
Mem_root_array< String > base_objects
Definition: item_cmpfunc.h:1647
void value_to_item(uint pos, Item_basic_constant *item) const override
Store the value at position pos into provided item object.
Definition: item_cmpfunc.h:1657
const CHARSET_INFO * collation
Definition: item_cmpfunc.h:1650
String tmp
Definition: item_cmpfunc.h:1646
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1654
Definition: item_cmpfunc.h:1714
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1718
in_time_as_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1716
Definition: item_cmpfunc.h:1575
const uint m_size
Size of the vector.
Definition: item_cmpfunc.h:1577
virtual void cleanup()
Definition: item_cmpfunc.h:1635
virtual void set(uint pos, Item *item)=0
virtual void value_to_item(uint pos, Item_basic_constant *item) const =0
Store the value at position pos into provided item object.
virtual ~in_vector()=default
virtual bool find_item(Item *item)=0
Calls item->val_int() or item->val_str() etc.
virtual bool is_row_result() const
Definition: item_cmpfunc.h:1621
virtual bool compare_elems(uint pos1, uint pos2) const =0
Compare values number pos1 and pos2 for equality.
virtual Item_basic_constant * create_item(MEM_ROOT *mem_root) const =0
Create an instance of Item_{type} (e.g.
virtual void sort_array()=0
Sort the IN-list array, so we can do efficient lookup with binary_search.
in_vector(uint elements)
See Item_func_in::resolve_type() for why we need both count and used_count.
Definition: item_cmpfunc.h:1585
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:110
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:94
static MEM_ROOT mem_root
Definition: client_plugin.cc:110
static bool contains(const std::vector< std::string > &container, const std::string &file)
Definition: config_files.cc:41
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:31
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
This file contains the field type.
enum_field_types
Column types for MySQL.
Definition: field_types.h:53
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:69
@ MYSQL_TYPE_TIME
Definition: field_types.h:65
@ MYSQL_TYPE_DATETIME
Definition: field_types.h:66
bool(Item::* Item_analyzer)(uchar **argp)
Definition: item.h:714
void(* Cond_traverser)(const Item *item, void *arg)
Definition: item.h:724
Item *(Item::* Item_transformer)(uchar *arg)
Type for transformers used by Item::transform and Item::compile.
Definition: item.h:723
static void ensure_multi_equality_fields_are_available(Item **args, int arg_idx, table_map available_tables, bool replace, bool *found)
Definition: item_cmpfunc.cc:7910
int(Arg_comparator::* arg_cmp_func)()
Definition: item_cmpfunc.h:74
Eq_creator eq_creator
Definition: mysqld.cc:1525
Ge_creator ge_creator
Definition: mysqld.cc:1530
Item * make_condition(Parse_context *pc, Item *item)
Ensure that all expressions involved in conditions are boolean functions.
Definition: item_cmpfunc.cc:5447
void find_and_adjust_equal_fields(Item *item, table_map available_tables, bool replace, bool *found)
Definition: item_cmpfunc.cc:7891
Lt_creator lt_creator
Definition: mysqld.cc:1529
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.
Definition: item_cmpfunc.cc:873
Gt_creator gt_creator
Definition: mysqld.cc:1528
static const int UNKNOWN
Definition: item_cmpfunc.h:473
bool IsAnd(const Item *item)
Returns true if the item is a conjunction.
Definition: item_cmpfunc.h:2813
Ne_creator ne_creator
Definition: mysqld.cc:1526
Equal_creator equal_creator
Definition: mysqld.cc:1527
bool WalkConjunction(Item *condition, Func func)
Calls "func" on each term in "condition" if it's a conjunction (and recursively on any conjunction di...
Definition: item_cmpfunc.h:2826
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.
Definition: item_cmpfunc.cc:904
Le_creator le_creator
Definition: mysqld.cc:1531
longlong get_datetime_value(THD *thd, Item ***item_arg, Item **, const Item *warn_item, bool *is_null)
Retrieve correct DATETIME value from given item.
Definition: item_cmpfunc.cc:1511
Item * and_conds(Item *a, Item *b)
Builds condition: (a AND b) IS TRUE.
Definition: item_cmpfunc.h:2771
String * eval_string_arg(const CHARSET_INFO *to_cs, Item *arg, String *buffer)
Definition: item_func.h:95
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
std::unique_ptr< T, Destroy_only< T > > unique_ptr_destroy_only
std::unique_ptr, but only destroying.
Definition: my_alloc.h:489
Header for compiler-dependent features.
It is interface module to fixed precision decimals library.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
uint16_t uint16
Definition: my_inttypes.h:65
uint64_t table_map
Definition: my_table_map.h:30
Interface for low level time utilities.
unsigned int my_time_flags_t
Flags to str_to_datetime and number_to_datetime.
Definition: my_time.h:94
Time declarations shared between the server and client API: you should not add anything to this heade...
enum_mysql_timestamp_type
Definition: mysql_time.h:45
static bool replace
Definition: mysqlimport.cc:66
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
Definition: commit_order_queue.h:34
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
std::string join(Container cont, const std::string &delim)
join elements of an container into a string separated by a delimiter.
Definition: string.h:151
static mysql_service_status_t add(reference_caching_channel channel, const char *implementation_name) noexcept
Definition: component.cc:135
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2883
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2879
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:61
required string type
Definition: replication_group_member_actions.proto:34
static int compare(size_t a, size_t b)
Function to compare two size_t integers for their relative order.
Definition: rpl_utility.cc:107
File containing constants that can be used throughout the server.
constexpr const table_map RAND_TABLE_BIT
Definition: sql_const.h:111
constexpr const size_t STRING_BUFFER_USUAL_SIZE
Definition: sql_const.h:124
constexpr const table_map OUTER_REF_TABLE_BIT
Definition: sql_const.h:110
enum_walk
Enumeration for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:286
bool(Item::*)(unsigned char *) Item_processor
Processor type for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:304
int plan_idx
This represents the index of a JOIN_TAB/QEP_TAB in an array.
Definition: sql_opt_exec_shared.h:54
Our own string classes, used pervasively throughout the executor.
int sortcmp(const String *a, const String *b, const CHARSET_INFO *cs)
Definition: sql_string.cc:682
Definition: m_ctype.h:385
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Structure to return status from str_to_datetime(), str_to_time(), number_to_datetime(),...
Definition: my_time.h:170
Definition: mysql_time.h:82
Definition: my_bitmap.h:43
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:121
Bison "location" class.
Definition: parse_location.h:43
Definition: item_cmpfunc.h:1671
bool unsigned_flag
Definition: item_cmpfunc.h:1673
longlong val
Definition: item_cmpfunc.h:1672
Definition: item_cmpfunc.h:1381
Item_result type
Definition: item_cmpfunc.h:1382
double dbl
Definition: item_cmpfunc.h:1383
my_decimal dec
Definition: item_cmpfunc.h:1384
Target down_cast(Source *arg)
Casts from one pointer type to another in a type hierarchy.
Definition: template_utils.h:96
T pointer_cast(void *p)
Casts from one pointer type, to another, without using reinterpret_cast or C-style cast: foo f; bar *...
Definition: template_utils.h:75
unsigned int uint
Definition: uca9-dump.cc:75
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
@ INT_RESULT
double
Definition: udf_registration_types.h:43
@ INVALID_RESULT
Definition: udf_registration_types.h:40
int n
Definition: xcom_base.cc:509