1#ifndef ITEM_CMPFUNC_INCLUDED
2#define ITEM_CMPFUNC_INCLUDED
238 if ((*left)->is_temporal()) (*left)->cmp_context =
INT_RESULT;
239 if ((*right)->is_temporal()) (*right)->cmp_context =
INT_RESULT;
261 bool *is_null)
const;
282 const Item *warn_item,
bool *is_null){
nullptr};
287 const Item *warn_item,
bool *is_null){
nullptr};
382 const char *
func_name()
const override {
return "true"; }
397 const char *
func_name()
const override {
return "false"; }
401 str->append(
"false");
518 const char *
func_name()
const override {
return "<in_optimizer>"; }
530 virtual const char *
symbol(
bool invert)
const = 0;
539 bool eqne_op()
const override {
return true; }
540 bool l_op()
const override {
return false; }
556 const char *
symbol(
bool invert)
const override {
return invert ?
"<>" :
"="; }
565 const char *
symbol(
bool invert [[maybe_unused]])
const override {
578 const char *
symbol(
bool invert)
const override {
return invert ?
"=" :
"<>"; }
588 const char *
symbol(
bool invert)
const override {
return invert ?
"<=" :
">"; }
589 bool eqne_op()
const override {
return false; }
590 bool l_op()
const override {
return false; }
596 const char *
symbol(
bool invert)
const override {
return invert ?
">=" :
"<"; }
597 bool eqne_op()
const override {
return false; }
598 bool l_op()
const override {
return true; }
604 const char *
symbol(
bool invert)
const override {
return invert ?
"<" :
">="; }
605 bool eqne_op()
const override {
return false; }
606 bool l_op()
const override {
return false; }
612 const char *
symbol(
bool invert)
const override {
return invert ?
">" :
"<="; }
613 bool eqne_op()
const override {
return false; }
614 bool l_op()
const override {
return true; }
680 Item *
const subst)
override {
714 double rows_in_table)
override;
732 const char *
func_name()
const override {
return "xor"; }
741 double rows_in_table)
override;
751 const char *
func_name()
const override {
return "not"; }
759 double rows_in_table)
override;
780 const char *
func_name()
const override {
return "match"; }
789 double rows_in_table)
override {
791 fields_to_ignore, rows_in_table);
885 const char *
func_name()
const override {
return "<if>"; }
897 assert(
m_join !=
nullptr);
946 const char *
func_name()
const override {
return "<not>"; }
983 const char *
func_name()
const override {
return "<nop>"; }
1021 bool is_multi_column_key,
1022 String *join_key_buffer) const;
1076 double rows_in_table)
override;
1146 double rows_in_table)
override;
1202 const char *
func_name()
const override {
return "reject_if"; }
1210 double rows_in_table)
override;
1244 static constexpr double kMinSelectivityForUnknownValue = 0.2;
1258 double rows_in_table)
override;
1277 :
Item_int_func(pos, a, b, c), negated(false), pred_level(false) {
1278 if (is_negation) negate();
1282 if (is_negation) negate();
1295 Item *
const subst)
override {
1308 obj->
add_alias(
"negated", create_dom_ptr<Json_boolean>(negated));
1327 compare_as_dates_with_strings(false),
1328 compare_as_temporal_dates(false),
1329 compare_as_temporal_times(false) {}
1333 const char *
func_name()
const override {
return "between"; }
1350 double rows_in_table)
override;
1355 if (pred_level && !negated)
return;
1403 :
super(pos, alloc_row(pos,
mem_root, expr1, expr2, opt_expr_list)),
1412 const char *
func_name()
const override {
return "interval"; }
1447 double real_op()
override;
1462 const char *
func_name()
const override {
return "coalesce"; }
1473 double real_op()
override;
1493 const char *
func_name()
const override {
return "any_value"; }
1500 bool m_phase_post{
false};
1591 uint m_used_size{0};
1646 bool fill(
Item **items, uint item_count);
1672 bool find_item(
Item *item)
override;
1673 bool compare_elems(uint pos1, uint pos2)
const override;
1677 void set(uint pos,
Item *item)
override;
1678 void sort_array()
override;
1702 down_cast<Item_int *>(item)->value = base[pos].val;
1705 bool find_item(
Item *item)
override;
1706 bool compare_elems(uint pos1, uint pos2)
const override;
1709 void set(uint pos,
Item *item)
override { val_item(item, &base[pos]); }
1710 void sort_array()
override;
1711 virtual void val_item(
Item *item, packed_longlong *
result);
1723 void val_item(
Item *item, packed_longlong *
result)
override;
1735 void val_item(
Item *item, packed_longlong *
result)
override;
1754 void set(uint pos,
Item *item)
override;
1755 void val_item(
Item *item, packed_longlong *
result)
override;
1768 down_cast<Item_float *>(item)->value = base[pos];
1770 bool find_item(
Item *item)
override;
1771 bool compare_elems(uint pos1, uint pos2)
const override;
1774 void set(uint pos,
Item *item)
override;
1775 void sort_array()
override;
1788 down_cast<Item_decimal *>(item)->set_decimal_value(&base[pos]);
1790 bool find_item(
Item *item)
override;
1791 bool compare_elems(uint pos1, uint pos2)
const override;
1794 void set(uint pos,
Item *item)
override;
1795 void sort_array()
override;
1862 const cmp_item_string *l_cmp = down_cast<const cmp_item_string *>(ci);
1868 if (res && (res != &value || !res->
is_alloced())) {
1901 void store_value(
Item *item)
override;
1915 const bool rc = value != arg->
val_int();
1919 const cmp_item_int *l_cmp = down_cast<const cmp_item_int *>(ci);
1920 return (value < l_cmp->value) ? -1 : ((value == l_cmp->
value) ? 0 : 1);
1940 void store_value(
Item *item)
override;
1955 const bool rc = value != arg->
val_real();
1959 const cmp_item_real *l_cmp = down_cast<const cmp_item_real *>(ci);
1960 return (value < l_cmp->value) ? -1 : ((value == l_cmp->
value) ? 0 : 1);
1969 void store_value(
Item *item)
override;
2007 create_dom_ptr<Json_boolean>(get_first_expr_num() != -1));
2012 Item *first_expr_arg,
Item *else_expr_arg)
2020 ncases =
list->size();
2021 if (first_expr_arg) {
2022 first_expr_num =
list->size();
2023 list->push_back(first_expr_arg);
2025 if (else_expr_arg) {
2026 else_expr_num =
list->size();
2027 list->push_back(else_expr_arg);
2030 memset(&cmp_items, 0,
sizeof(cmp_items));
2081 bool have_null{
false};
2083 bool m_populated{
false};
2087 bool m_values_are_const{
true};
2089 bool m_need_populate{
false};
2095 bool dep_subq_in_list{
false};
2097 bool first_resolve_call{
true};
2106 memset(&cmp_items, 0,
sizeof(cmp_items));
2126 bool populate_bisection(
THD *thd);
2142 double rows_in_table)
override;
2146 if (pred_level && negated)
return;
2152 for (
Item **arg =
args + 1; arg != arg_end; arg++)
2163 bool list_contains_null();
2185 float get_single_col_filtering_effect(
Item_ident *fieldref,
2188 double rows_in_table);
2189 void cleanup_arrays();
2203 allocate_template_comparators(thd, item);
2208 : comparators(other.comparators),
n(other.
n) {
2209 other.comparators =
nullptr;
2214 Item *arg)
override;
2215 void store_value(
Item *item)
override;
2219 void store_value_by_template(
cmp_item *tmpl,
Item *)
override;
2231 bool allocate_template_comparators(
THD *thd,
Item *item);
2253 bool find_item(
Item *item)
override;
2254 bool compare_elems(uint pos1, uint pos2)
const override;
2265 void set(uint pos,
Item *item)
override;
2266 void sort_array()
override;
2274 bool cache_used =
false;
2292 double rows_in_table)
override;
2318 const char *
func_name()
const override {
return "<is_not_null_test>"; }
2348 const char *
func_name()
const override {
return "isnotnull"; }
2362 double rows_in_table)
override;
2367 bool escape_is_const =
false;
2369 bool escape_evaluated =
false;
2370 bool eval_escape_clause(
THD *thd);
2378 assert(escape_arg !=
nullptr);
2382 assert(escape_arg !=
nullptr);
2409 assert(escape_is_evaluated());
2424 double rows_in_table)
override;
2436 bool check_covering_prefix_keys(
THD *thd);
2464 return list.push_back(item);
2468 return list.push_front(item);
2472 list.prepend(nlist);
2483 bool eq(
const Item *item)
const override;
2495 bool truth_transform_arguments(
THD *thd,
Bool_test test);
2499 bool remove_const_conds(
THD *thd,
Item *item,
Item **new_item);
2583 bool m_always_false{
false};
2585 bool compare_as_dates{
false};
2622 bool update_const(
THD *thd);
2625 const char *
func_name()
const override {
return "multiple equal"; }
2635 return const_arg() ==
nullptr;
2653 template <
typename Node_cmp_func>
2665 return m_fields->cbegin();
2669 return m_fields->cbegin();
2672 return m_fields->cend();
2681 : m_fields(&item->fields) {}
2683 return m_fields->cbegin();
2687 return m_fields->cbegin();
2690 return m_fields->cend();
2692 size_t size()
const {
return m_fields->size(); }
2708 return fields.
head()->collation.collation;
2718 double rows_in_table)
override;
2720 Item *m_const_folding[2]{
nullptr,
nullptr};
2760 double rows_in_table)
override;
2789 double rows_in_table)
override;
2798 if (item ==
nullptr)
return nullptr;
2837 down_cast<const Item_cond *>(item)->functype() ==
2847template <
class Func>
2849 if (condition ==
nullptr) {
2851 }
else if (
IsAnd(condition)) {
2852 for (
Item &item : *down_cast<Item_cond_and *>(condition)->argument_list()) {
2859 return func(condition);
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
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:1452
int compare_time_packed()
Compare arguments using numeric packed temporal representation.
Definition: item_cmpfunc.cc:1990
void cleanup()
Definition: item_cmpfunc.cc:876
uint get_child_comparator_count() const
Definition: item_cmpfunc.h:244
int compare_int_signed_unsigned()
Compare signed (*left) with unsigned (*B)
Definition: item_cmpfunc.cc:2053
String value1
Definition: item_cmpfunc.h:168
bool set_compare_func(Item_func *owner, Item_result type)
Definition: item_cmpfunc.cc:894
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:281
int compare_int_unsigned_signed()
Compare unsigned (*left) with signed (*B)
Definition: item_cmpfunc.cc:2074
Arg_comparator * comparators
Definition: item_cmpfunc.h:145
Item_result m_compare_type
Definition: item_cmpfunc.h:291
Arg_comparator * get_child_comparators() const
Definition: item_cmpfunc.h:246
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:1190
double precision
Definition: item_cmpfunc.h:147
int compare_datetime()
Compare item values as dates.
Definition: item_cmpfunc.cc:1734
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_func * owner
Definition: item_cmpfunc.h:144
Item ** left
Definition: item_cmpfunc.h:141
Item ** get_left_ptr() const
Definition: item_cmpfunc.h:263
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:236
static arg_cmp_func comparator_matrix[5]
Definition: item_cmpfunc.h:231
bool use_custom_value_extractors() const
Definition: item_cmpfunc.h:252
int compare()
Definition: item_cmpfunc.h:211
Item_result get_compare_type() const
Definition: item_cmpfunc.h:242
int compare_int_signed()
Definition: item_cmpfunc.cc:1964
int compare_binary_string()
Compare strings byte by byte.
Definition: item_cmpfunc.cc:1893
bool set_cmp_func(Item_func *owner_arg, Item **left, Item **right, Item_result type)
Sets compare functions for various datatypes.
Definition: item_cmpfunc.cc:1260
bool compare_as_json() const
Definition: item_cmpfunc.h:248
Item * get_right() const
Definition: item_cmpfunc.h:264
int compare_json()
Compare two Item objects as JSON.
Definition: item_cmpfunc.cc:1826
int compare_real()
Definition: item_cmpfunc.cc:1911
void set_datetime_cmp_func(Item_func *owner_arg, Item **a1, Item **b1)
Definition: item_cmpfunc.cc:1610
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:1116
bool try_year_cmp_func(Item_result type)
Definition: item_cmpfunc.cc:1553
Item * right_cache
Definition: item_cmpfunc.h:150
longlong(* get_value_b_func)(THD *thd, Item ***item_arg, Item **cache_arg, const Item *warn_item, bool *is_null)
Definition: item_cmpfunc.h:286
int compare_real_fixed()
Definition: item_cmpfunc.cc:1946
longlong extract_value_from_argument(THD *thd, Item *item, bool left_argument, bool *is_null) const
Definition: item_cmpfunc.cc:8090
int compare_string()
Definition: item_cmpfunc.cc:1861
int compare_decimal()
Definition: item_cmpfunc.cc:1929
int compare_row()
Definition: item_cmpfunc.cc:2092
bool compare_null_values()
Compare NULL values for two arguments.
Definition: item_cmpfunc.cc:2186
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:2026
Abstract factory interface for creating comparison predicates.
Definition: item_cmpfunc.h:524
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:187
Definition: item_cmpfunc.h:554
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:399
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:556
Item_bool_func * combine(List< Item > list) const override
Combines a list of conditions exp op exp.
Definition: item_cmpfunc.cc:404
Definition: item_cmpfunc.h:563
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:565
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:408
Item_bool_func * combine(List< Item > list) const override
Combines a list of conditions exp op exp.
Definition: item_cmpfunc.cc:413
Definition: item_cmpfunc.h:601
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:434
bool l_op() const override
Definition: item_cmpfunc.h:606
bool eqne_op() const override
Definition: item_cmpfunc.h:605
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:604
Definition: item_cmpfunc.h:585
bool l_op() const override
Definition: item_cmpfunc.h:590
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:426
bool eqne_op() const override
Definition: item_cmpfunc.h:589
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:588
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:8055
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:3870
Base class for functions that usually take two arguments, which are possibly strings,...
Definition: item_cmpfunc.h:623
bool allow_replacement(Item_field *const original, Item *const subst) override
Check whether a function allows replacement of a field with another item: In particular,...
Definition: item_cmpfunc.h:679
bool have_rev_func() const override
Definition: item_cmpfunc.h:657
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:653
bool abort_on_null
Definition: item_cmpfunc.h:630
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:669
bool convert_constant_arg(THD *thd, Item *field, Item **item, bool *converted)
Definition: item_cmpfunc.cc:726
Item_result compare_type() const
Definition: item_cmpfunc.h:668
Arg_comparator cmp
Definition: item_cmpfunc.h:629
Item_bool_func2(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:641
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.cc:744
Item_bool_func2(Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:635
Item_bool_func2(Item *a, Item *b)
Definition: item_cmpfunc.h:632
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:650
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:665
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.h:664
Item_bool_func2(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:638
virtual enum Functype rev_functype() const
Definition: item_cmpfunc.h:656
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:671
const Arg_comparator * get_comparator() const
Definition: item_cmpfunc.h:676
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:659
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:869
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_cmpfunc.h:672
Definition: item_cmpfunc.h:294
Item_bool_func(Item *a)
Definition: item_cmpfunc.h:301
Item_bool_func(Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:306
Item_bool_func(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:312
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:348
void set_created_by_in2exists()
Definition: item_cmpfunc.cc:2193
bool created_by_in2exists() const override
Whether this Item was created by the IN->EXISTS subquery transformation.
Definition: item_cmpfunc.h:333
Item_bool_func(const POS &pos)
Definition: item_cmpfunc.h:297
Item_bool_func(THD *thd, Item_bool_func *item)
Definition: item_cmpfunc.h:320
Item_bool_func(Item *a, Item *b)
Definition: item_cmpfunc.h:309
Item_bool_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:315
uint decimal_precision() const override
Definition: item_cmpfunc.h:332
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:328
Item_bool_func(const POS &pos, Item *a)
Definition: item_cmpfunc.h:302
bool is_bool_func() const override
Definition: item_cmpfunc.h:327
Item_bool_func()
Definition: item_cmpfunc.h:296
static const Bool_test bool_transform[10][8]
Array that transforms a boolean test according to another.
Definition: item_cmpfunc.h:341
static const char * bool_transform_names[10]
Definition: item_cmpfunc.h:336
Definition: item_cmpfunc.h:2733
Item * copy_andor_structure(THD *thd) override
Definition: item_cmpfunc.h:2748
Item_cond_and(List< Item > &list_arg)
Definition: item_cmpfunc.h:2744
COND_EQUAL cond_equal
Contains list of Item_multi_eq objects for the current conjunction and references to multiple equalit...
Definition: item_cmpfunc.h:2737
const char * func_name() const override
Definition: item_cmpfunc.h:2747
enum Functype functype() const override
Definition: item_cmpfunc.h:2745
Item_cond_and()
Definition: item_cmpfunc.h:2738
Item_cond_and(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2741
Item_cond_and(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2740
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2755
Item_cond_and(THD *thd, Item_cond_and *item)
Definition: item_cmpfunc.h:2743
Definition: item_cmpfunc.h:2765
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2784
enum Functype functype() const override
Definition: item_cmpfunc.h:2774
Item_cond_or(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2769
Item * copy_andor_structure(THD *thd) override
Definition: item_cmpfunc.h:2777
Item_cond_or(List< Item > &list_arg)
Definition: item_cmpfunc.h:2773
Item_cond_or(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2770
Item_cond_or()
Definition: item_cmpfunc.h:2767
const char * func_name() const override
Definition: item_cmpfunc.h:2776
Item_cond_or(THD *thd, Item_cond_or *item)
Definition: item_cmpfunc.h:2772
Definition: item_cmpfunc.h:2439
void add_at_head(List< Item > *nlist)
Definition: item_cmpfunc.h:2470
bool add_at_head(Item *item)
Definition: item_cmpfunc.h:2466
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:2490
Item_cond(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2449
Item_bool_func super
Definition: item_cmpfunc.h:2440
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:2501
void copy_andor_arguments(THD *thd, Item_cond *item)
Definition: item_cmpfunc.cc:5700
table_map used_tables() const override
Definition: item_cmpfunc.h:2484
Item_cond(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2453
Item_cond(List< Item > &nlist)
Definition: item_cmpfunc.h:2460
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:2496
List< Item > * argument_list()
Definition: item_cmpfunc.h:2482
Type type() const override
Definition: item_cmpfunc.h:2481
Item_cond()
Definition: item_cmpfunc.h:2448
List< Item > list
Definition: item_cmpfunc.h:2443
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:2502
bool add(Item *item)
Definition: item_cmpfunc.h:2462
bool abort_on_null
Definition: item_cmpfunc.h:2444
Base class for the equality comparison operators = and <=>.
Definition: item_cmpfunc.h:995
Item_multi_eq * source_multiple_equality
If this equality originally came from a multi-equality, this documents which one it came from (otherw...
Definition: item_cmpfunc.h:1054
Item_eq_base(Item *a, Item *b)
Definition: item_cmpfunc.h:997
bool contains_only_equi_join_condition() const final
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.cc:7641
Item_eq_base(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:998
Item * create_cast_if_needed(MEM_ROOT *mem_root, Item *argument) const
Wrap the argument in a typecast, if needed.
Definition: item_cmpfunc.cc:8027
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:8001
ANY_VALUE(expr) is like expr except that it is not checked by aggregate_check logic.
Definition: item_cmpfunc.h:1489
const char * func_name() const override
Definition: item_cmpfunc.h:1493
Item_func_any_value(const POS &pos, Item *a)
Definition: item_cmpfunc.h:1491
Item_func_any_value(Item *a)
Definition: item_cmpfunc.h:1492
Definition: item_cmpfunc.h:1312
Arg_comparator ge_cmp
Definition: item_cmpfunc.h:1324
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1331
bool compare_as_dates_with_strings
Definition: item_cmpfunc.h:1319
bool is_bool_func() const override
Definition: item_cmpfunc.h:1340
Item_func_between(const POS &pos, Item *a, Item *b, Item *c, bool is_negation)
Definition: item_cmpfunc.h:1325
Item_result cmp_type
Definition: item_cmpfunc.h:1316
bool compare_as_temporal_dates
Definition: item_cmpfunc.h:1320
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:1341
String value0
Definition: item_cmpfunc.h:1317
const char * func_name() const override
Definition: item_cmpfunc.h:1333
void update_not_null_tables()
Definition: item_cmpfunc.h:1353
uint decimal_precision() const override
Definition: item_cmpfunc.h:1344
DTCollation cmp_collation
Definition: item_cmpfunc.h:1313
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1345
bool compare_as_temporal_times
Definition: item_cmpfunc.h:1321
enum Functype functype() const override
Definition: item_cmpfunc.h:1332
A predicate that is "always true" or "always false".
Definition: item_cmpfunc.h:357
Item_func_bool_const(const POS &pos)
Definition: item_cmpfunc.h:365
Item_func_bool_const()
Definition: item_cmpfunc.h:359
bool fix_fields(THD *, Item **) override
Definition: item_cmpfunc.h:371
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_cmpfunc.h:373
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:372
CASE ... WHEN ... THEN ... END function implementation.
Definition: item_cmpfunc.h:1992
Item_result cmp_type
Definition: item_cmpfunc.h:1999
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:2043
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2054
cmp_item * case_item
Definition: item_cmpfunc.h:2002
int else_expr_num
Definition: item_cmpfunc.h:1995
DTCollation cmp_collation
Definition: item_cmpfunc.h:2000
Item_func super
Definition: item_cmpfunc.h:1993
Item_func_case(const POS &pos, mem_root_deque< Item * > *list, Item *first_expr_arg, Item *else_expr_arg)
Definition: item_cmpfunc.h:2011
int get_first_expr_num() const
Definition: item_cmpfunc.h:2033
const char * func_name() const override
Definition: item_cmpfunc.h:2050
enum Item_result result_type() const override
Definition: item_cmpfunc.h:2049
enum Item_result cached_result_type left_result_type
Definition: item_cmpfunc.h:1996
uint ncases
Definition: item_cmpfunc.h:1998
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_cmpfunc.h:2005
String tmp_value
Definition: item_cmpfunc.h:1997
enum Functype functype() const override
Definition: item_cmpfunc.h:2057
int get_else_expr_num() const
Definition: item_cmpfunc.h:2034
Definition: item_cmpfunc.h:1424
Item_func_coalesce(const POS &pos, Item *a)
Definition: item_cmpfunc.h:1430
Item_func_coalesce(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1426
enum Item_result result_type() const override
Definition: item_cmpfunc.h:1461
Item_func_coalesce(Item *a, Item *b)
Definition: item_cmpfunc.h:1443
const char * func_name() const override
Definition: item_cmpfunc.h:1462
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1440
Item_func_coalesce(Item *a)
Definition: item_cmpfunc.h:1433
Item_func_coalesce(const POS &pos, PT_item_list *list)
Definition: item_cmpfunc.h:1436
enum Functype functype() const override
Definition: item_cmpfunc.h:1463
void set_numeric_type() override
Definition: item_cmpfunc.h:1460
Item_func_comparison is a class for comparison functions that take two arguments and return a boolean...
Definition: item_cmpfunc.h:695
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:707
Item_func_comparison(Item *a, Item *b)
Definition: item_cmpfunc.h:697
Item_func_comparison(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:700
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.cc:6905
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:2775
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:6782
virtual Item * negated_item()
just fake method, should never be called.
Definition: item_cmpfunc.cc:6900
bool cast_incompatible_args(uchar *) override
Wrap incompatible arguments in CAST nodes to the expected data types.
Definition: item_cmpfunc.cc:6920
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:715
Implements the comparison operator equals (=)
Definition: item_cmpfunc.h:1060
enum Functype functype() const override
Definition: item_cmpfunc.h:1065
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1067
Item_func_eq(Item *a, Item *b)
Definition: item_cmpfunc.h:1062
Item_func_eq(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1063
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1066
const char * func_name() const override
Definition: item_cmpfunc.h:1068
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:1070
The <=> operator evaluates the same as.
Definition: item_cmpfunc.h:1122
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:1140
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:1131
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1138
enum Functype functype() const override
Definition: item_cmpfunc.h:1136
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1137
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1147
const char * func_name() const override
Definition: item_cmpfunc.h:1139
Item_func_equal(Item *a, Item *b)
Definition: item_cmpfunc.h:1124
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.h:1141
Item_func_equal(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1127
A predicate that is "always false".
Definition: item_cmpfunc.h:393
longlong val_int() override
Definition: item_cmpfunc.h:399
Item_func_false()
Definition: item_cmpfunc.h:395
const char * func_name() const override
Definition: item_cmpfunc.h:397
Item_func_false(const POS &pos)
Definition: item_cmpfunc.h:396
enum Functype functype() const override
Definition: item_cmpfunc.h:403
bool val_bool() override
Definition: item_cmpfunc.h:398
void print(const THD *, String *str, enum_query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:400
Implements the comparison operator greater than or equals (>=)
Definition: item_cmpfunc.h:1153
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1158
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1159
Item_func_ge(Item *a, Item *b)
Definition: item_cmpfunc.h:1155
const char * func_name() const override
Definition: item_cmpfunc.h:1160
enum Functype functype() const override
Definition: item_cmpfunc.h:1157
Implements the comparison operator greater than (>)
Definition: item_cmpfunc.h:1167
Item_func_gt(Item *a, Item *b)
Definition: item_cmpfunc.h:1169
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1173
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1172
const char * func_name() const override
Definition: item_cmpfunc.h:1174
enum Functype functype() const override
Definition: item_cmpfunc.h:1171
Definition: item_cmpfunc.h:1503
Item_func_if(Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:1507
enum Functype functype() const override
Definition: item_cmpfunc.h:1534
enum Item_result result_type() const override
Definition: item_cmpfunc.h:1523
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1525
const char * func_name() const override
Definition: item_cmpfunc.h:1533
void update_not_null_tables()
Definition: item_cmpfunc.h:1538
enum Item_result cached_result_type
Definition: item_cmpfunc.h:1504
Item_func_if(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:1511
Definition: item_cmpfunc.h:1466
bool field_type_defined
Definition: item_cmpfunc.h:1468
Item_func_ifnull(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1471
const char * func_name() const override
Definition: item_cmpfunc.h:1480
in_expr [NOT] IN (in_value_list).
Definition: item_cmpfunc.h:2071
DTCollation cmp_collation
Definition: item_cmpfunc.h:2101
Item_func_in(const POS &pos, PT_item_list *list, bool is_negation)
Definition: item_cmpfunc.h:2104
enum Functype functype() const override
Definition: item_cmpfunc.h:2131
const char * func_name() const override
Definition: item_cmpfunc.h:2132
Item_result left_result_type
Definition: item_cmpfunc.h:2099
bool is_bool_func() const override
Definition: item_cmpfunc.h:2133
uint decimal_precision() const override
Definition: item_cmpfunc.h:2116
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2134
void update_not_null_tables()
Definition: item_cmpfunc.h:2144
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2128
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2137
Definition: item_cmpfunc.h:1393
Item_row * row
Definition: item_cmpfunc.h:1396
bool use_decimal_comparison
Definition: item_cmpfunc.h:1397
const char * func_name() const override
Definition: item_cmpfunc.h:1412
interval_range * intervals
Definition: item_cmpfunc.h:1398
uint decimal_precision() const override
Definition: item_cmpfunc.h:1413
Item_int_func super
Definition: item_cmpfunc.h:1394
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:1401
Definition: item_cmpfunc.h:2335
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2353
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:2356
const char * func_name() const override
Definition: item_cmpfunc.h:2348
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2349
Item_func_isnotnull(Item *a)
Definition: item_cmpfunc.h:2337
enum Functype functype() const override
Definition: item_cmpfunc.h:2343
Item_func_isnotnull(const POS &pos, Item *a)
Definition: item_cmpfunc.h:2338
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:2344
Definition: item_cmpfunc.h:2271
Item_func_isnull(Item *a)
Definition: item_cmpfunc.h:2278
Item_func_isnull(const POS &pos, Item *a)
Definition: item_cmpfunc.h:2279
const char * func_name() const override
Definition: item_cmpfunc.h:2285
Item_bool_func super
Definition: item_cmpfunc.h:2272
enum Functype functype() const override
Definition: item_cmpfunc.h:2283
bool cached_value
Definition: item_cmpfunc.h:2275
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2297
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2293
Implements the comparison operator less than or equals (<=)
Definition: item_cmpfunc.h:1181
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:2365
Item_func_like(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:2384
int escape() const
Returns the escape character.
Definition: item_cmpfunc.h:2408
int m_escape
The escape character (0 if no escape character).
Definition: item_cmpfunc.h:2372
enum Functype functype() const override
Definition: item_cmpfunc.h:2388
bool escape_was_used_in_parsing() const
Definition: item_cmpfunc.h:2405
Item_func_like(Item *a, Item *b, Item *escape_arg)
Definition: item_cmpfunc.h:2376
Item_func_like(Item *a, Item *b)
Definition: item_cmpfunc.h:2375
cond_result eq_cmp_result() const override
Result may be not equal with equal inputs if ESCAPE character is present.
Definition: item_cmpfunc.h:2391
const char * func_name() const override
Definition: item_cmpfunc.h:2392
bool escape_is_evaluated() const
Has the escape clause been evaluated? It only needs to be evaluated once per execution,...
Definition: item_cmpfunc.h:2419
Item_func_like(const POS &pos, Item *a, Item *b, Item *escape_arg)
Definition: item_cmpfunc.h:2380
Implements the comparison operator less than (<)
Definition: item_cmpfunc.h:1227
Item_func_lt(Item *a, Item *b)
Definition: item_cmpfunc.h:1229
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1233
enum Functype functype() const override
Definition: item_cmpfunc.h:1231
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1232
const char * func_name() const override
Definition: item_cmpfunc.h:1234
Wrapper class when MATCH function is used in WHERE clause.
Definition: item_cmpfunc.h:774
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:786
Item_func_match_predicate(Item *a)
Definition: item_cmpfunc.h:776
const char * func_name() const override
Definition: item_cmpfunc.h:780
longlong val_int() override
Definition: item_cmpfunc.cc:7315
enum Functype functype() const override
Definition: item_cmpfunc.h:779
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:781
Implements the comparison operator not equals (<>)
Definition: item_cmpfunc.h:1241
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1249
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1250
const char * func_name() const override
Definition: item_cmpfunc.h:1252
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1259
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1251
Item_func_ne(Item *a, Item *b)
Definition: item_cmpfunc.h:1246
enum Functype functype() const override
Definition: item_cmpfunc.h:1248
Definition: item_cmpfunc.h:979
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:984
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6843
Item_func_nop_all(Item *a)
Definition: item_cmpfunc.h:981
const char * func_name() const override
Definition: item_cmpfunc.h:983
longlong val_int() override
Special NOP (No OPeration) for ALL subquery.
Definition: item_cmpfunc.cc:552
Definition: item_cmpfunc.h:924
bool empty_underlying_subquery()
Definition: item_cmpfunc.cc:514
bool abort_on_null
Definition: item_cmpfunc.h:929
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:535
const char * func_name() const override
Definition: item_cmpfunc.h:946
Item_subselect * subselect
Definition: item_cmpfunc.h:928
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6853
longlong val_int() override
special NOT for ALL subquery.
Definition: item_cmpfunc.cc:500
void set_subselect(Item_subselect *item)
Definition: item_cmpfunc.h:951
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:952
void set_sum_test(Item_sum_hybrid *item)
Definition: item_cmpfunc.h:949
bool show
Definition: item_cmpfunc.h:932
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:941
enum Functype functype() const override
Definition: item_cmpfunc.h:945
void set_sub_test(Item_maxmin_subselect *item)
Definition: item_cmpfunc.h:950
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:943
Item_sum_hybrid * test_sum_item
Definition: item_cmpfunc.h:926
Item_func_not_all(Item *a)
Definition: item_cmpfunc.h:934
Item_maxmin_subselect * test_sub_item
Definition: item_cmpfunc.h:927
Definition: item_cmpfunc.h:744
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6776
enum Functype functype() const override
Definition: item_cmpfunc.h:750
const char * func_name() const override
Definition: item_cmpfunc.h:751
longlong val_int() override
Definition: item_cmpfunc.cc:468
Item_func_not(Item *a)
Definition: item_cmpfunc.h:746
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:442
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:489
Item_func_not(const POS &pos, Item *a)
Definition: item_cmpfunc.h:747
Definition: item_cmpfunc.h:1544
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1558
enum Functype functype() const override
Definition: item_cmpfunc.h:1565
Item_result result_type() const override
Definition: item_cmpfunc.h:1557
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:1580
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:1570
enum Item_result cached_result_type
Definition: item_cmpfunc.h:1545
Item_func_nullif(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1548
const char * func_name() const override
Definition: item_cmpfunc.h:1564
uint decimal_precision() const override
Definition: item_cmpfunc.h:1568
Definition: item_func.h:873
Definition: item_cmpfunc.h:1271
void negate()
Definition: item_cmpfunc.h:1286
bool ignore_unknown() const
Definition: item_cmpfunc.h:1288
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:1304
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:1289
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_cmpfunc.h:1307
bool pred_level
Definition: item_cmpfunc.h:1274
Item_func_opt_neg(const POS &pos, Item *a, Item *b, Item *c, bool is_negation)
Definition: item_cmpfunc.h:1276
bool allow_replacement(Item_field *const original, Item *const subst) override
Check whether a function allows replacement of a field with another item: In particular,...
Definition: item_cmpfunc.h:1294
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:1287
Item_func_opt_neg(const POS &pos, PT_item_list *list, bool is_negation)
Definition: item_cmpfunc.h:1280
bool negated
Definition: item_cmpfunc.h:1273
Internal function used by subquery to derived transformation to check if a subquery is scalar.
Definition: item_cmpfunc.h:1198
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:1219
const char * func_name() const override
Definition: item_cmpfunc.h:1202
bool is_valid_for_pushdown(uchar *arg) override
Redefine to avoid pushing into derived table.
Definition: item_cmpfunc.h:1204
Item_func_reject_if(Item *a)
Definition: item_cmpfunc.h:1200
Definition: item_cmpfunc.h:1364
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:1373
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:1379
const char * func_name() const override
Definition: item_cmpfunc.h:1370
Item_func_strcmp(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1366
enum Functype functype() const override
Definition: item_cmpfunc.h:1371
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1369
Definition: item_cmpfunc.h:826
bool fix_fields(THD *thd, Item **ref) override
Definition: item_cmpfunc.h:890
enum_trig_type
Definition: item_cmpfunc.h:828
@ FOUND_MATCH
This trigger type deactivates predicated from WHERE condition when no row satisfying the join conditi...
Definition: item_cmpfunc.h:843
@ IS_NOT_NULL_COMPL
This trigger type deactivates join conditions when a row has been NULL-complemented.
Definition: item_cmpfunc.h:834
@ 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:852
const char * func_name() const override
'<if>', to distinguish from the if() SQL function
Definition: item_cmpfunc.h:885
void add_trig_func_tables()
Definition: item_cmpfunc.h:895
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_cmpfunc.h:904
enum enum_trig_type get_trig_type() const
Definition: item_cmpfunc.h:914
bool contains_only_equi_join_condition() const override
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.cc:7681
Item_func_trig_cond(Item *a, bool *f, const JOIN *join, plan_idx idx, enum_trig_type trig_type_arg)
Definition: item_cmpfunc.h:875
table_map get_inner_tables() const
Get table_map of inner tables spanned by associated outer join operation.
Definition: item_cmpfunc.cc:7361
const JOIN * get_join() const
Definition: item_cmpfunc.h:913
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:7381
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:7340
bool * get_trig_var()
Definition: item_cmpfunc.h:915
plan_idx idx() const
Definition: item_cmpfunc.h:919
plan_idx m_idx
Optional: if join!=NULL: index of table.
Definition: item_cmpfunc.h:861
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:908
longlong val_int() override
Definition: item_cmpfunc.cc:7326
enum_trig_type trig_type
Type of trig_var; for printing.
Definition: item_cmpfunc.h:863
enum Functype functype() const override
Definition: item_cmpfunc.h:883
bool * trig_var
Pointer to trigger variable.
Definition: item_cmpfunc.h:857
enum_trig_type get_trig_type()
Definition: item_cmpfunc.h:916
const JOIN * m_join
Optional: JOIN of table which is the source of trig_var.
Definition: item_cmpfunc.h:859
A predicate that is "always true".
Definition: item_cmpfunc.h:378
bool val_bool() override
Definition: item_cmpfunc.h:383
enum Functype functype() const override
Definition: item_cmpfunc.h:388
Item_func_true()
Definition: item_cmpfunc.h:380
void print(const THD *, String *str, enum_query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:385
Item_func_true(const POS &pos)
Definition: item_cmpfunc.h:381
const char * func_name() const override
Definition: item_cmpfunc.h:382
longlong val_int() override
Definition: item_cmpfunc.h:384
Item class, to represent X IS [NOT] (TRUE | FALSE) boolean predicates.
Definition: item_cmpfunc.h:410
Bool_test truth_test
The value we're testing for.
Definition: item_cmpfunc.h:469
Item_bool_func super
Definition: item_cmpfunc.h:411
longlong val_int() override
Definition: item_cmpfunc.cc:2257
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:453
enum Functype functype() const override
Definition: item_cmpfunc.h:425
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:2247
Item_func_truth(const POS &pos, Item *a, Bool_test truth_test)
Definition: item_cmpfunc.h:427
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.cc:2241
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:418
Item_func_truth(Item *a, Bool_test truth_test)
Definition: item_cmpfunc.h:440
const char * func_name() const override
Definition: item_cmpfunc.h:422
XOR inherits from Item_bool_func2 because it is not optimized yet.
Definition: item_cmpfunc.h:723
Item_bool_func2 super
Definition: item_cmpfunc.h:724
const char * func_name() const override
Definition: item_cmpfunc.h:732
longlong val_int() override
Make a logical XOR of the arguments.
Definition: item_cmpfunc.cc:6735
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:6697
enum Functype functype() const override
Definition: item_cmpfunc.h:731
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:735
Item_func_xor(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:728
Item_func_xor(Item *i1, Item *i2)
Definition: item_cmpfunc.h:727
Item * truth_transformer(THD *, Bool_test) override
XOR can be negated by negating one of the operands:
Definition: item_cmpfunc.cc:6794
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_cmpfunc.cc:6682
Definition: item_func.h:100
my_decimal * val_decimal(my_decimal *) override
Definition: item_func.cc:835
Item ** args
Array of pointers to arguments.
Definition: item_func.h:107
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_func.cc:734
bool 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:723
void traverse_cond(Cond_traverser traverser, void *arg, traverse_order order) override
Definition: item_func.cc:642
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:700
Functype
Definition: item_func.h:209
@ TRIG_COND_FUNC
Definition: item_func.h:253
@ NOT_ALL_FUNC
Definition: item_func.h:250
@ LIKE_FUNC
Definition: item_func.h:220
@ FALSE_FUNC
Definition: item_func.h:333
@ NULLIF_FUNC
Definition: item_func.h:294
@ NOT_FUNC
Definition: item_func.h:249
@ XOR_FUNC
Definition: item_func.h:226
@ COND_OR_FUNC
Definition: item_func.h:225
@ COND_AND_FUNC
Definition: item_func.h:224
@ EQ_FUNC
Definition: item_func.h:211
@ TRUE_FUNC
Definition: item_func.h:332
@ IN_FUNC
Definition: item_func.h:228
@ LE_FUNC
Definition: item_func.h:215
@ MATCH_FUNC
Definition: item_func.h:219
@ MULTI_EQ_FUNC
Definition: item_func.h:229
@ LT_FUNC
Definition: item_func.h:214
@ ISNULL_FUNC
Definition: item_func.h:221
@ ISNOTNULLTEST_FUNC
Definition: item_func.h:231
@ ISTRUTH_FUNC
Definition: item_func.h:223
@ BETWEEN
Definition: item_func.h:227
@ IF_FUNC
Definition: item_func.h:293
@ STRCMP_FUNC
Definition: item_func.h:331
@ NE_FUNC
Definition: item_func.h:213
@ GE_FUNC
Definition: item_func.h:216
@ EQUAL_FUNC
Definition: item_func.h:212
@ GT_FUNC
Definition: item_func.h:217
@ UNKNOWN_FUNC
Definition: item_func.h:210
@ ISNOTNULL_FUNC
Definition: item_func.h:222
@ CASE_FUNC
Definition: item_func.h:295
@ COALESCE_FUNC
Definition: item_func.h:325
void print_op(const THD *thd, String *str, enum_query_type query_type) const
Definition: item_func.cc:764
virtual bool eq_specific(const Item *) const
Provide a more specific equality check for a function.
Definition: item_func.h:534
table_map used_tables_cache
Value used in calculation of result of used_tables()
Definition: item_func.h:193
optimize_type
Definition: item_func.h:358
@ OPTIMIZE_NONE
Definition: item_func.h:359
@ OPTIMIZE_EQUAL
Definition: item_func.h:363
@ OPTIMIZE_NULL
Definition: item_func.h:362
@ OPTIMIZE_KEY
Definition: item_func.h:360
@ OPTIMIZE_OP
Definition: item_func.h:361
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_func.cc:361
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_func.h:717
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_func.cc:748
bool fix_fields(THD *, Item **ref) override
Definition: item_func.cc:406
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:460
bool set_arguments(mem_root_deque< Item * > *list, bool context_free)
Copy arguments from list to args array.
Definition: item_func.cc:329
uint arg_count
How many arguments in 'args'.
Definition: item_func.h:130
Field * tmp_table_field(TABLE *t_arg) override
Definition: item_func.cc:793
bool eq(const Item *item) const override
Compare this item with another item for equality.
Definition: item_func.cc:777
table_map not_null_tables_cache
Value used in calculation of result of not_null_tables()
Definition: item_func.h:195
bool null_on_null
Affects how to determine that NULL argument implies a NULL function return.
Definition: item_func.h:186
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:631
Item * transform(Item_transformer transformer, uchar *arg) override
Transform an Item_func object with a transformer callback function.
Definition: item_func.cc:675
virtual bool resolve_type_inner(THD *)
Resolve type of function after all arguments have had their data types resolved.
Definition: item_func.h:514
uint allowed_arg_cols
Definition: item_func.h:191
Definition: item_cmpfunc.h:491
bool split_sum_func(THD *thd, Ref_item_array ref_item_array, mem_root_deque< Item * > *fields) override
Definition: item_cmpfunc.cc:2375
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.cc:2565
bool fix_left(THD *thd)
Definition: item_cmpfunc.cc:2290
Item_cache * cache
Definition: item_cmpfunc.h:493
const char * func_name() const override
Definition: item_cmpfunc.h:518
longlong val_int() override
The implementation of optimized <outer expression> [NOT] IN <subquery> predicates.
Definition: item_cmpfunc.cc:2472
Item_in_optimizer(Item_in_subselect *item)
Definition: item_cmpfunc.h:503
int result_for_null_param
Stores the value of "NULL IN (SELECT ...)" for uncorrelated subqueries: UNKNOWN - "NULL in (SELECT ....
Definition: item_cmpfunc.h:500
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:2364
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_cmpfunc.cc:2570
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_cmpfunc.cc:2552
Item_cache ** get_cache()
Definition: item_cmpfunc.h:519
bool fix_fields(THD *, Item **) override
Definition: item_cmpfunc.cc:2332
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:2387
Representation of IN subquery predicates of the form "left_expr IN (SELECT ...)".
Definition: item_subselect.h:592
Definition: item_func.h:1020
String * val_str(String *str) override
Definition: item_func.cc:1471
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_func.h:1068
double val_real() override
Definition: item_func.cc:1465
enum Item_result result_type() const override
Definition: item_func.h:1072
bool get_time(MYSQL_TIME *ltime) override
Definition: item_func.h:1071
Definition: item_cmpfunc.h:2310
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:2329
Item_in_subselect * owner
Definition: item_cmpfunc.h:2311
const char * func_name() const override
Definition: item_cmpfunc.h:2318
Item_is_not_null_test(Item_in_subselect *ow, Item *a)
Definition: item_cmpfunc.h:2314
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:2326
enum Functype functype() const override
Definition: item_cmpfunc.h:2316
Definition: item_subselect.h:392
Definition: item_cmpfunc.h:2678
size_t size() const
Definition: item_cmpfunc.h:2692
const List< Item_field > * m_fields
Definition: item_cmpfunc.h:2695
List_STL_Iterator< const Item_field > cend() const
Definition: item_cmpfunc.h:2689
ConstFieldProxy(const Item_multi_eq *item)
Definition: item_cmpfunc.h:2680
List_STL_Iterator< const Item_field > end() const
Definition: item_cmpfunc.h:2685
List_STL_Iterator< const Item_field > begin() const
Definition: item_cmpfunc.h:2682
List_STL_Iterator< const Item_field > cbegin() const
Definition: item_cmpfunc.h:2686
Definition: item_cmpfunc.h:2659
FieldProxy(Item_multi_eq *item)
Definition: item_cmpfunc.h:2661
List_STL_Iterator< Item_field > begin()
Definition: item_cmpfunc.h:2662
List_STL_Iterator< const Item_field > cbegin() const
Definition: item_cmpfunc.h:2668
List_STL_Iterator< const Item_field > end() const
Definition: item_cmpfunc.h:2667
List< Item_field > * m_fields
Definition: item_cmpfunc.h:2676
List_STL_Iterator< const Item_field > cend() const
Definition: item_cmpfunc.h:2671
List_STL_Iterator< const Item_field > begin() const
Definition: item_cmpfunc.h:2664
List_STL_Iterator< Item_field > end()
Definition: item_cmpfunc.h:2663
The class Item_multi_eq is used to represent conjunctions of equality predicates of the form field1 =...
Definition: item_cmpfunc.h:2573
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:2711
Item_multi_eq operator=(const Item_multi_eq &)=delete
void sort(Node_cmp_func compare)
Order field items in multiple equality according to a sorting criteria.
Definition: item_cmpfunc.h:2654
const char * func_name() const override
Definition: item_cmpfunc.h:2625
ConstFieldProxy get_fields() const
Definition: item_cmpfunc.h:2698
FieldProxy get_fields()
Definition: item_cmpfunc.h:2697
Item_multi_eq(const Item_multi_eq &&)=delete
List< Item_field > fields
List of equal field items.
Definition: item_cmpfunc.h:2575
void set_const_arg(Item *const_item)
Definition: item_cmpfunc.h:2608
bool cast_incompatible_args(uchar *) override
Wrap incompatible arguments in CAST nodes to the expected data types.
Definition: item_cmpfunc.h:2627
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2707
enum Functype functype() const override
Definition: item_cmpfunc.h:2623
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2626
void check_covering_prefix_keys()
Item_multi_eq(const Item_multi_eq &)=delete
Item_multi_eq operator=(const Item_multi_eq &&)=delete
bool contains_only_equi_join_condition() const override
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.h:2634
Item * const_arg() const
Returns the constant Item that this multi equality is equal to(if any).
Definition: item_cmpfunc.h:2607
Item_field * get_first()
Get the first field of multiple equality, use for semantic checking.
Definition: item_cmpfunc.h:2619
Arg_comparator cmp
Helper for comparing constants.
Definition: item_cmpfunc.h:2581
Field * result_field
Definition: item.h:5831
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item.cc:10763
Item which stores (x,y,...) and ROW(x,y,...).
Definition: item_row.h:54
Base class that is common to all subqueries and subquery predicates.
Definition: item_subselect.h:80
Abstract base class for the MIN and MAX aggregate functions.
Definition: item_sum.h:1530
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
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:2122
void set_nullable(bool nullable)
Definition: item.h:3687
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3583
void set_data_type_bool()
Definition: item.h:1524
virtual bool collect_item_field_or_view_ref_processor(uchar *)
Collects fields and view references that have the qualifying table in the specified query block.
Definition: item.h:2784
bool is_nullable() const
Definition: item.h:3686
void set_subquery()
Set the "has subquery" property.
Definition: item.h:3440
void fix_char_length(uint32 max_char_length_arg)
Definition: item.h:3390
virtual Item * equality_substitution_transformer(uchar *)
Definition: item.h:3004
virtual uint decimal_precision() const
Definition: item.cc:803
virtual bool val_json(Json_wrapper *result)
Get a JSON value from an Item.
Definition: item.h:2094
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:2488
bool fixed
True if item has been resolved.
Definition: item.h:3675
bool const_item() const
Returns true if item is constant, regardless of query evaluation state.
Definition: item.h:2425
bool null_value
True if item is null.
Definition: item.h:3712
Type
Definition: item.h:965
@ COND_ITEM
An AND or OR condition.
Definition: item.h:978
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:2561
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:2377
virtual TYPELIB * get_typelib() const
Get the typelib information for an item of type set or enum.
Definition: item.h:1822
bool unsigned_flag
Definition: item.h:3713
virtual bool aggregate_check_group(uchar *)
Definition: item.h:2929
virtual bool is_null()
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item.h:2542
virtual bool aggregate_check_distinct(uchar *)
Definition: item.h:2927
cond_result
Definition: item.h:993
@ COND_TRUE
Definition: item.h:993
@ COND_FALSE
Definition: item.h:993
@ COND_OK
Definition: item.h:993
traverse_order
Definition: item.h:995
Bool_test
< Modifier for result transformation
Definition: item.h:1008
@ BOOL_NOT_FALSE
Definition: item.h:1013
@ BOOL_NOT_TRUE
Definition: item.h:1012
@ BOOL_IS_TRUE
Definition: item.h:1009
@ BOOL_IS_FALSE
Definition: item.h:1010
@ BOOL_NEGATED
Definition: item.h:1016
uint32 max_length
Maximum length of result of evaluating this item, in number of bytes.
Definition: item.h:3601
virtual enum Type type() const =0
virtual uint cols() const
Definition: item.h:3175
Definition: sql_optimizer.h:133
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:367
bool add_alias(std::string_view key, Json_dom *value)
Insert the value into the object.
Definition: json_dom.h:409
A class that is capable of holding objects of any sub-type of Json_scalar.
Definition: json_dom.h:1883
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1150
Definition: item_cmpfunc.h:609
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:438
bool l_op() const override
Definition: item_cmpfunc.h:614
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:612
bool eqne_op() const override
Definition: item_cmpfunc.h:613
Abstract base class for the comparison operators =, <> and <=>.
Definition: item_cmpfunc.h:536
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:539
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:380
bool l_op() const override
Definition: item_cmpfunc.h:540
Definition: sql_list.h:680
Definition: sql_list.h:494
void sort(Node_cmp_func cmp)
Sort the list.
Definition: sql_list.h:594
T * head()
Definition: sql_list.h:520
Definition: item_cmpfunc.h:593
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:430
bool l_op() const override
Definition: item_cmpfunc.h:598
bool eqne_op() const override
Definition: item_cmpfunc.h:597
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:596
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:576
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:417
const char * symbol(bool invert) const override
This interface is only used by Item_allany_subselect.
Definition: item_cmpfunc.h:578
Item_bool_func * combine(List< Item > list) const override
Combines a list of conditions exp op exp.
Definition: item_cmpfunc.cc:422
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:231
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1159
String class wrapper with a preallocated buffer of size buff_sz.
Definition: sql_string.h:685
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
bool copy()
Definition: sql_string.cc:198
bool is_alloced() const
Definition: sql_string.h:437
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
uint elements
Definition: sql_list.h:190
Definition: item_cmpfunc.h:1930
longlong value
Definition: item_cmpfunc.h:1931
bool has_date
Distinguish between DATE/DATETIME/TIMESTAMP and TIME.
Definition: item_cmpfunc.h:1937
const Item * warn_item
Definition: item_cmpfunc.h:1935
Definition: item_cmpfunc.h:1965
my_decimal value
Definition: item_cmpfunc.h:1966
Definition: item_cmpfunc.h:1906
longlong value
Definition: item_cmpfunc.h:1907
void store_value(Item *item) override
Definition: item_cmpfunc.h:1910
int cmp(Item *arg) override
Definition: item_cmpfunc.h:1914
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1918
Definition: item_cmpfunc.h:1880
unique_ptr_destroy_only< Json_wrapper > m_value
Cached JSON value to look up.
Definition: item_cmpfunc.h:1883
~cmp_item_json() override
String m_str_value
String buffer.
Definition: item_cmpfunc.h:1887
unique_ptr_destroy_only< Json_scalar_holder > m_holder
Cache for the value above.
Definition: item_cmpfunc.h:1885
Definition: item_cmpfunc.h:1946
int cmp(Item *arg) override
Definition: item_cmpfunc.h:1954
double value
Definition: item_cmpfunc.h:1947
void store_value(Item *item) override
Definition: item_cmpfunc.h:1950
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1958
Definition: item_cmpfunc.h:2192
cmp_item_row(cmp_item_row &&other)
Definition: item_cmpfunc.h:2207
uint n
Definition: item_cmpfunc.h:2194
cmp_item_row(THD *thd, Item *item)
Definition: item_cmpfunc.h:2202
cmp_item_row()
Definition: item_cmpfunc.h:2197
cmp_item which stores a scalar (i.e. non-ROW).
Definition: item_cmpfunc.h:1846
void set_null_value(bool nv)
Definition: item_cmpfunc.h:1849
bool m_null_value
If stored value is NULL.
Definition: item_cmpfunc.h:1848
Definition: item_cmpfunc.h:1852
const String * value_res
Definition: item_cmpfunc.h:1854
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1861
cmp_item_string(const CHARSET_INFO *cs)
Definition: item_cmpfunc.h:1859
void store_value(Item *item) override
Definition: item_cmpfunc.h:1866
const CHARSET_INFO * cmp_charset
Definition: item_cmpfunc.h:1856
StringBuffer< STRING_BUFFER_USUAL_SIZE > value
Definition: item_cmpfunc.h:1855
Definition: item_cmpfunc.h:1802
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:1840
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_datetime_as_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1716
Definition: item_cmpfunc.h:1742
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1749
Item * warn_item
An item used to issue warnings.
Definition: item_cmpfunc.h:1744
in_datetime(MEM_ROOT *mem_root, Item *warn_item_arg, uint elements)
Definition: item_cmpfunc.h:1747
Definition: item_cmpfunc.h:1778
Mem_root_array< my_decimal > base
Definition: item_cmpfunc.h:1779
in_decimal(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1782
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:1787
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1784
Definition: item_cmpfunc.h:1758
in_double(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1762
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:1767
Mem_root_array< double > base
Definition: item_cmpfunc.h:1759
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1764
Definition: item_cmpfunc.h:1681
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1694
in_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1692
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:1701
void set(uint pos, Item *item) override
Definition: item_cmpfunc.h:1709
Mem_root_array< packed_longlong > base
Definition: item_cmpfunc.h:1689
Definition: item_cmpfunc.h:2234
Mem_root_array< cmp_item_row * > base_pointers
Definition: item_cmpfunc.h:2238
Mem_root_array< cmp_item_row > base_objects
Definition: item_cmpfunc.h:2236
Item_basic_constant * create_item(MEM_ROOT *) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:2256
unique_ptr_destroy_only< cmp_item_row > tmp
Definition: item_cmpfunc.h:2235
bool is_row_result() const override
Definition: item_cmpfunc.h:2242
void value_to_item(uint, Item_basic_constant *) const override
Store the value at position pos into provided item object.
Definition: item_cmpfunc.h:2260
Definition: item_cmpfunc.h:1656
Mem_root_array< String * > base_pointers
Definition: item_cmpfunc.h:1661
Mem_root_array< String > base_objects
Definition: item_cmpfunc.h:1659
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:1669
const CHARSET_INFO * collation
Definition: item_cmpfunc.h:1662
String tmp
Definition: item_cmpfunc.h:1658
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1666
Definition: item_cmpfunc.h:1726
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1730
in_time_as_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1728
Definition: item_cmpfunc.h:1587
const uint m_size
Size of the vector.
Definition: item_cmpfunc.h:1589
virtual void cleanup()
Definition: item_cmpfunc.h:1647
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:1633
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:1597
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:96
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
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
This file contains the field type.
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:55
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:71
@ MYSQL_TYPE_TIME
Definition: field_types.h:67
@ MYSQL_TYPE_DATETIME
Definition: field_types.h:68
bool(Item::* Item_analyzer)(uchar **argp)
Definition: item.h:712
void(* Cond_traverser)(const Item *item, void *arg)
Definition: item.h:722
Item *(Item::* Item_transformer)(uchar *arg)
Type for transformers used by Item::transform and Item::compile.
Definition: item.h:721
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:8127
int(Arg_comparator::* arg_cmp_func)()
Definition: item_cmpfunc.h:74
Eq_creator eq_creator
Definition: mysqld.cc:1533
Ge_creator ge_creator
Definition: mysqld.cc:1538
Item * make_condition(Parse_context *pc, Item *item)
Ensure that all expressions involved in conditions are boolean functions.
Definition: item_cmpfunc.cc:5659
void find_and_adjust_equal_fields(Item *item, table_map available_tables, bool replace, bool *found)
Definition: item_cmpfunc.cc:8108
Lt_creator lt_creator
Definition: mysqld.cc:1537
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:1002
Gt_creator gt_creator
Definition: mysqld.cc:1536
static const int UNKNOWN
Definition: item_cmpfunc.h:472
bool IsAnd(const Item *item)
Returns true if the item is a conjunction.
Definition: item_cmpfunc.h:2835
Ne_creator ne_creator
Definition: mysqld.cc:1534
Equal_creator equal_creator
Definition: mysqld.cc:1535
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:2848
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:1033
Le_creator le_creator
Definition: mysqld.cc:1539
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:1643
Item * and_conds(Item *a, Item *b)
Builds condition: (a AND b) IS TRUE.
Definition: item_cmpfunc.h:2793
String * eval_string_arg(const CHARSET_INFO *to_cs, Item *arg, String *buffer)
Definition: item_func.h:93
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:480
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:70
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: commit_order_queue.h:34
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
std::string join(const detail::range auto &rng, std::string_view delim)
join elements of a range into a string separated by a delimiter.
Definition: string.h:74
static mysql_service_status_t add(reference_caching_channel channel, const char *implementation_name) noexcept
Definition: component.cc:127
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2884
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2880
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:113
constexpr const size_t STRING_BUFFER_USUAL_SIZE
Definition: sql_const.h:126
constexpr const table_map OUTER_REF_TABLE_BIT
Definition: sql_const.h:112
enum_walk
Enumeration for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:289
bool(Item::*)(unsigned char *) Item_processor
Processor type for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:307
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:689
Definition: m_ctype.h:421
Definition: item_cmpfunc.h:2726
List< Item_multi_eq > current_level
List of multiple equalities in the current conjunction.
Definition: item_cmpfunc.h:2730
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
Bison "location" class.
Definition: parse_location.h:43
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:420
Definition: item_cmpfunc.h:1683
bool unsigned_flag
Definition: item_cmpfunc.h:1685
longlong val
Definition: item_cmpfunc.h:1684
Definition: item_cmpfunc.h:1387
Item_result type
Definition: item_cmpfunc.h:1388
double dbl
Definition: item_cmpfunc.h:1389
my_decimal dec
Definition: item_cmpfunc.h:1390
Target down_cast(Source *arg)
Casts from one pointer type to another in a type hierarchy.
Definition: template_utils.h:96
constexpr 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
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