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; }
681 Item *
const subst)
override {
728 const char *
func_name()
const override {
return "xor"; }
737 double rows_in_table)
override;
747 const char *
func_name()
const override {
return "not"; }
755 double rows_in_table)
override;
776 const char *
func_name()
const override {
return "match"; }
785 double rows_in_table)
override {
787 fields_to_ignore, rows_in_table);
881 const char *
func_name()
const override {
return "<if>"; }
893 assert(
m_join !=
nullptr);
942 const char *
func_name()
const override {
return "<not>"; }
979 const char *
func_name()
const override {
return "<nop>"; }
1017 bool is_multi_column_key,
1018 String *join_key_buffer) const;
1073 double rows_in_table)
override;
1143 double rows_in_table)
override;
1154 double rows_in_table)
override;
1211 const char *
func_name()
const override {
return "reject_if"; }
1219 double rows_in_table)
override;
1253 static constexpr double kMinSelectivityForUnknownValue = 0.2;
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();
1303 Item *
const subst)
override {
1311 bool eq(
const Item *item,
bool binary_cmp)
const override;
1316 obj->
add_alias(
"negated", create_dom_ptr<Json_boolean>(negated));
1335 compare_as_dates_with_strings(false),
1336 compare_as_temporal_dates(false),
1337 compare_as_temporal_times(false) {}
1341 const char *
func_name()
const override {
return "between"; }
1358 double rows_in_table)
override;
1363 if (pred_level && !negated)
return;
1411 :
super(pos, alloc_row(pos,
mem_root, expr1, expr2, opt_expr_list)),
1420 const char *
func_name()
const override {
return "interval"; }
1455 double real_op()
override;
1470 const char *
func_name()
const override {
return "coalesce"; }
1481 double real_op()
override;
1501 const char *
func_name()
const override {
return "any_value"; }
1508 bool m_phase_post{
false};
1599 uint m_used_size{0};
1654 bool fill(
Item **items, uint item_count);
1680 bool find_item(
Item *item)
override;
1681 bool compare_elems(uint pos1, uint pos2)
const override;
1685 void set(uint pos,
Item *item)
override;
1686 void sort_array()
override;
1710 down_cast<Item_int *>(item)->value = base[pos].val;
1713 bool find_item(
Item *item)
override;
1714 bool compare_elems(uint pos1, uint pos2)
const override;
1717 void set(uint pos,
Item *item)
override { val_item(item, &base[pos]); }
1718 void sort_array()
override;
1719 virtual void val_item(
Item *item, packed_longlong *
result);
1731 void val_item(
Item *item, packed_longlong *
result)
override;
1743 void val_item(
Item *item, packed_longlong *
result)
override;
1762 void set(uint pos,
Item *item)
override;
1763 void val_item(
Item *item, packed_longlong *
result)
override;
1776 down_cast<Item_float *>(item)->value = base[pos];
1778 bool find_item(
Item *item)
override;
1779 bool compare_elems(uint pos1, uint pos2)
const override;
1782 void set(uint pos,
Item *item)
override;
1783 void sort_array()
override;
1796 down_cast<Item_decimal *>(item)->set_decimal_value(&base[pos]);
1798 bool find_item(
Item *item)
override;
1799 bool compare_elems(uint pos1, uint pos2)
const override;
1802 void set(uint pos,
Item *item)
override;
1803 void sort_array()
override;
1870 const cmp_item_string *l_cmp = down_cast<const cmp_item_string *>(ci);
1876 if (res && (res != &value || !res->
is_alloced())) {
1909 void store_value(
Item *item)
override;
1923 const bool rc = value != arg->
val_int();
1927 const cmp_item_int *l_cmp = down_cast<const cmp_item_int *>(ci);
1928 return (value < l_cmp->value) ? -1 : ((value == l_cmp->
value) ? 0 : 1);
1948 void store_value(
Item *item)
override;
1963 const bool rc = value != arg->
val_real();
1967 const cmp_item_real *l_cmp = down_cast<const cmp_item_real *>(ci);
1968 return (value < l_cmp->value) ? -1 : ((value == l_cmp->
value) ? 0 : 1);
1977 void store_value(
Item *item)
override;
2015 create_dom_ptr<Json_boolean>(get_first_expr_num() != -1));
2020 Item *first_expr_arg,
Item *else_expr_arg)
2028 ncases =
list->size();
2029 if (first_expr_arg) {
2030 first_expr_num =
list->size();
2031 list->push_back(first_expr_arg);
2033 if (else_expr_arg) {
2034 else_expr_num =
list->size();
2035 list->push_back(else_expr_arg);
2038 memset(&cmp_items, 0,
sizeof(cmp_items));
2089 bool have_null{
false};
2091 bool m_populated{
false};
2095 bool m_values_are_const{
true};
2097 bool m_need_populate{
false};
2103 bool dep_subq_in_list{
false};
2105 bool first_resolve_call{
true};
2114 memset(&cmp_items, 0,
sizeof(cmp_items));
2134 bool populate_bisection(
THD *thd);
2150 double rows_in_table)
override;
2154 if (pred_level && negated)
return;
2160 for (
Item **arg =
args + 1; arg != arg_end; arg++)
2171 bool list_contains_null();
2193 float get_single_col_filtering_effect(
Item_ident *fieldref,
2196 double rows_in_table);
2197 void cleanup_arrays();
2211 allocate_template_comparators(thd, item);
2216 : comparators(other.comparators),
n(other.
n) {
2217 other.comparators =
nullptr;
2222 Item *arg)
override;
2223 void store_value(
Item *item)
override;
2227 void store_value_by_template(
cmp_item *tmpl,
Item *)
override;
2239 bool allocate_template_comparators(
THD *thd,
Item *item);
2261 bool find_item(
Item *item)
override;
2262 bool compare_elems(uint pos1, uint pos2)
const override;
2273 void set(uint pos,
Item *item)
override;
2274 void sort_array()
override;
2282 bool cache_used =
false;
2300 double rows_in_table)
override;
2326 const char *
func_name()
const override {
return "<is_not_null_test>"; }
2356 const char *
func_name()
const override {
return "isnotnull"; }
2370 double rows_in_table)
override;
2375 bool escape_is_const =
false;
2377 bool escape_evaluated =
false;
2378 bool eval_escape_clause(
THD *thd);
2386 assert(escape_arg !=
nullptr);
2390 assert(escape_arg !=
nullptr);
2417 assert(escape_is_evaluated());
2432 double rows_in_table)
override;
2444 bool check_covering_prefix_keys(
THD *thd);
2472 return list.push_back(item);
2476 return list.push_front(item);
2480 list.prepend(nlist);
2491 bool eq(
const Item *item,
bool binary_cmp)
const override;
2503 bool truth_transform_arguments(
THD *thd,
Bool_test test);
2507 bool remove_const_conds(
THD *thd,
Item *item,
Item **new_item);
2597 bool cond_false{
false};
2599 bool compare_as_dates{
false};
2610 bool compare_const(
THD *thd,
Item *c);
2624 bool update_const(
THD *thd);
2627 const char *
func_name()
const override {
return "multiple equal"; }
2637 return const_arg() ==
nullptr;
2655 template <
typename Node_cmp_func>
2667 return m_fields->cbegin();
2671 return m_fields->cbegin();
2674 return m_fields->cend();
2683 : m_fields(&item->fields) {}
2685 return m_fields->cbegin();
2689 return m_fields->cbegin();
2692 return m_fields->cend();
2694 size_t size()
const {
return m_fields->size(); }
2708 bool eq(
const Item *item,
bool binary_cmp)
const override;
2710 return fields.
head()->collation.collation;
2720 double rows_in_table)
override;
2764 double rows_in_table)
override;
2793 double rows_in_table)
override;
2802 if (item ==
nullptr)
return nullptr;
2841 down_cast<const Item_cond *>(item)->functype() ==
2851template <
class Func>
2853 if (condition ==
nullptr) {
2855 }
else if (
IsAnd(condition)) {
2856 for (
Item &item : *down_cast<Item_cond_and *>(condition)->argument_list()) {
2863 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:1443
int compare_time_packed()
Compare arguments using numeric packed temporal representation.
Definition: item_cmpfunc.cc:1981
void cleanup()
Definition: item_cmpfunc.cc:867
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:2044
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:1601
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:2065
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:1183
double precision
Definition: item_cmpfunc.h:147
int compare_datetime()
Compare item values as dates.
Definition: item_cmpfunc.cc:1725
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:1253
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:1955
int compare_binary_string()
Compare strings byte by byte.
Definition: item_cmpfunc.cc:1884
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:1817
int compare_real()
Definition: item_cmpfunc.cc:1902
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:1108
bool try_year_cmp_func(Item_result type)
Definition: item_cmpfunc.cc:1544
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:1937
longlong extract_value_from_argument(THD *thd, Item *item, bool left_argument, bool *is_null) const
Definition: item_cmpfunc.cc:8082
int compare_string()
Definition: item_cmpfunc.cc:1852
int compare_decimal()
Definition: item_cmpfunc.cc:1920
int compare_row()
Definition: item_cmpfunc.cc:2083
bool compare_null_values()
Compare NULL values for two arguments.
Definition: item_cmpfunc.cc:2175
bool set_compare_func(Item_result_field *owner, Item_result type)
Definition: item_cmpfunc.cc:885
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:2017
Definition: item_cmpfunc.h:2727
uint max_members
Definition: item_cmpfunc.h:2729
COND_EQUAL * upper_levels
Definition: item_cmpfunc.h:2731
List< Item_equal > current_level
Definition: item_cmpfunc.h:2732
COND_EQUAL()
Definition: item_cmpfunc.h:2734
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:181
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:398
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:403
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:407
Item_bool_func * combine(List< Item > list) const override
Combines a list of conditions exp op exp.
Definition: item_cmpfunc.cc:412
Definition: item_cmpfunc.h:602
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:433
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:425
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:8047
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:3825
Base class for functions that usually take two arguments, which are possibly strings,...
Definition: item_cmpfunc.h:624
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:680
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:725
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:743
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:860
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:2181
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:2737
Item * copy_andor_structure(THD *thd) override
Definition: item_cmpfunc.h:2752
Item_cond_and(List< Item > &list_arg)
Definition: item_cmpfunc.h:2748
COND_EQUAL cond_equal
Definition: item_cmpfunc.h:2739
const char * func_name() const override
Definition: item_cmpfunc.h:2751
enum Functype functype() const override
Definition: item_cmpfunc.h:2749
Item_cond_and()
Definition: item_cmpfunc.h:2742
Item_cond_and(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2745
Item_cond_and(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2744
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2759
Item_cond_and(THD *thd, Item_cond_and *item)
Definition: item_cmpfunc.h:2747
Definition: item_cmpfunc.h:2769
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2788
enum Functype functype() const override
Definition: item_cmpfunc.h:2778
Item_cond_or(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2773
Item * copy_andor_structure(THD *thd) override
Definition: item_cmpfunc.h:2781
Item_cond_or(List< Item > &list_arg)
Definition: item_cmpfunc.h:2777
Item_cond_or(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2774
Item_cond_or()
Definition: item_cmpfunc.h:2771
const char * func_name() const override
Definition: item_cmpfunc.h:2780
Item_cond_or(THD *thd, Item_cond_or *item)
Definition: item_cmpfunc.h:2776
Definition: item_cmpfunc.h:2447
void add_at_head(List< Item > *nlist)
Definition: item_cmpfunc.h:2478
bool add_at_head(Item *item)
Definition: item_cmpfunc.h:2474
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:2498
Item_cond(Item *i1, Item *i2)
Definition: item_cmpfunc.h:2457
Item_bool_func super
Definition: item_cmpfunc.h:2448
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:2509
void copy_andor_arguments(THD *thd, Item_cond *item)
Definition: item_cmpfunc.cc:5685
table_map used_tables() const override
Definition: item_cmpfunc.h:2492
Item_cond(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:2461
Item_cond(List< Item > &nlist)
Definition: item_cmpfunc.h:2468
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:2504
List< Item > * argument_list()
Definition: item_cmpfunc.h:2490
Type type() const override
Definition: item_cmpfunc.h:2489
Item_cond()
Definition: item_cmpfunc.h:2456
List< Item > list
Definition: item_cmpfunc.h:2451
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:2510
bool add(Item *item)
Definition: item_cmpfunc.h:2470
bool abort_on_null
Definition: item_cmpfunc.h:2452
Base class for the equality comparison operators = and <=>.
Definition: item_cmpfunc.h:991
Item_eq_base(Item *a, Item *b)
Definition: item_cmpfunc.h:993
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:1050
bool contains_only_equi_join_condition() const final
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.cc:7633
Item_eq_base(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:994
Item * create_cast_if_needed(MEM_ROOT *mem_root, Item *argument) const
Wrap the argument in a typecast, if needed.
Definition: item_cmpfunc.cc:8019
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:7993
Definition: item_cmpfunc.h:2680
ConstFieldProxy(const Item_equal *item)
Definition: item_cmpfunc.h:2682
List_STL_Iterator< const Item_field > cbegin() const
Definition: item_cmpfunc.h:2688
List_STL_Iterator< const Item_field > cend() const
Definition: item_cmpfunc.h:2691
List_STL_Iterator< const Item_field > begin() const
Definition: item_cmpfunc.h:2684
size_t size() const
Definition: item_cmpfunc.h:2694
const List< Item_field > * m_fields
Definition: item_cmpfunc.h:2697
List_STL_Iterator< const Item_field > end() const
Definition: item_cmpfunc.h:2687
Definition: item_cmpfunc.h:2661
List_STL_Iterator< Item_field > begin()
Definition: item_cmpfunc.h:2664
List_STL_Iterator< Item_field > end()
Definition: item_cmpfunc.h:2665
List< Item_field > * m_fields
Definition: item_cmpfunc.h:2678
List_STL_Iterator< const Item_field > begin() const
Definition: item_cmpfunc.h:2666
List_STL_Iterator< const Item_field > cbegin() const
Definition: item_cmpfunc.h:2670
List_STL_Iterator< const Item_field > cend() const
Definition: item_cmpfunc.h:2673
List_STL_Iterator< const Item_field > end() const
Definition: item_cmpfunc.h:2669
FieldProxy(Item_equal *item)
Definition: item_cmpfunc.h:2663
Definition: item_cmpfunc.h:2587
ConstFieldProxy get_fields() const
Definition: item_cmpfunc.h:2700
bool contains_only_equi_join_condition() const override
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.h:2636
void set_const_arg(Item *c)
Definition: item_cmpfunc.h:2609
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:2629
Item * const_arg() const
Definition: item_cmpfunc.h:2608
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2709
void sort(Node_cmp_func compare)
Order field items in multiple equality according to a sorting criteria.
Definition: item_cmpfunc.h:2656
Arg_comparator cmp
Helper for comparing constants.
Definition: item_cmpfunc.h:2595
Item_field * get_first()
Get the first field of multiple equality, use for semantic checking.
Definition: item_cmpfunc.h:2621
const char * func_name() const override
Definition: item_cmpfunc.h:2627
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2628
List< Item_field > fields
List of equal field items.
Definition: item_cmpfunc.h:2589
FieldProxy get_fields()
Definition: item_cmpfunc.h:2699
enum Functype functype() const override
Definition: item_cmpfunc.h:2625
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:2713
ANY_VALUE(expr) is like expr except that it is not checked by aggregate_check logic.
Definition: item_cmpfunc.h:1497
const char * func_name() const override
Definition: item_cmpfunc.h:1501
Item_func_any_value(const POS &pos, Item *a)
Definition: item_cmpfunc.h:1499
Item_func_any_value(Item *a)
Definition: item_cmpfunc.h:1500
Definition: item_cmpfunc.h:1320
Arg_comparator ge_cmp
Definition: item_cmpfunc.h:1332
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1339
bool compare_as_dates_with_strings
Definition: item_cmpfunc.h:1327
bool is_bool_func() const override
Definition: item_cmpfunc.h:1348
Item_func_between(const POS &pos, Item *a, Item *b, Item *c, bool is_negation)
Definition: item_cmpfunc.h:1333
Item_result cmp_type
Definition: item_cmpfunc.h:1324
bool compare_as_temporal_dates
Definition: item_cmpfunc.h:1328
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:1349
String value0
Definition: item_cmpfunc.h:1325
const char * func_name() const override
Definition: item_cmpfunc.h:1341
void update_not_null_tables()
Definition: item_cmpfunc.h:1361
uint decimal_precision() const override
Definition: item_cmpfunc.h:1352
DTCollation cmp_collation
Definition: item_cmpfunc.h:1321
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1353
bool compare_as_temporal_times
Definition: item_cmpfunc.h:1329
enum Functype functype() const override
Definition: item_cmpfunc.h:1340
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:2000
Item_result cmp_type
Definition: item_cmpfunc.h:2007
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:2051
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2062
cmp_item * case_item
Definition: item_cmpfunc.h:2010
int else_expr_num
Definition: item_cmpfunc.h:2003
DTCollation cmp_collation
Definition: item_cmpfunc.h:2008
Item_func super
Definition: item_cmpfunc.h:2001
Item_func_case(const POS &pos, mem_root_deque< Item * > *list, Item *first_expr_arg, Item *else_expr_arg)
Definition: item_cmpfunc.h:2019
int get_first_expr_num() const
Definition: item_cmpfunc.h:2041
const char * func_name() const override
Definition: item_cmpfunc.h:2058
enum Item_result result_type() const override
Definition: item_cmpfunc.h:2057
enum Item_result cached_result_type left_result_type
Definition: item_cmpfunc.h:2004
uint ncases
Definition: item_cmpfunc.h:2006
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_cmpfunc.h:2013
String tmp_value
Definition: item_cmpfunc.h:2005
enum Functype functype() const override
Definition: item_cmpfunc.h:2065
int get_else_expr_num() const
Definition: item_cmpfunc.h:2042
Definition: item_cmpfunc.h:1432
Item_func_coalesce(const POS &pos, Item *a)
Definition: item_cmpfunc.h:1438
Item_func_coalesce(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1434
enum Item_result result_type() const override
Definition: item_cmpfunc.h:1469
Item_func_coalesce(Item *a, Item *b)
Definition: item_cmpfunc.h:1451
const char * func_name() const override
Definition: item_cmpfunc.h:1470
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1448
Item_func_coalesce(Item *a)
Definition: item_cmpfunc.h:1441
Item_func_coalesce(const POS &pos, PT_item_list *list)
Definition: item_cmpfunc.h:1444
enum Functype functype() const override
Definition: item_cmpfunc.h:1471
void set_numeric_type() override
Definition: item_cmpfunc.h:1468
Item_func_comparison is a class for comparison functions that take two arguments and return a boolean...
Definition: item_cmpfunc.h:696
bool subst_argument_checker(uchar **) override
Definition: item_cmpfunc.h:708
Item_func_comparison(Item *a, Item *b)
Definition: item_cmpfunc.h:698
Item_func_comparison(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:701
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.cc:6893
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:6768
virtual Item * negated_item()
just fake method, should never be called.
Definition: item_cmpfunc.cc:6888
bool cast_incompatible_args(uchar *) override
Wrap incompatible arguments in CAST nodes to the expected data types.
Definition: item_cmpfunc.cc:6908
Implements the comparison operator equals (=)
Definition: item_cmpfunc.h:1056
enum Functype functype() const override
Definition: item_cmpfunc.h:1061
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1068
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1063
Item_func_eq(Item *a, Item *b)
Definition: item_cmpfunc.h:1058
Item_func_eq(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1059
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1062
const char * func_name() const override
Definition: item_cmpfunc.h:1064
bool equality_substitution_analyzer(uchar **) override
Definition: item_cmpfunc.h:1066
The <=> operator evaluates the same as.
Definition: item_cmpfunc.h:1119
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:1137
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:1128
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1135
enum Functype functype() const override
Definition: item_cmpfunc.h:1133
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1134
const char * func_name() const override
Definition: item_cmpfunc.h:1136
Item_func_equal(Item *a, Item *b)
Definition: item_cmpfunc.h:1121
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.h:1138
Item_func_equal(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1124
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:1162
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1167
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1168
Item_func_ge(Item *a, Item *b)
Definition: item_cmpfunc.h:1164
const char * func_name() const override
Definition: item_cmpfunc.h:1169
enum Functype functype() const override
Definition: item_cmpfunc.h:1166
Implements the comparison operator greater than (>)
Definition: item_cmpfunc.h:1176
Item_func_gt(Item *a, Item *b)
Definition: item_cmpfunc.h:1178
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1182
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1181
const char * func_name() const override
Definition: item_cmpfunc.h:1183
enum Functype functype() const override
Definition: item_cmpfunc.h:1180
Definition: item_cmpfunc.h:1511
Item_func_if(Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:1515
enum Functype functype() const override
Definition: item_cmpfunc.h:1542
enum Item_result result_type() const override
Definition: item_cmpfunc.h:1531
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1533
const char * func_name() const override
Definition: item_cmpfunc.h:1541
void update_not_null_tables()
Definition: item_cmpfunc.h:1546
enum Item_result cached_result_type
Definition: item_cmpfunc.h:1512
Item_func_if(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_cmpfunc.h:1519
Definition: item_cmpfunc.h:1474
bool field_type_defined
Definition: item_cmpfunc.h:1476
Item_func_ifnull(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1479
const char * func_name() const override
Definition: item_cmpfunc.h:1488
in_expr [NOT] IN (in_value_list).
Definition: item_cmpfunc.h:2079
DTCollation cmp_collation
Definition: item_cmpfunc.h:2109
Item_func_in(const POS &pos, PT_item_list *list, bool is_negation)
Definition: item_cmpfunc.h:2112
enum Functype functype() const override
Definition: item_cmpfunc.h:2139
const char * func_name() const override
Definition: item_cmpfunc.h:2140
Item_result left_result_type
Definition: item_cmpfunc.h:2107
bool is_bool_func() const override
Definition: item_cmpfunc.h:2141
uint decimal_precision() const override
Definition: item_cmpfunc.h:2124
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2142
void update_not_null_tables()
Definition: item_cmpfunc.h:2152
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2136
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:2145
'<,>,=<,=>' operators.
Definition: item_cmpfunc.h:1147
bool gc_subst_analyzer(uchar **) override
Analyzer function for GC substitution.
Definition: item_cmpfunc.h:1156
Item_func_inequality(Item *a, Item *b)
Definition: item_cmpfunc.h:1149
Definition: item_cmpfunc.h:1401
Item_row * row
Definition: item_cmpfunc.h:1404
bool use_decimal_comparison
Definition: item_cmpfunc.h:1405
const char * func_name() const override
Definition: item_cmpfunc.h:1420
interval_range * intervals
Definition: item_cmpfunc.h:1406
uint decimal_precision() const override
Definition: item_cmpfunc.h:1421
Item_int_func super
Definition: item_cmpfunc.h:1402
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:1409
Definition: item_cmpfunc.h:2343
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2361
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:2364
const char * func_name() const override
Definition: item_cmpfunc.h:2356
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2357
Item_func_isnotnull(Item *a)
Definition: item_cmpfunc.h:2345
enum Functype functype() const override
Definition: item_cmpfunc.h:2351
Item_func_isnotnull(const POS &pos, Item *a)
Definition: item_cmpfunc.h:2346
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:2352
Definition: item_cmpfunc.h:2279
Item_func_isnull(Item *a)
Definition: item_cmpfunc.h:2286
Item_func_isnull(const POS &pos, Item *a)
Definition: item_cmpfunc.h:2287
const char * func_name() const override
Definition: item_cmpfunc.h:2293
Item_bool_func super
Definition: item_cmpfunc.h:2280
enum Functype functype() const override
Definition: item_cmpfunc.h:2291
bool cached_value
Definition: item_cmpfunc.h:2283
const CHARSET_INFO * compare_collation() const override
Definition: item_cmpfunc.h:2305
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:2301
Implements the comparison operator less than or equals (<=)
Definition: item_cmpfunc.h:1190
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1196
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1195
Item_func_le(Item *a, Item *b)
Definition: item_cmpfunc.h:1192
const char * func_name() const override
Definition: item_cmpfunc.h:1197
enum Functype functype() const override
Definition: item_cmpfunc.h:1194
Definition: item_cmpfunc.h:2373
Item_func_like(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:2392
int escape() const
Returns the escape character.
Definition: item_cmpfunc.h:2416
int m_escape
The escape character (0 if no escape character).
Definition: item_cmpfunc.h:2380
enum Functype functype() const override
Definition: item_cmpfunc.h:2396
bool escape_was_used_in_parsing() const
Definition: item_cmpfunc.h:2413
Item_func_like(Item *a, Item *b, Item *escape_arg)
Definition: item_cmpfunc.h:2384
Item_func_like(Item *a, Item *b)
Definition: item_cmpfunc.h:2383
cond_result eq_cmp_result() const override
Result may be not equal with equal inputs if ESCAPE character is present.
Definition: item_cmpfunc.h:2399
const char * func_name() const override
Definition: item_cmpfunc.h:2400
bool escape_is_evaluated() const
Has the escape clause been evaluated? It only needs to be evaluated once per execution,...
Definition: item_cmpfunc.h:2427
Item_func_like(const POS &pos, Item *a, Item *b, Item *escape_arg)
Definition: item_cmpfunc.h:2388
Implements the comparison operator less than (<)
Definition: item_cmpfunc.h:1236
Item_func_lt(Item *a, Item *b)
Definition: item_cmpfunc.h:1238
cond_result eq_cmp_result() const override
Definition: item_cmpfunc.h:1242
enum Functype functype() const override
Definition: item_cmpfunc.h:1240
enum Functype rev_functype() const override
Definition: item_cmpfunc.h:1241
const char * func_name() const override
Definition: item_cmpfunc.h:1243
Wrapper class when MATCH function is used in WHERE clause.
Definition: item_cmpfunc.h:770
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:782
Item_func_match_predicate(Item *a)
Definition: item_cmpfunc.h:772
const char * func_name() const override
Definition: item_cmpfunc.h:776
longlong val_int() override
Definition: item_cmpfunc.cc:7307
enum Functype functype() const override
Definition: item_cmpfunc.h:775
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:777
Implements the comparison operator not equals (<>)
Definition: item_cmpfunc.h:1250
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:975
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:980
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6829
Item_func_nop_all(Item *a)
Definition: item_cmpfunc.h:977
const char * func_name() const override
Definition: item_cmpfunc.h:979
longlong val_int() override
Special NOP (No OPeration) for ALL subquery.
Definition: item_cmpfunc.cc:551
Definition: item_cmpfunc.h:920
bool empty_underlying_subquery()
Definition: item_cmpfunc.cc:513
bool abort_on_null
Definition: item_cmpfunc.h:925
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:534
const char * func_name() const override
Definition: item_cmpfunc.h:942
Item_subselect * subselect
Definition: item_cmpfunc.h:924
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6840
longlong val_int() override
special NOT for ALL subquery.
Definition: item_cmpfunc.cc:499
void set_subselect(Item_subselect *item)
Definition: item_cmpfunc.h:947
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:948
void set_sum_test(Item_sum_hybrid *item)
Definition: item_cmpfunc.h:945
bool show
Definition: item_cmpfunc.h:928
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:937
enum Functype functype() const override
Definition: item_cmpfunc.h:941
void set_sub_test(Item_maxmin_subselect *item)
Definition: item_cmpfunc.h:946
bool ignore_unknown() const
Treat UNKNOWN result like FALSE because callers see no difference.
Definition: item_cmpfunc.h:939
Item_sum_hybrid * test_sum_item
Definition: item_cmpfunc.h:922
Item_func_not_all(Item *a)
Definition: item_cmpfunc.h:930
Item_maxmin_subselect * test_sub_item
Definition: item_cmpfunc.h:923
Definition: item_cmpfunc.h:740
Item * truth_transformer(THD *, Bool_test) override
Apply NOT transformation to the item and return a new one.
Definition: item_cmpfunc.cc:6762
enum Functype functype() const override
Definition: item_cmpfunc.h:746
const char * func_name() const override
Definition: item_cmpfunc.h:747
longlong val_int() override
Definition: item_cmpfunc.cc:467
Item_func_not(Item *a)
Definition: item_cmpfunc.h:742
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:441
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:488
Item_func_not(const POS &pos, Item *a)
Definition: item_cmpfunc.h:743
Definition: item_cmpfunc.h:1552
enum_field_types default_data_type() const override
Get the default data (output) type for the specific item.
Definition: item_cmpfunc.h:1566
enum Functype functype() const override
Definition: item_cmpfunc.h:1573
Item_result result_type() const override
Definition: item_cmpfunc.h:1565
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:1588
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:1578
enum Item_result cached_result_type
Definition: item_cmpfunc.h:1553
Item_func_nullif(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1556
const char * func_name() const override
Definition: item_cmpfunc.h:1572
uint decimal_precision() const override
Definition: item_cmpfunc.h:1576
Definition: item_func.h:836
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:1312
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
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_cmpfunc.h:1315
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
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:1302
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:1207
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:1228
const char * func_name() const override
Definition: item_cmpfunc.h:1211
bool is_valid_for_pushdown(uchar *arg) override
Redefine to avoid pushing into derived table.
Definition: item_cmpfunc.h:1213
Item_func_reject_if(Item *a)
Definition: item_cmpfunc.h:1209
Definition: item_cmpfunc.h:1372
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:1381
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:1387
const char * func_name() const override
Definition: item_cmpfunc.h:1378
Item_func_strcmp(const POS &pos, Item *a, Item *b)
Definition: item_cmpfunc.h:1374
enum Functype functype() const override
Definition: item_cmpfunc.h:1379
optimize_type select_optimize(const THD *) override
Definition: item_cmpfunc.h:1377
Definition: item_cmpfunc.h:822
bool fix_fields(THD *thd, Item **ref) override
Definition: item_cmpfunc.h:886
enum_trig_type
Definition: item_cmpfunc.h:824
@ FOUND_MATCH
This trigger type deactivates predicated from WHERE condition when no row satisfying the join conditi...
Definition: item_cmpfunc.h:839
@ IS_NOT_NULL_COMPL
This trigger type deactivates join conditions when a row has been NULL-complemented.
Definition: item_cmpfunc.h:830
@ 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:848
const char * func_name() const override
'<if>', to distinguish from the if() SQL function
Definition: item_cmpfunc.h:881
void add_trig_func_tables()
Definition: item_cmpfunc.h:891
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_cmpfunc.h:900
enum enum_trig_type get_trig_type() const
Definition: item_cmpfunc.h:910
bool contains_only_equi_join_condition() const override
Whether this Item is an equi-join condition.
Definition: item_cmpfunc.cc:7673
Item_func_trig_cond(Item *a, bool *f, const JOIN *join, plan_idx idx, enum_trig_type trig_type_arg)
Definition: item_cmpfunc.h:871
table_map get_inner_tables() const
Get table_map of inner tables spanned by associated outer join operation.
Definition: item_cmpfunc.cc:7353
const JOIN * get_join() const
Definition: item_cmpfunc.h:909
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:7373
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:7332
bool * get_trig_var()
Definition: item_cmpfunc.h:911
plan_idx idx() const
Definition: item_cmpfunc.h:915
plan_idx m_idx
Optional: if join!=NULL: index of table.
Definition: item_cmpfunc.h:857
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:904
longlong val_int() override
Definition: item_cmpfunc.cc:7318
enum_trig_type trig_type
Type of trig_var; for printing.
Definition: item_cmpfunc.h:859
enum Functype functype() const override
Definition: item_cmpfunc.h:879
bool * trig_var
Pointer to trigger variable.
Definition: item_cmpfunc.h:853
enum_trig_type get_trig_type()
Definition: item_cmpfunc.h:912
const JOIN * m_join
Optional: JOIN of table which is the source of trig_var.
Definition: item_cmpfunc.h:855
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:2245
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:2235
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:2229
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:719
Item_bool_func2 super
Definition: item_cmpfunc.h:720
const char * func_name() const override
Definition: item_cmpfunc.h:728
longlong val_int() override
Make a logical XOR of the arguments.
Definition: item_cmpfunc.cc:6721
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:6683
enum Functype functype() const override
Definition: item_cmpfunc.h:727
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:731
Item_func_xor(const POS &pos, Item *i1, Item *i2)
Definition: item_cmpfunc.h:724
Item_func_xor(Item *i1, Item *i2)
Definition: item_cmpfunc.h:723
Item * truth_transformer(THD *, Bool_test) override
XOR can be negated by negating one of the operands:
Definition: item_cmpfunc.cc:6780
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_cmpfunc.cc:6668
Definition: item_func.h:102
my_decimal * val_decimal(my_decimal *) override
Definition: item_func.cc:836
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:733
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:722
void traverse_cond(Cond_traverser traverser, void *arg, traverse_order order) override
Definition: item_func.cc:641
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:699
Functype
Definition: item_func.h:187
@ TRIG_COND_FUNC
Definition: item_func.h:231
@ NOT_ALL_FUNC
Definition: item_func.h:228
@ LIKE_FUNC
Definition: item_func.h:198
@ FALSE_FUNC
Definition: item_func.h:311
@ NULLIF_FUNC
Definition: item_func.h:272
@ NOT_FUNC
Definition: item_func.h:227
@ XOR_FUNC
Definition: item_func.h:204
@ COND_OR_FUNC
Definition: item_func.h:203
@ COND_AND_FUNC
Definition: item_func.h:202
@ EQ_FUNC
Definition: item_func.h:189
@ TRUE_FUNC
Definition: item_func.h:310
@ IN_FUNC
Definition: item_func.h:206
@ LE_FUNC
Definition: item_func.h:193
@ MATCH_FUNC
Definition: item_func.h:197
@ LT_FUNC
Definition: item_func.h:192
@ ISNULL_FUNC
Definition: item_func.h:199
@ ISNOTNULLTEST_FUNC
Definition: item_func.h:209
@ MULT_EQUAL_FUNC
Definition: item_func.h:207
@ ISTRUTH_FUNC
Definition: item_func.h:201
@ BETWEEN
Definition: item_func.h:205
@ IF_FUNC
Definition: item_func.h:271
@ STRCMP_FUNC
Definition: item_func.h:309
@ NE_FUNC
Definition: item_func.h:191
@ GE_FUNC
Definition: item_func.h:194
@ EQUAL_FUNC
Definition: item_func.h:190
@ GT_FUNC
Definition: item_func.h:195
@ UNKNOWN_FUNC
Definition: item_func.h:188
@ ISNOTNULL_FUNC
Definition: item_func.h:200
@ CASE_FUNC
Definition: item_func.h:273
@ COALESCE_FUNC
Definition: item_func.h:303
void print_op(const THD *thd, String *str, enum_query_type query_type) const
Definition: item_func.cc:763
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:325
@ OPTIMIZE_NONE
Definition: item_func.h:326
@ OPTIMIZE_EQUAL
Definition: item_func.h:330
@ OPTIMIZE_NULL
Definition: item_func.h:329
@ OPTIMIZE_KEY
Definition: item_func.h:327
@ OPTIMIZE_OP
Definition: item_func.h:328
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_func.cc:360
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_func.h:680
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_func.cc:747
bool fix_fields(THD *, Item **ref) override
Definition: item_func.cc:405
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:459
bool set_arguments(mem_root_deque< Item * > *list, bool context_free)
Copy arguments from list to args array.
Definition: item_func.cc:328
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:794
bool eq(const Item *item, bool binary_cmp) const override
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: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:630
Item * transform(Item_transformer transformer, uchar *arg) override
Transform an Item_func object with a transformer callback function.
Definition: item_func.cc:674
virtual bool resolve_type_inner(THD *)
Resolve type of function after all arguments have had their data types resolved.
Definition: item_func.h:481
uint allowed_arg_cols
Definition: item_func.h:169
Definition: item_cmpfunc.h:492
bool split_sum_func(THD *thd, Ref_item_array ref_item_array, mem_root_deque< Item * > *fields) override
Definition: item_cmpfunc.cc:2363
bool is_null() override
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item_cmpfunc.cc:2553
bool fix_left(THD *thd)
Definition: item_cmpfunc.cc:2278
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:2460
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:2352
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_cmpfunc.cc:2558
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_cmpfunc.cc:2540
Item_cache ** get_cache()
Definition: item_cmpfunc.h:520
bool fix_fields(THD *, Item **) override
Definition: item_cmpfunc.cc:2320
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.cc:2375
Representation of IN subquery predicates of the form "left_expr IN (SELECT ...)".
Definition: item_subselect.h:572
Definition: item_func.h:983
String * val_str(String *str) override
Definition: item_func.cc:1473
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_func.h:1031
double val_real() override
Definition: item_func.cc:1467
enum Item_result result_type() const override
Definition: item_func.h:1035
bool get_time(MYSQL_TIME *ltime) override
Definition: item_func.h:1034
Definition: item_cmpfunc.h:2318
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_cmpfunc.h:2337
Item_in_subselect * owner
Definition: item_cmpfunc.h:2319
const char * func_name() const override
Definition: item_cmpfunc.h:2326
Item_is_not_null_test(Item_in_subselect *ow, Item *a)
Definition: item_cmpfunc.h:2322
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:2334
enum Functype functype() const override
Definition: item_cmpfunc.h:2324
Definition: item_subselect.h:372
Item with result field.
Definition: item.h:5809
Field * result_field
Definition: item.h:5811
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item.cc:10928
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:1540
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
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:2096
void set_nullable(bool nullable)
Definition: item.h:3640
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3538
void set_data_type_bool()
Definition: item.h:1512
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:2757
bool is_nullable() const
Definition: item.h:3639
void set_subquery()
Set the "has subquery" property.
Definition: item.h:3394
void fix_char_length(uint32 max_char_length_arg)
Definition: item.h:3344
virtual Item * equality_substitution_transformer(uchar *)
Definition: item.h:2972
virtual uint decimal_precision() const
Definition: item.cc:774
virtual bool val_json(Json_wrapper *result)
Get a JSON value from an Item.
Definition: item.h:2068
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:2462
bool fixed
True if item has been resolved.
Definition: item.h:3628
bool null_value
True if item is null.
Definition: item.h:3665
Type
Definition: item.h:971
@ COND_ITEM
An AND or OR condition.
Definition: item.h:984
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:2535
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:2351
virtual TYPELIB * get_typelib() const
Get the typelib information for an item of type set or enum.
Definition: item.h:1796
bool unsigned_flag
Definition: item.h:3666
virtual bool aggregate_check_group(uchar *)
Definition: item.h:2902
virtual bool is_null()
The method allows to determine nullness of a complex expression without fully evaluating it,...
Definition: item.h:2516
virtual bool aggregate_check_distinct(uchar *)
Definition: item.h:2900
cond_result
Definition: item.h:998
@ COND_TRUE
Definition: item.h:998
@ COND_FALSE
Definition: item.h:998
@ COND_OK
Definition: item.h:998
traverse_order
Definition: item.h:1000
Bool_test
< Modifier for result transformation
Definition: item.h:1013
@ BOOL_NOT_FALSE
Definition: item.h:1017
@ BOOL_NOT_TRUE
Definition: item.h:1016
@ BOOL_IS_TRUE
Definition: item.h:1013
@ BOOL_IS_FALSE
Definition: item.h:1014
@ BOOL_NEGATED
Definition: item.h:1020
uint32 max_length
Maximum length of result of evaluating this item, in number of bytes.
Definition: item.h:3556
virtual enum Type type() const =0
virtual uint cols() const
Definition: item.h:3143
Definition: sql_optimizer.h:133
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:369
bool add_alias(const std::string &key, Json_dom *value)
Insert the value into the object.
Definition: json_dom.h:411
A class that is capable of holding objects of any sub-type of Json_scalar.
Definition: json_dom.h:1886
Abstraction for accessing JSON values irrespective of whether they are (started out as) binary JSON v...
Definition: json_dom.h:1153
Definition: item_cmpfunc.h:610
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:437
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:379
bool l_op() const override
Definition: item_cmpfunc.h:541
Definition: sql_list.h:653
Definition: sql_list.h:467
void sort(Node_cmp_func cmp)
Sort the list.
Definition: sql_list.h:567
T * head()
Definition: sql_list.h:493
Definition: item_cmpfunc.h:594
Item_bool_func * create(Item *a, Item *b) const override
Definition: item_cmpfunc.cc:429
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:416
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:421
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:1163
String class wrapper with a preallocated buffer of size buff_sz.
Definition: sql_string.h:681
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:169
Definition: item_cmpfunc.h:1938
longlong value
Definition: item_cmpfunc.h:1939
bool has_date
Distinguish between DATE/DATETIME/TIMESTAMP and TIME.
Definition: item_cmpfunc.h:1945
const Item * warn_item
Definition: item_cmpfunc.h:1943
Definition: item_cmpfunc.h:1973
my_decimal value
Definition: item_cmpfunc.h:1974
Definition: item_cmpfunc.h:1914
longlong value
Definition: item_cmpfunc.h:1915
void store_value(Item *item) override
Definition: item_cmpfunc.h:1918
int cmp(Item *arg) override
Definition: item_cmpfunc.h:1922
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1926
Definition: item_cmpfunc.h:1888
unique_ptr_destroy_only< Json_wrapper > m_value
Cached JSON value to look up.
Definition: item_cmpfunc.h:1891
~cmp_item_json() override
String m_str_value
String buffer.
Definition: item_cmpfunc.h:1895
unique_ptr_destroy_only< Json_scalar_holder > m_holder
Cache for the value above.
Definition: item_cmpfunc.h:1893
Definition: item_cmpfunc.h:1954
int cmp(Item *arg) override
Definition: item_cmpfunc.h:1962
double value
Definition: item_cmpfunc.h:1955
void store_value(Item *item) override
Definition: item_cmpfunc.h:1958
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1966
Definition: item_cmpfunc.h:2200
cmp_item_row(cmp_item_row &&other)
Definition: item_cmpfunc.h:2215
uint n
Definition: item_cmpfunc.h:2202
cmp_item_row(THD *thd, Item *item)
Definition: item_cmpfunc.h:2210
cmp_item_row()
Definition: item_cmpfunc.h:2205
cmp_item which stores a scalar (i.e. non-ROW).
Definition: item_cmpfunc.h:1854
void set_null_value(bool nv)
Definition: item_cmpfunc.h:1857
bool m_null_value
If stored value is NULL.
Definition: item_cmpfunc.h:1856
Definition: item_cmpfunc.h:1860
const String * value_res
Definition: item_cmpfunc.h:1862
int compare(const cmp_item *ci) const override
Definition: item_cmpfunc.h:1869
cmp_item_string(const CHARSET_INFO *cs)
Definition: item_cmpfunc.h:1867
void store_value(Item *item) override
Definition: item_cmpfunc.h:1874
const CHARSET_INFO * cmp_charset
Definition: item_cmpfunc.h:1864
StringBuffer< STRING_BUFFER_USUAL_SIZE > value
Definition: item_cmpfunc.h:1863
Definition: item_cmpfunc.h:1810
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:1848
Definition: item_cmpfunc.h:1722
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1726
in_datetime_as_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1724
Definition: item_cmpfunc.h:1750
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1757
Item * warn_item
An item used to issue warnings.
Definition: item_cmpfunc.h:1752
in_datetime(MEM_ROOT *mem_root, Item *warn_item_arg, uint elements)
Definition: item_cmpfunc.h:1755
Definition: item_cmpfunc.h:1786
Mem_root_array< my_decimal > base
Definition: item_cmpfunc.h:1787
in_decimal(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1790
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:1795
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1792
Definition: item_cmpfunc.h:1766
in_double(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
Mem_root_array< double > base
Definition: item_cmpfunc.h:1767
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:1689
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1702
in_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1700
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:1709
void set(uint pos, Item *item) override
Definition: item_cmpfunc.h:1717
Mem_root_array< packed_longlong > base
Definition: item_cmpfunc.h:1697
Definition: item_cmpfunc.h:2242
Mem_root_array< cmp_item_row * > base_pointers
Definition: item_cmpfunc.h:2246
Mem_root_array< cmp_item_row > base_objects
Definition: item_cmpfunc.h:2244
Item_basic_constant * create_item(MEM_ROOT *) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:2264
unique_ptr_destroy_only< cmp_item_row > tmp
Definition: item_cmpfunc.h:2243
bool is_row_result() const override
Definition: item_cmpfunc.h:2250
void value_to_item(uint, Item_basic_constant *) const override
Store the value at position pos into provided item object.
Definition: item_cmpfunc.h:2268
Definition: item_cmpfunc.h:1664
Mem_root_array< String * > base_pointers
Definition: item_cmpfunc.h:1669
Mem_root_array< String > base_objects
Definition: item_cmpfunc.h:1667
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:1677
const CHARSET_INFO * collation
Definition: item_cmpfunc.h:1670
String tmp
Definition: item_cmpfunc.h:1666
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1674
Definition: item_cmpfunc.h:1734
Item_basic_constant * create_item(MEM_ROOT *mem_root) const override
Create an instance of Item_{type} (e.g.
Definition: item_cmpfunc.h:1738
in_time_as_longlong(MEM_ROOT *mem_root, uint elements)
Definition: item_cmpfunc.h:1736
Definition: item_cmpfunc.h:1595
const uint m_size
Size of the vector.
Definition: item_cmpfunc.h:1597
virtual void cleanup()
Definition: item_cmpfunc.h:1655
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:1641
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:1605
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:95
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:718
void(* Cond_traverser)(const Item *item, void *arg)
Definition: item.h:728
Item *(Item::* Item_transformer)(uchar *arg)
Type for transformers used by Item::transform and Item::compile.
Definition: item.h:727
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:8119
int(Arg_comparator::* arg_cmp_func)()
Definition: item_cmpfunc.h:74
Eq_creator eq_creator
Definition: mysqld.cc:1521
Ge_creator ge_creator
Definition: mysqld.cc:1526
Item * make_condition(Parse_context *pc, Item *item)
Ensure that all expressions involved in conditions are boolean functions.
Definition: item_cmpfunc.cc:5644
void find_and_adjust_equal_fields(Item *item, table_map available_tables, bool replace, bool *found)
Definition: item_cmpfunc.cc:8100
Lt_creator lt_creator
Definition: mysqld.cc:1525
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:994
Gt_creator gt_creator
Definition: mysqld.cc:1524
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:2839
Ne_creator ne_creator
Definition: mysqld.cc:1522
Equal_creator equal_creator
Definition: mysqld.cc:1523
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:2852
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:1025
Le_creator le_creator
Definition: mysqld.cc:1527
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:1634
Item * and_conds(Item *a, Item *b)
Builds condition: (a AND b) IS TRUE.
Definition: item_cmpfunc.h:2797
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:477
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:1081
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(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:127
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2882
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2878
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:112
constexpr const size_t STRING_BUFFER_USUAL_SIZE
Definition: sql_const.h:125
constexpr const table_map OUTER_REF_TABLE_BIT
Definition: sql_const.h:111
enum_walk
Enumeration for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:288
bool(Item::*)(unsigned char *) Item_processor
Processor type for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:306
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:423
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:1691
bool unsigned_flag
Definition: item_cmpfunc.h:1693
longlong val
Definition: item_cmpfunc.h:1692
Definition: item_cmpfunc.h:1395
Item_result type
Definition: item_cmpfunc.h:1396
double dbl
Definition: item_cmpfunc.h:1397
my_decimal dec
Definition: item_cmpfunc.h:1398
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