MySQL  8.0.27
Source Code Documentation
item_strfunc.h
Go to the documentation of this file.
1 /* Copyright (c) 2000, 2021, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 /* This file defines all string functions */
24 #ifndef ITEM_STRFUNC_INCLUDED
25 #define ITEM_STRFUNC_INCLUDED
26 
27 #include <assert.h>
28 #include <sys/types.h>
29 
30 #include <cstdint> // uint32_t
31 
32 #include "lex_string.h"
33 #include "libbinlogevents/include/uuid.h" // Uuid
34 #include "m_ctype.h"
35 
36 #include "my_hostname.h" // HOSTNAME_LENGTH
37 #include "my_inttypes.h"
38 #include "my_table_map.h"
39 #include "my_time.h"
41 #include "mysql_com.h"
42 #include "mysql_time.h"
43 #include "sql/enum_query_type.h"
44 #include "sql/field.h"
45 #include "sql/item.h"
46 #include "sql/item_cmpfunc.h" // Item_bool_func
47 #include "sql/item_func.h" // Item_func
48 #include "sql/parse_location.h" // POS
49 #include "sql/sql_const.h"
50 #include "sql_string.h"
51 #include "template_utils.h" // pointer_cast
52 
53 class MY_LOCALE;
54 class PT_item_list;
55 class THD;
56 class my_decimal;
57 struct Parse_context;
58 
59 template <class T>
60 class List;
61 
63  const char *name, CHARSET_INFO *name_cs = system_charset_info);
64 
65 /**
66  Generate Universal Unique Identifier (UUID).
67 
68  @param str Pointer to string which will hold the UUID.
69 
70  @return str Pointer to string which contains the UUID.
71 */
72 
74 
75 class Item_str_func : public Item_func {
76  typedef Item_func super;
77 
78  public:
80 
81  explicit Item_str_func(const POS &pos) : super(pos) {}
82 
84 
85  Item_str_func(const POS &pos, Item *a) : Item_func(pos, a) {}
86 
87  Item_str_func(Item *a, Item *b) : Item_func(a, b) {}
88 
89  Item_str_func(const POS &pos, Item *a, Item *b) : Item_func(pos, a, b) {}
90 
91  Item_str_func(Item *a, Item *b, Item *c) : Item_func(a, b, c) {}
92 
93  Item_str_func(const POS &pos, Item *a, Item *b, Item *c)
94  : Item_func(pos, a, b, c) {}
95 
96  Item_str_func(Item *a, Item *b, Item *c, Item *d) : Item_func(a, b, c, d) {}
97 
98  Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d)
99  : Item_func(pos, a, b, c, d) {}
100 
101  Item_str_func(Item *a, Item *b, Item *c, Item *d, Item *e)
102  : Item_func(a, b, c, d, e) {}
103 
104  Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
105  : Item_func(pos, a, b, c, d, e) {}
106 
107  explicit Item_str_func(mem_root_deque<Item *> *list) : Item_func(list) {}
108 
109  Item_str_func(const POS &pos, PT_item_list *opt_list)
110  : Item_func(pos, opt_list) {}
111 
112  longlong val_int() override { return val_int_from_string(); }
113  double val_real() override { return val_real_from_string(); }
114  my_decimal *val_decimal(my_decimal *) override;
115  bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override {
116  return get_date_from_string(ltime, fuzzydate);
117  }
118  bool get_time(MYSQL_TIME *ltime) override {
119  return get_time_from_string(ltime);
120  }
121  enum Item_result result_type() const override { return STRING_RESULT; }
122  void left_right_max_length(THD *thd);
123  bool fix_fields(THD *thd, Item **ref) override;
124  bool resolve_type(THD *thd) override {
125  if (param_type_is_default(thd, 0, -1)) return true;
126  return false;
127  }
129 
130  protected:
131  /**
132  Calls push_warning_printf for packet overflow.
133  @return error_str().
134  */
135  String *push_packet_overflow_warning(THD *thd, const char *func);
136 };
137 
138 /*
139  Functions that return values with ASCII repertoire
140 */
143 
144  public:
147  }
148 
151  }
154  }
155 
158  }
160  : Item_str_func(pos, a, b) {
162  }
163 
164  Item_str_ascii_func(Item *a, Item *b, Item *c) : Item_str_func(a, b, c) {
166  }
167  Item_str_ascii_func(const POS &pos, Item *a, Item *b, Item *c)
168  : Item_str_func(pos, a, b, c) {
170  }
171 
172  String *val_str(String *str) override {
174  }
175  String *val_str_ascii(String *) override = 0;
176 };
177 
178 class Item_func_md5 final : public Item_str_ascii_func {
180 
181  public:
183  String *val_str_ascii(String *) override;
184  bool resolve_type(THD *thd) override;
185  const char *func_name() const override { return "md5"; }
186 };
187 
189  public:
191  String *val_str_ascii(String *) override;
192  bool resolve_type(THD *thd) override;
193  const char *func_name() const override { return "sha"; }
194 };
195 
197  public:
198  Item_func_sha2(const POS &pos, Item *a, Item *b)
199  : Item_str_ascii_func(pos, a, b) {}
200  String *val_str_ascii(String *) override;
201  bool resolve_type(THD *thd) override;
202  const char *func_name() const override { return "sha2"; }
203 };
204 
207 
208  public:
210  String *val_str_ascii(String *) override;
211  bool resolve_type(THD *) override;
212  const char *func_name() const override { return "to_base64"; }
213 };
214 
216  public:
217  Item_func_statement_digest(const POS &pos, Item *query_string)
218  : Item_str_ascii_func(pos, query_string) {}
219 
220  const char *func_name() const override { return "statement_digest"; }
221  bool check_function_as_value_generator(uchar *checker_args) override {
223  pointer_cast<Check_function_as_value_generator_parameters *>(
224  checker_args);
225  func_arg->banned_function_name = func_name();
226  return (func_arg->source == VGS_GENERATED_COLUMN);
227  }
228 
229  bool resolve_type(THD *thd) override;
230 
231  String *val_str_ascii(String *) override;
232 
233  private:
235 };
236 
238  public:
240  : Item_str_func(pos, query_string) {}
241 
242  const char *func_name() const override { return "statement_digest_text"; }
243 
244  /**
245  The type is always LONGTEXT, just like the digest_text columns in
246  Performance Schema
247  */
248  bool resolve_type(THD *thd) override;
249 
250  bool check_function_as_value_generator(uchar *checker_args) override {
252  pointer_cast<Check_function_as_value_generator_parameters *>(
253  checker_args);
254  func_arg->banned_function_name = func_name();
255  return (func_arg->source == VGS_GENERATED_COLUMN);
256  }
257  String *val_str(String *) override;
258 
259  private:
261 };
262 
263 class Item_func_from_base64 final : public Item_str_func {
265 
266  public:
268  String *val_str(String *) override;
269  bool resolve_type(THD *thd) override;
270  const char *func_name() const override { return "from_base64"; }
271 };
272 
273 class Item_func_aes_encrypt final : public Item_str_func {
276 
277  public:
279  : Item_str_func(pos, a, b) {}
281  : Item_str_func(pos, a, b, c) {}
282 
283  bool itemize(Parse_context *pc, Item **res) override;
284  String *val_str(String *) override;
285  bool resolve_type(THD *) override;
286  const char *func_name() const override { return "aes_encrypt"; }
287 };
288 
291 
292  public:
294  : Item_str_func(pos, a, b) {}
296  : Item_str_func(pos, a, b, c) {}
297 
298  bool itemize(Parse_context *pc, Item **res) override;
299  String *val_str(String *) override;
300  bool resolve_type(THD *thd) override;
301  const char *func_name() const override { return "aes_decrypt"; }
302 };
303 
306 
307  /** limitation from the SSL library */
309 
310  public:
312 
313  bool itemize(Parse_context *pc, Item **res) override;
314  bool resolve_type(THD *thd) override;
315  String *val_str(String *a) override;
316 
317  const char *func_name() const override { return "random_bytes"; }
318 };
319 
321  String tmp_value{"", 0, collation.collation}; // Initialize to empty
322  public:
324  : Item_str_func(pos, opt_list) {}
326  Item_func_concat(const POS &pos, Item *a, Item *b)
327  : Item_str_func(pos, a, b) {}
328 
329  String *val_str(String *) override;
330  bool resolve_type(THD *thd) override;
331  const char *func_name() const override { return "concat"; }
332 };
333 
335  String tmp_value{"", 0, collation.collation}; // Initialize to empty
336  public:
338  : Item_str_func(list) {
339  null_on_null = false;
340  }
342  : Item_str_func(pos, opt_list) {
343  null_on_null = false;
344  }
345  String *val_str(String *) override;
346  bool resolve_type(THD *thd) override;
347  const char *func_name() const override { return "concat_ws"; }
348 };
349 
352 
353  public:
356 
357  String *val_str(String *) override;
358  bool resolve_type(THD *thd) override;
359  const char *func_name() const override { return "reverse"; }
360 };
361 
364  /// Holds result in case we need to allocate our own result buffer.
366 
367  public:
369  : Item_str_func(pos, org, find, replace) {}
370  String *val_str(String *) override;
371  bool resolve_type(THD *thd) override;
372  const char *func_name() const override { return "replace"; }
373 };
374 
377  /// Holds result in case we need to allocate our own result buffer.
379 
380  public:
382  Item *new_str)
383  : Item_str_func(pos, org, start, length, new_str) {}
384  String *val_str(String *) override;
385  bool resolve_type(THD *thd) override;
386  const char *func_name() const override { return "insert"; }
387 };
388 
389 class Item_str_conv : public Item_str_func {
390  protected:
394 
395  public:
396  Item_str_conv(const POS &pos, Item *item) : Item_str_func(pos, item) {}
397  String *val_str(String *) override;
398 };
399 
401  public:
402  Item_func_lower(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
403  const char *func_name() const override { return "lower"; }
404  bool resolve_type(THD *) override;
405 };
406 
408  public:
409  Item_func_upper(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
410  const char *func_name() const override { return "upper"; }
411  bool resolve_type(THD *) override;
412 };
413 
416 
417  public:
418  Item_func_left(const POS &pos, Item *a, Item *b) : Item_str_func(pos, a, b) {}
419  String *val_str(String *) override;
420  bool resolve_type(THD *thd) override;
421  const char *func_name() const override { return "left"; }
422 };
423 
426 
427  public:
428  Item_func_right(const POS &pos, Item *a, Item *b)
429  : Item_str_func(pos, a, b) {}
430  String *val_str(String *) override;
431  bool resolve_type(THD *thd) override;
432  const char *func_name() const override { return "right"; }
433 };
434 
437 
439 
440  public:
442  Item_func_substr(const POS &pos, Item *a, Item *b) : super(pos, a, b) {}
443 
444  Item_func_substr(Item *a, Item *b, Item *c) : Item_str_func(a, b, c) {}
445  Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
446  : super(pos, a, b, c) {}
447 
448  String *val_str(String *) override;
449  bool resolve_type(THD *thd) override;
450  const char *func_name() const override { return "substr"; }
451 };
452 
453 class Item_func_substr_index final : public Item_str_func {
455 
456  public:
458  : Item_str_func(pos, a, b, c) {}
459  String *val_str(String *) override;
460  bool resolve_type(THD *) override;
461  const char *func_name() const override { return "substring_index"; }
462 };
463 
465  public:
466  /**
467  Why all the trim modes in this enum?
468  We need to maintain parsing information, so that our print() function
469  can reproduce correct messages and view definitions.
470  */
471  enum TRIM_MODE {
477  TRIM_RTRIM
478  };
479 
480  private:
484  const bool m_trim_leading;
485  const bool m_trim_trailing;
486 
487  public:
489  : Item_str_func(a, b),
490  m_trim_mode(tm),
493 
494  Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
495  : Item_str_func(pos, a, b),
496  m_trim_mode(tm),
499 
501  : Item_str_func(a),
502  m_trim_mode(tm),
505 
507  : Item_str_func(pos, a),
508  m_trim_mode(tm),
511 
512  bool trim_leading() const {
515  }
516 
517  bool trim_trailing() const {
520  }
521 
522  String *val_str(String *) override;
523  bool resolve_type(THD *) override;
524  const char *func_name() const override {
525  switch (m_trim_mode) {
526  case TRIM_BOTH_DEFAULT:
527  return "trim";
528  case TRIM_BOTH:
529  return "trim";
530  case TRIM_LEADING:
531  return "ltrim";
532  case TRIM_TRAILING:
533  return "rtrim";
534  case TRIM_LTRIM:
535  return "ltrim";
536  case TRIM_RTRIM:
537  return "rtrim";
538  }
539  return nullptr;
540  }
541  void print(const THD *thd, String *str,
542  enum_query_type query_type) const override;
543 };
544 
545 class Item_func_ltrim final : public Item_func_trim {
546  public:
548  : Item_func_trim(pos, a, TRIM_LTRIM) {}
549 };
550 
551 class Item_func_rtrim final : public Item_func_trim {
552  public:
554  : Item_func_trim(pos, a, TRIM_RTRIM) {}
555 };
556 
559 
560  public:
563  }
564  explicit Item_func_sysconst(const POS &pos) : super(pos) {
566  }
567 
568  Item *safe_charset_converter(THD *thd, const CHARSET_INFO *tocs) override;
569  /*
570  Used to create correct Item name in new converted item in
571  safe_charset_converter, return string representation of this function
572  call
573  */
574  virtual const Name_string fully_qualified_func_name() const = 0;
575  bool check_function_as_value_generator(uchar *checker_args) override {
577  pointer_cast<Check_function_as_value_generator_parameters *>(
578  checker_args);
579  func_arg->banned_function_name = func_name();
580  return ((func_arg->source == VGS_GENERATED_COLUMN) ||
581  (func_arg->source == VGS_CHECK_CONSTRAINT));
582  }
583 };
584 
587 
588  public:
590 
591  bool itemize(Parse_context *pc, Item **res) override;
592 
593  String *val_str(String *) override;
594  bool resolve_type(THD *) override {
596  set_nullable(true);
597  return false;
598  }
599  const char *func_name() const override { return "database"; }
600  const Name_string fully_qualified_func_name() const override {
601  return NAME_STRING("database()");
602  }
603 };
604 
607 
608  protected:
609  /// True when function value is evaluated, set to false after each execution
610  bool m_evaluated = false;
611 
612  /// Evaluate user name, must be called once per execution
613  bool evaluate(const char *user, const char *host);
614  type_conversion_status save_in_field_inner(Field *field, bool) override;
615 
616  public:
618  explicit Item_func_user(const POS &pos) : super(pos) {
620  }
621 
623  return INNER_TABLE_BIT;
624  }
625 
626  bool itemize(Parse_context *pc, Item **res) override;
627 
628  bool check_function_as_value_generator(uchar *checker_args) override {
630  pointer_cast<Check_function_as_value_generator_parameters *>(
631  checker_args);
632  func_arg->banned_function_name = func_name();
633  return true;
634  }
635  bool resolve_type(THD *) override {
637  return false;
638  }
639  void cleanup() override {
640  m_evaluated = false;
642  super::cleanup();
643  }
644  const char *func_name() const override { return "user"; }
645  const Name_string fully_qualified_func_name() const override {
646  return NAME_STRING("user()");
647  }
648 
649  String *val_str(String *) override;
650 };
651 
654 
656 
657  protected:
658  type_conversion_status save_in_field_inner(Field *field, bool) override;
659 
660  public:
661  explicit Item_func_current_user(const POS &pos) : super(pos) {}
662 
663  bool itemize(Parse_context *pc, Item **res) override;
664  const char *func_name() const override { return "current_user"; }
665  const Name_string fully_qualified_func_name() const override {
666  return NAME_STRING("current_user()");
667  }
668 
669  String *val_str(String *) override;
670 };
671 
674 
675  public:
678  String *val_str(String *) override;
679  bool resolve_type(THD *thd) override;
680  const char *func_name() const override { return "soundex"; }
681 };
682 
683 class Item_func_elt final : public Item_str_func {
684  public:
685  Item_func_elt(const POS &pos, PT_item_list *opt_list)
686  : Item_str_func(pos, opt_list) {}
687  double val_real() override;
688  longlong val_int() override;
689  String *val_str(String *str) override;
690  bool resolve_type(THD *thd) override;
691  const char *func_name() const override { return "elt"; }
692 };
693 
694 class Item_func_make_set final : public Item_str_func {
696 
699 
700  public:
701  Item_func_make_set(const POS &pos, Item *a, PT_item_list *opt_list)
702  : Item_str_func(pos, opt_list), item(a) {}
703 
704  bool itemize(Parse_context *pc, Item **res) override;
705  String *val_str(String *str) override;
706  bool fix_fields(THD *thd, Item **ref) override {
707  assert(fixed == 0);
708  bool res = ((!item->fixed && item->fix_fields(thd, &item)) ||
711  return res;
712  }
713  void split_sum_func(THD *thd, Ref_item_array ref_item_array,
714  mem_root_deque<Item *> *fields) override;
715  bool resolve_type(THD *) override;
716  void update_used_tables() override;
717  const char *func_name() const override { return "make_set"; }
718 
719  bool walk(Item_processor processor, enum_walk walk, uchar *arg) override {
720  if ((walk & enum_walk::PREFIX) && (this->*processor)(arg)) return true;
721  if (item->walk(processor, walk, arg)) return true;
722  for (uint i = 0; i < arg_count; i++) {
723  if (args[i]->walk(processor, walk, arg)) return true;
724  }
725  return ((walk & enum_walk::POSTFIX) && (this->*processor)(arg));
726  }
727 
728  Item *transform(Item_transformer transformer, uchar *arg) override;
729  void print(const THD *thd, String *str,
730  enum_query_type query_type) const override;
731 };
732 
733 class Item_func_format final : public Item_str_ascii_func {
736 
737  public:
739  : Item_str_ascii_func(pos, org, dec) {}
740  Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
741  : Item_str_ascii_func(pos, org, dec, lang) {}
742 
743  MY_LOCALE *get_locale(Item *item);
744  String *val_str_ascii(String *) override;
745  bool resolve_type(THD *thd) override;
746  const char *func_name() const override { return "format"; }
747  void print(const THD *thd, String *str,
748  enum_query_type query_type) const override;
749 };
750 
751 class Item_func_char final : public Item_str_func {
752  public:
754  : Item_str_func(pos, list) {
756  }
758  : Item_str_func(pos, list) {
759  collation.set(cs);
760  }
761  String *val_str(String *) override;
762  bool resolve_type(THD *thd) override {
763  if (param_type_is_default(thd, 0, -1, MYSQL_TYPE_LONGLONG)) return true;
765  return false;
766  }
767  const char *func_name() const override { return "char"; }
768 };
769 
770 class Item_func_repeat final : public Item_str_func {
772 
773  public:
774  Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
775  : Item_str_func(pos, arg1, arg2) {}
776  String *val_str(String *) override;
777  bool resolve_type(THD *thd) override;
778  const char *func_name() const override { return "repeat"; }
779 };
780 
781 class Item_func_space final : public Item_str_func {
782  public:
783  Item_func_space(const POS &pos, Item *arg1) : Item_str_func(pos, arg1) {}
784  String *val_str(String *) override;
785  bool resolve_type(THD *) override;
786  const char *func_name() const override { return "space"; }
787 };
788 
789 class Item_func_rpad final : public Item_str_func {
791 
792  public:
793  Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
794  : Item_str_func(pos, arg1, arg2, arg3) {}
795  String *val_str(String *) override;
796  bool resolve_type(THD *) override;
797  const char *func_name() const override { return "rpad"; }
798 };
799 
800 class Item_func_lpad final : public Item_str_func {
802 
803  public:
804  Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
805  : Item_str_func(pos, arg1, arg2, arg3) {}
806  String *val_str(String *) override;
807  bool resolve_type(THD *) override;
808  const char *func_name() const override { return "lpad"; }
809 };
810 
811 class Item_func_uuid_to_bin final : public Item_str_func {
812  /// Buffer to store the binary result
814 
815  public:
817  : Item_str_func(pos, arg1) {}
818  Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
819  : Item_str_func(pos, arg1, arg2) {}
820  String *val_str(String *) override;
821  bool resolve_type(THD *) override;
822  const char *func_name() const override { return "uuid_to_bin"; }
823 };
824 
826  /// Buffer to store the text result
828 
829  public:
831  : Item_str_ascii_func(pos, arg1) {}
832  Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
833  : Item_str_ascii_func(pos, arg1, arg2) {}
834  String *val_str_ascii(String *) override;
835  bool resolve_type(THD *thd) override;
836  const char *func_name() const override { return "bin_to_uuid"; }
837 };
838 
839 class Item_func_is_uuid final : public Item_bool_func {
841 
842  public:
844  longlong val_int() override;
845  const char *func_name() const override { return "is_uuid"; }
846  bool resolve_type(THD *thd) override {
847  bool res = super::resolve_type(thd);
848  set_nullable(true);
849  return res;
850  }
851 };
852 
853 class Item_func_conv final : public Item_str_func {
854  public:
855  // 64 digits plus possible '-'.
856  static constexpr uint32_t CONV_MAX_LENGTH = 64U + 1U;
857  Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
858  : Item_str_func(pos, a, b, c) {}
859  const char *func_name() const override { return "conv"; }
860  String *val_str(String *) override;
861  bool resolve_type(THD *) override;
862 };
863 
866 
867  public:
869  const char *func_name() const override { return "hex"; }
870  String *val_str_ascii(String *) override;
871  bool resolve_type(THD *thd) override {
872  if (param_type_is_default(thd, 0, -1)) return true;
874  return false;
875  }
876 };
877 
878 class Item_func_unhex final : public Item_str_func {
880 
881  public:
883  /* there can be bad hex strings */
884  set_nullable(true);
885  }
886  const char *func_name() const override { return "unhex"; }
887  String *val_str(String *) override;
888  bool resolve_type(THD *thd) override;
889 };
890 
891 #ifndef NDEBUG
893  protected:
896  const bool is_min;
897 
898  public:
899  Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
900  : Item_str_func(pos, a, b), is_min(is_min_arg) {
901  set_nullable(true);
902  }
903  String *val_str(String *) override;
904  bool resolve_type(THD *thd) override {
905  if (param_type_is_default(thd, 0, 1)) return true;
906  if (param_type_is_default(thd, 1, 2, MYSQL_TYPE_LONGLONG)) return true;
908  return false;
909  }
910 };
911 
913  public:
915  : Item_func_like_range(pos, a, b, true) {}
916  const char *func_name() const override { return "like_range_min"; }
917 };
918 
920  public:
922  : Item_func_like_range(pos, a, b, false) {}
923  const char *func_name() const override { return "like_range_max"; }
924 };
925 #endif
926 
927 class Item_typecast_char final : public Item_str_func {
932 
933  public:
934  Item_typecast_char(Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
935  : Item_str_func(a), cast_length(length_arg), cast_cs(cs_arg) {}
936  Item_typecast_char(const POS &pos, Item *a, longlong length_arg,
937  const CHARSET_INFO *cs_arg)
938  : Item_str_func(pos, a), cast_length(length_arg), cast_cs(cs_arg) {}
939  enum Functype functype() const override { return TYPECAST_FUNC; }
940  bool eq(const Item *item, bool binary_cmp) const override;
941  const char *func_name() const override { return "cast_as_char"; }
942  String *val_str(String *a) override;
943  bool resolve_type(THD *) override;
944  void print(const THD *thd, String *str,
945  enum_query_type query_type) const override;
946 };
947 
948 class Item_load_file final : public Item_str_func {
950 
952 
953  public:
955 
956  bool itemize(Parse_context *pc, Item **res) override;
957  String *val_str(String *) override;
958  const char *func_name() const override { return "load_file"; }
960  return INNER_TABLE_BIT;
961  }
962  bool resolve_type(THD *thd) override {
963  if (param_type_is_default(thd, 0, 1)) return true;
966  set_nullable(true);
967  return false;
968  }
969  bool check_function_as_value_generator(uchar *checker_args) override {
971  pointer_cast<Check_function_as_value_generator_parameters *>(
972  checker_args);
973  func_arg->banned_function_name = func_name();
974  return true;
975  }
976 };
977 
978 class Item_func_export_set final : public Item_str_func {
979  public:
980  Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
981  : Item_str_func(pos, a, b, c) {}
982  Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
983  : Item_str_func(pos, a, b, c, d) {}
984  Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d,
985  Item *e)
986  : Item_str_func(pos, a, b, c, d, e) {}
987  String *val_str(String *str) override;
988  bool resolve_type(THD *) override;
989  const char *func_name() const override { return "export_set"; }
990 };
991 
994 
995  public:
997  const char *func_name() const override { return "quote"; }
998  String *val_str(String *) override;
999  bool resolve_type(THD *thd) override;
1000 };
1001 
1003  /// Marks weather the underlying Item is constant and may be cached.
1006 
1007  public:
1008  /**
1009  The following types of conversions are considered safe:
1010 
1011  Conversion to and from "binary".
1012  Conversion to Unicode.
1013  Other kind of conversions are potentially lossy.
1014  */
1015  bool safe;
1016  const CHARSET_INFO *conv_charset; // keep it public
1018  : Item_str_func(pos, a) {
1019  conv_charset = cs;
1020  use_cached_value = false;
1021  safe = false;
1022  }
1023 
1025  bool cache_if_const)
1026  : Item_str_func(a) {
1027  assert(args[0]->fixed);
1028 
1029  conv_charset = cs;
1030  if (cache_if_const && args[0]->may_evaluate_const(thd)) {
1031  uint errors = 0;
1032  String tmp, *str = args[0]->val_str(&tmp);
1033  if (!str || str_value.copy(str->ptr(), str->length(), str->charset(),
1034  conv_charset, &errors))
1035  null_value = true;
1036  use_cached_value = true;
1038  safe = (errors == 0);
1039  } else {
1040  use_cached_value = false;
1041  // Marks weather the conversion is safe
1043  cs == &my_charset_bin || (cs->state & MY_CS_UNICODE));
1044  }
1045  }
1046  String *val_str(String *) override;
1047  bool resolve_type(THD *) override;
1048  const char *func_name() const override { return "convert"; }
1049  void print(const THD *thd, String *str,
1050  enum_query_type query_type) const override;
1051 };
1052 
1055 
1057 
1058  public:
1060  const LEX_STRING &collation_string_arg)
1061  : super(pos, a, nullptr), collation_string(collation_string_arg) {}
1062 
1063  bool itemize(Parse_context *pc, Item **res) override;
1064  String *val_str(String *) override;
1065  bool resolve_type(THD *) override;
1066  bool eq(const Item *item, bool binary_cmp) const override;
1067  const char *func_name() const override { return "collate"; }
1068  enum Functype functype() const override { return COLLATE_FUNC; }
1069  void print(const THD *thd, String *str,
1070  enum_query_type query_type) const override;
1072  /* this function is transparent for view updating */
1073  return args[0]->field_for_view_update();
1074  }
1075 };
1076 
1077 class Item_func_charset final : public Item_str_func {
1078  public:
1080  null_on_null = false;
1081  }
1082  String *val_str(String *) override;
1083  const char *func_name() const override { return "charset"; }
1084  bool resolve_type(THD *thd) override {
1086  set_nullable(false);
1087  return Item_str_func::resolve_type(thd);
1088  }
1089 };
1090 
1092  public:
1094  null_on_null = false;
1095  }
1096  String *val_str(String *) override;
1097  const char *func_name() const override { return "collation"; }
1098  bool resolve_type(THD *thd) override {
1099  if (Item_str_func::resolve_type(thd)) return true;
1101  set_nullable(false);
1102  return false;
1103  }
1104 };
1105 
1108 
1114  const bool as_binary;
1115 
1116  public:
1117  Item_func_weight_string(const POS &pos, Item *a, uint result_length_arg,
1118  uint num_codepoints_arg, uint flags_arg,
1119  bool as_binary_arg = false)
1120  : Item_str_func(pos, a),
1121  flags(flags_arg),
1122  num_codepoints(num_codepoints_arg),
1123  result_length(result_length_arg),
1124  as_binary(as_binary_arg) {}
1125 
1126  bool itemize(Parse_context *pc, Item **res) override;
1127 
1128  const char *func_name() const override { return "weight_string"; }
1129  bool eq(const Item *item, bool binary_cmp) const override;
1130  String *val_str(String *) override;
1131  bool resolve_type(THD *) override;
1132  void print(const THD *thd, String *str,
1133  enum_query_type query_type) const override;
1134 };
1135 
1136 class Item_func_crc32 final : public Item_int_func {
1138 
1139  public:
1141  unsigned_flag = true;
1142  }
1143  const char *func_name() const override { return "crc32"; }
1144  bool resolve_type(THD *thd) override {
1145  if (param_type_is_default(thd, 0, 1)) return true;
1146  max_length = 10;
1147  return false;
1148  }
1149  longlong val_int() override;
1150 };
1151 
1154 
1155  public:
1157  : Item_int_func(pos, a) {}
1158  const char *func_name() const override { return "uncompressed_length"; }
1159  bool resolve_type(THD *thd) override {
1160  if (param_type_is_default(thd, 0, 1)) return true;
1161  max_length = 10;
1162  return false;
1163  }
1164  longlong val_int() override;
1165 };
1166 
1167 class Item_func_compress final : public Item_str_func {
1169 
1170  public:
1172  bool resolve_type(THD *thd) override;
1173  const char *func_name() const override { return "compress"; }
1174  String *val_str(String *str) override;
1175 };
1176 
1177 class Item_func_uncompress final : public Item_str_func {
1179 
1180  public:
1182  bool resolve_type(THD *thd) override {
1183  if (Item_str_func::resolve_type(thd)) return true;
1184  set_nullable(true);
1186  return false;
1187  }
1188  const char *func_name() const override { return "uncompress"; }
1189  String *val_str(String *str) override;
1190 };
1191 
1192 class Item_func_uuid final : public Item_str_func {
1194 
1195  public:
1197  explicit Item_func_uuid(const POS &pos) : Item_str_func(pos) {}
1198 
1199  bool itemize(Parse_context *pc, Item **res) override;
1201  return RAND_TABLE_BIT;
1202  }
1203  bool resolve_type(THD *) override;
1204  const char *func_name() const override { return "uuid"; }
1205  String *val_str(String *) override;
1206  bool check_function_as_value_generator(uchar *checker_args) override {
1208  pointer_cast<Check_function_as_value_generator_parameters *>(
1209  checker_args);
1210  func_arg->banned_function_name = func_name();
1211  return ((func_arg->source == VGS_GENERATED_COLUMN) ||
1212  (func_arg->source == VGS_CHECK_CONSTRAINT));
1213  }
1214 };
1215 
1218 
1219  public:
1221  : Item_str_ascii_func(pos, a, b) {}
1222  bool resolve_type(THD *) override;
1223  const char *func_name() const override { return "gtid_subtract"; }
1224  String *val_str_ascii(String *) override;
1225 };
1226 
1229 
1230  public:
1232  explicit Item_func_current_role(const POS &pos)
1233  : super(pos), value_cache_set(false) {}
1234  const char *func_name() const override { return "current_role"; }
1235  void cleanup() override;
1236  String *val_str(String *) override;
1237  bool resolve_type(THD *) override {
1239  return false;
1240  }
1241  const Name_string fully_qualified_func_name() const override {
1242  return NAME_STRING("current_role()");
1243  }
1244 
1245  protected:
1246  void set_current_role(THD *thd);
1247  /** a flag whether @ref value_cache is set or not */
1249  /**
1250  @brief Cache for the result value
1251 
1252  Set by init(). And consumed by val_str().
1253  Needed to avoid re-calculation of the current_roles() in the
1254  course of the query.
1255  */
1257 };
1258 
1261 
1262  public:
1265  : super(pos), value_cache_set(false) {}
1266  String *val_str(String *) override;
1267  void cleanup() override;
1268 
1269  bool resolve_type(THD *) override {
1271  return false;
1272  }
1273 
1274  const char *func_name() const override { return "roles_graphml"; }
1275 
1276  const Name_string fully_qualified_func_name() const override {
1277  return NAME_STRING("roles_graphml()");
1278  }
1279 
1280  protected:
1281  bool calculate_graphml(THD *thd);
1282  /**
1283  @brief Cache for the result value
1284 
1285  Set by init(). And consumed by val_str().
1286  Needed to avoid re-calculation of the current_roles() in the
1287  course of the query.
1288  */
1290 
1291  /** Set to true if @ref value_cache is set */
1293 };
1294 
1296  public:
1298  : Item_str_func(pos, a, b, c) {}
1299 
1300  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1301  bool resolve_type(THD *) override {
1302  /*
1303  There are 14 kinds of grants, with a max length
1304  per privileges is 11 chars.
1305  So, setting max approximate to 200.
1306  */
1308  set_nullable(true);
1309  null_on_null = false;
1310 
1311  return false;
1312  }
1313 
1314  const char *func_name() const override { return "get_dd_column_privileges"; }
1315 
1316  String *val_str(String *) override;
1317 };
1318 
1320  public:
1322  : Item_str_func(pos, a, b, c) {}
1323 
1324  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1325  bool resolve_type(THD *) override {
1326  // maximum string length of all options is expected
1327  // to be less than 256 characters.
1329  set_nullable(false);
1330  null_on_null = false;
1331 
1332  return false;
1333  }
1334 
1335  const char *func_name() const override { return "get_dd_create_options"; }
1336 
1337  String *val_str(String *) override;
1338 };
1339 
1341  public:
1343  : Item_str_func(pos, a) {}
1344 
1345  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1346  bool resolve_type(THD *) override {
1347  // maximum string length of all options is expected
1348  // to be less than 256 characters.
1350  set_nullable(false);
1351  null_on_null = false;
1352 
1353  return false;
1354  }
1355 
1356  const char *func_name() const override { return "get_dd_schema_options"; }
1357 
1358  String *val_str(String *) override;
1359 };
1360 
1362  public:
1364  : Item_str_func(pos, list) {}
1365 
1366  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1367  bool resolve_type(THD *) override {
1368  /*
1369  maximum expected string length to be less than 2048 characters,
1370  which is same as size of column holding comments in dictionary,
1371  i.e., the mysql.tables.comment DD column.
1372  */
1374  set_nullable(true);
1375  null_on_null = false;
1376 
1377  return false;
1378  }
1379 
1380  const char *func_name() const override {
1381  return "internal_get_comment_or_error";
1382  }
1383 
1384  String *val_str(String *) override;
1385 };
1386 
1388  public:
1390  : Item_str_func(pos, a, b) {}
1391 
1392  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1393  bool resolve_type(THD *) override {
1394  /* maximum string length of the property value is expected
1395  to be less than 256 characters. */
1396  set_data_type_string(256U);
1397  set_nullable(false);
1398  null_on_null = false;
1399 
1400  return false;
1401  }
1402 
1403  const char *func_name() const override {
1404  return "get_dd_tablespace_private_data";
1405  }
1406 
1407  String *val_str(String *) override;
1408 };
1409 
1411  public:
1413  : Item_str_func(pos, a, b) {}
1414 
1415  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1416  bool resolve_type(THD *) override {
1417  /* maximum string length of the property value is expected
1418  to be less than 256 characters. */
1419  set_data_type_string(256U);
1420  set_nullable(false);
1421  null_on_null = false;
1422 
1423  return false;
1424  }
1425 
1426  const char *func_name() const override { return "get_dd_index_private_data"; }
1427 
1428  String *val_str(String *) override;
1429 };
1430 
1432  public:
1434  : Item_str_func(pos, a) {}
1435 
1436  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1437  bool resolve_type(THD *) override {
1438  // maximum string length of all options is expected
1439  // to be less than 256 characters.
1441  set_nullable(true);
1442  null_on_null = false;
1443 
1444  return false;
1445  }
1446 
1447  const char *func_name() const override {
1448  return "internal_get_partition_nodegroup";
1449  }
1450 
1451  String *val_str(String *) override;
1452 };
1453 
1455  public:
1457  Item *d)
1458  : Item_str_func(pos, a, b, c, d) {}
1459 
1460  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1461  bool resolve_type(THD *) override {
1462  // maximum string length of all options is expected
1463  // to be less than 256 characters.
1465  set_nullable(true);
1466  null_on_null = false;
1467 
1468  return false;
1469  }
1470 
1471  const char *func_name() const override { return "internal_tablespace_type"; }
1472 
1473  String *val_str(String *) override;
1474 };
1475 
1477  public:
1479  Item *b, Item *c, Item *d)
1480  : Item_str_func(pos, a, b, c, d) {}
1481 
1482  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1483  bool resolve_type(THD *) override {
1484  // maximum string length of all options is expected
1485  // to be less than 256 characters.
1487  set_nullable(true);
1488  null_on_null = false;
1489 
1490  return false;
1491  }
1492 
1493  const char *func_name() const override {
1494  return "internal_tablespace_logfile_group_name";
1495  }
1496 
1497  String *val_str(String *) override;
1498 };
1499 
1501  public:
1503  Item *c, Item *d)
1504  : Item_str_func(pos, a, b, c, d) {}
1505 
1506  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1507  bool resolve_type(THD *) override {
1508  // maximum string length of all options is expected
1509  // to be less than 256 characters.
1511  set_nullable(true);
1512  null_on_null = false;
1513 
1514  return false;
1515  }
1516 
1517  const char *func_name() const override {
1518  return "internal_tablespace_status";
1519  }
1520  String *val_str(String *) override;
1521 };
1522 
1524  public:
1526  Item *c, Item *d)
1527  : Item_str_func(pos, a, b, c, d) {}
1528 
1529  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1530  bool resolve_type(THD *) override {
1531  // maximum string length of all options is expected
1532  // to be less than 256 characters.
1534  set_nullable(true);
1535  null_on_null = false;
1536 
1537  return false;
1538  }
1539 
1540  const char *func_name() const override {
1541  return "internal_tablespace_row_format";
1542  }
1543 
1544  String *val_str(String *) override;
1545 };
1546 
1548  public:
1550  Item *d)
1551  : Item_str_func(pos, a, b, c, d) {}
1552 
1553  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1554  bool resolve_type(THD *) override {
1555  // maximum string length of all options is expected
1556  // to be less than 256 characters.
1558  set_nullable(true);
1559  null_on_null = false;
1560 
1561  return false;
1562  }
1563 
1564  const char *func_name() const override { return "internal_tablespace_extra"; }
1565 
1566  String *val_str(String *) override;
1567 };
1568 
1570  public:
1572  : Item_str_func(pos, list) {}
1573 
1574  bool resolve_type(THD *) override {
1575  set_nullable(false);
1577  return false;
1578  }
1579 
1580  const char *func_name() const override { return "convert_cpu_id_mask"; }
1581 
1582  String *val_str(String *) override;
1583 };
1584 
1586  public:
1588  : Item_str_func(pos, a, b) {}
1589 
1590  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1591  bool resolve_type(THD *) override {
1593  set_nullable(true);
1594  null_on_null = false;
1595 
1596  return false;
1597  }
1598 
1599  const char *func_name() const override { return "get_dd_property_key_value"; }
1600 
1601  String *val_str(String *) override;
1602 };
1603 
1605  public:
1607  : Item_str_func(pos, a, b) {}
1608 
1609  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1610  bool resolve_type(THD *) override {
1612  set_nullable(true);
1613  null_on_null = false;
1614 
1615  return false;
1616  }
1617 
1618  const char *func_name() const override { return "remove_dd_property_key"; }
1619 
1620  String *val_str(String *) override;
1621 };
1622 
1624  public:
1626  : Item_str_func(pos, a, b) {}
1627 
1628  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1629  bool resolve_type(THD *) override {
1630  // maximum string length of all options is expected
1631  // to be less than 256 characters.
1633  set_nullable(true);
1634  null_on_null = false;
1635 
1636  return false;
1637  }
1638 
1639  const char *func_name() const override {
1640  return "convert_interval_to_user_interval";
1641  }
1642 
1643  String *val_str(String *) override;
1644 };
1645 
1647  public:
1649  : Item_str_func(pos, list) {}
1650 
1651  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1652  bool resolve_type(THD *) override {
1654  set_nullable(true);
1655  null_on_null = false;
1656 
1657  return false;
1658  }
1659 
1660  const char *func_name() const override { return "internal_get_username"; }
1661 
1662  String *val_str(String *) override;
1663 };
1664 
1666  public:
1668  : Item_str_func(pos, list) {}
1669 
1670  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1671  bool resolve_type(THD *) override {
1673  set_nullable(true);
1674  null_on_null = false;
1675 
1676  return false;
1677  }
1678 
1679  const char *func_name() const override { return "internal_get_hostname"; }
1680 
1681  String *val_str(String *) override;
1682 };
1683 
1685  public:
1687  : Item_str_func(pos) {}
1688 
1689  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1690  bool resolve_type(THD *) override {
1692  set_nullable(true);
1693  null_on_null = false;
1694 
1695  return false;
1696  }
1697 
1698  const char *func_name() const override {
1699  return "internal_get_enabled_role_json";
1700  }
1701 
1702  String *val_str(String *) override;
1703 };
1704 
1706  public:
1708  : Item_str_func(pos) {}
1709 
1710  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1711  bool resolve_type(THD *) override {
1713  set_nullable(true);
1714  null_on_null = false;
1715 
1716  return false;
1717  }
1718 
1719  const char *func_name() const override {
1720  return "internal_get_mandatory_roles_json";
1721  }
1722 
1723  String *val_str(String *) override;
1724 };
1725 
1727  public:
1729  : Item_str_func(pos, list) {}
1730 
1731  enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1732  bool resolve_type(THD *) override {
1733  // maximum string length of all options is expected
1734  // to be less than 256 characters.
1736  set_nullable(false);
1737  null_on_null = false;
1738 
1739  return false;
1740  }
1741 
1742  const char *func_name() const override {
1743  return "internal_get_dd_column_extra";
1744  }
1745 
1746  String *val_str(String *) override;
1747 };
1748 
1749 #endif /* ITEM_STRFUNC_INCLUDED */
void set(const DTCollation &dt)
Definition: item.h:192
void set_repertoire(uint repertoire_arg)
Definition: item.h:218
const CHARSET_INFO * collation
Definition: item.h:174
Definition: field.h:590
Definition: item_cmpfunc.h:287
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:321
Definition: item.h:4027
Definition: item_strfunc.h:289
String * val_str(String *) override
Definition: item_strfunc.cc:519
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:295
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:293
Item_str_func super
Definition: item_strfunc.h:290
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:509
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:561
const char * func_name() const override
Definition: item_strfunc.h:301
Definition: item_strfunc.h:273
String * val_str(String *) override
Definition: item_strfunc.cc:452
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:280
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:278
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:442
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:499
const char * func_name() const override
Definition: item_strfunc.h:286
String tmp_value
Definition: item_strfunc.h:274
Item_str_func super
Definition: item_strfunc.h:275
Definition: item_strfunc.h:825
char m_text_buf[binary_log::Uuid::TEXT_LENGTH+1]
Buffer to store the text result.
Definition: item_strfunc.h:827
const char * func_name() const override
Definition: item_strfunc.h:836
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2736
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2745
Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:832
Item_func_bin_to_uuid(const POS &pos, Item *arg1)
Definition: item_strfunc.h:830
Definition: item_strfunc.h:751
Item_func_char(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:753
Item_func_char(const POS &pos, PT_item_list *list, const CHARSET_INFO *cs)
Definition: item_strfunc.h:757
const char * func_name() const override
Definition: item_strfunc.h:767
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:762
String * val_str(String *) override
Definition: item_strfunc.cc:2348
Definition: item_strfunc.h:1077
const char * func_name() const override
Definition: item_strfunc.h:1083
Item_func_charset(const POS &pos, Item *a)
Definition: item_strfunc.h:1079
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1084
String * val_str(String *) override
Definition: item_strfunc.cc:3071
Definition: item_strfunc.h:1091
String * val_str(String *) override
Definition: item_strfunc.cc:3085
const char * func_name() const override
Definition: item_strfunc.h:1097
Item_func_collation(const POS &pos, Item *a)
Definition: item_strfunc.h:1093
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1098
Definition: item_strfunc.h:1167
String buffer
Definition: item_strfunc.h:1168
Item_func_compress(const POS &pos, Item *a)
Definition: item_strfunc.h:1171
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3905
const char * func_name() const override
Definition: item_strfunc.h:1173
String * val_str(String *str) override
Definition: item_strfunc.cc:3913
Definition: item_strfunc.h:334
Item_func_concat_ws(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:341
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1030
String tmp_value
Definition: item_strfunc.h:335
String * val_str(String *) override
concat with separator.
Definition: item_strfunc.cc:997
const char * func_name() const override
Definition: item_strfunc.h:347
Item_func_concat_ws(mem_root_deque< Item * > *list)
Definition: item_strfunc.h:337
Definition: item_strfunc.h:320
String * val_str(String *) override
Concatenate args with the following premises: If only one arg (which is ok), return value of arg;.
Definition: item_strfunc.cc:954
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:976
Item_func_concat(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:326
Item_func_concat(Item *a, Item *b)
Definition: item_strfunc.h:325
Item_func_concat(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:323
const char * func_name() const override
Definition: item_strfunc.h:331
String tmp_value
Definition: item_strfunc.h:321
Definition: item_strfunc.h:1002
String * val_str(String *) override
Definition: item_strfunc.cc:2967
String tmp_value
Definition: item_strfunc.h:1005
bool use_cached_value
Marks weather the underlying Item is constant and may be cached.
Definition: item_strfunc.h:1004
const CHARSET_INFO * conv_charset
Definition: item_strfunc.h:1016
const char * func_name() const override
Definition: item_strfunc.h:1048
Item_func_conv_charset(const POS &pos, Item *a, const CHARSET_INFO *cs)
Definition: item_strfunc.h:1017
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2991
Item_func_conv_charset(THD *thd, Item *a, const CHARSET_INFO *cs, bool cache_if_const)
Definition: item_strfunc.h:1024
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2984
bool safe
The following types of conversions are considered safe:
Definition: item_strfunc.h:1015
Definition: item_strfunc.h:853
String * val_str(String *) override
Definition: item_strfunc.cc:2900
const char * func_name() const override
Definition: item_strfunc.h:859
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2893
static constexpr uint32_t CONV_MAX_LENGTH
Definition: item_strfunc.h:856
Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:857
Definition: item_strfunc.h:1569
const char * func_name() const override
Definition: item_strfunc.h:1580
Item_func_convert_cpu_id_mask(const POS &pos, Item *list)
Definition: item_strfunc.h:1571
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1574
String * val_str(String *) override
Definition: item_strfunc.cc:4937
Definition: item_strfunc.h:1623
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1629
enum Functype functype() const override
Definition: item_strfunc.h:1628
const char * func_name() const override
Definition: item_strfunc.h:1639
String * val_str(String *) override
Definition: item_strfunc.cc:5151
Item_func_convert_interval_to_user_interval(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1625
Definition: item_strfunc.h:1136
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1144
Item_func_crc32(const POS &pos, Item *a)
Definition: item_strfunc.h:1140
longlong val_int() override
Definition: item_strfunc.cc:3893
const char * func_name() const override
Definition: item_strfunc.h:1143
String value
Definition: item_strfunc.h:1137
Definition: item_strfunc.h:1227
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1241
void set_current_role(THD *thd)
Definition: item_strfunc.cc:4993
Item_func_current_role()
Definition: item_strfunc.h:1231
bool value_cache_set
a flag whether value_cache is set or not
Definition: item_strfunc.h:1248
Item_func_sysconst super
Definition: item_strfunc.h:1228
Item_func_current_role(const POS &pos)
Definition: item_strfunc.h:1232
String * val_str(String *) override
Definition: item_strfunc.cc:4988
const char * func_name() const override
Definition: item_strfunc.h:1234
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1237
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1256
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:4980
Definition: item_strfunc.h:652
Item_func_user super
Definition: item_strfunc.h:653
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:1877
Item_func_current_user(const POS &pos)
Definition: item_strfunc.h:661
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:665
type_conversion_status save_in_field_inner(Field *field, bool) override
We override Item::save_in_field_inner() for reasons explained in the comment of that function - we ne...
Definition: item_strfunc.cc:1822
const char * func_name() const override
Definition: item_strfunc.h:664
String * val_str(String *) override
Definition: item_strfunc.cc:1828
Name_resolution_context * context
Definition: item_strfunc.h:655
Definition: item_strfunc.h:585
const char * func_name() const override
Definition: item_strfunc.h:599
Item_func_sysconst super
Definition: item_strfunc.h:586
String * val_str(String *) override
Definition: item_strfunc.cc:1792
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:1784
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:594
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:600
Item_func_database(const POS &pos)
Definition: item_strfunc.h:589
Definition: item_strfunc.h:683
const char * func_name() const override
Definition: item_strfunc.h:691
longlong val_int() override
Definition: item_strfunc.cc:2203
String * val_str(String *str) override
Definition: item_strfunc.cc:2216
double val_real() override
Definition: item_strfunc.cc:2191
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2173
Item_func_elt(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:685
Definition: item_strfunc.h:978
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:980
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:984
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:982
String * val_str(String *str) override
Definition: item_strfunc.cc:3587
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3656
const char * func_name() const override
Definition: item_strfunc.h:989
Definition: item_strfunc.h:733
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2160
const char * func_name() const override
Definition: item_strfunc.h:746
String tmp_str
Definition: item_strfunc.h:734
MY_LOCALE * get_locale(Item *item)
Definition: item_strfunc.cc:2031
MY_LOCALE * locale
Definition: item_strfunc.h:735
Item_func_format(const POS &pos, Item *org, Item *dec)
Definition: item_strfunc.h:738
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2069
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2046
Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
Definition: item_strfunc.h:740
Definition: item_strfunc.h:263
String tmp_value
Definition: item_strfunc.h:264
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:663
const char * func_name() const override
Definition: item_strfunc.h:270
String * val_str(String *) override
Definition: item_strfunc.cc:675
Item_func_from_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:267
Definition: item_strfunc.h:1295
Item_func_get_dd_column_privileges(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1297
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1301
enum Functype functype() const override
Definition: item_strfunc.h:1300
const char * func_name() const override
Definition: item_strfunc.h:1314
String * val_str(String *) override
This function prepares string with list of column privileges.
Definition: item_strfunc.cc:4243
Definition: item_strfunc.h:1319
const char * func_name() const override
Definition: item_strfunc.h:1335
enum Functype functype() const override
Definition: item_strfunc.h:1324
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1325
String * val_str(String *) override
This function prepares string representing create_options for table.
Definition: item_strfunc.cc:4315
Item_func_get_dd_create_options(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1321
Definition: item_strfunc.h:1410
const char * func_name() const override
Definition: item_strfunc.h:1426
Item_func_get_dd_index_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1412
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1416
String * val_str(String *) override
This function prepares string representing se_private_data for index.
Definition: item_strfunc.cc:4850
enum Functype functype() const override
Definition: item_strfunc.h:1415
Definition: item_strfunc.h:1585
const char * func_name() const override
Definition: item_strfunc.h:1599
String * val_str(String *) override
This function prepares string representing value stored at key supplied.
Definition: item_strfunc.cc:5048
enum Functype functype() const override
Definition: item_strfunc.h:1590
Item_func_get_dd_property_key_value(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1587
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1591
Definition: item_strfunc.h:1340
String * val_str(String *) override
This function prepares string representing options for a schema.
Definition: item_strfunc.cc:4506
const char * func_name() const override
Definition: item_strfunc.h:1356
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1346
enum Functype functype() const override
Definition: item_strfunc.h:1345
Item_func_get_dd_schema_options(const POS &pos, Item *a)
Definition: item_strfunc.h:1342
Definition: item_strfunc.h:1387
String * val_str(String *) override
This function prepares string representing se_private_data for tablespace.
Definition: item_strfunc.cc:4784
enum Functype functype() const override
Definition: item_strfunc.h:1392
Item_func_get_dd_tablespace_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1389
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1393
const char * func_name() const override
Definition: item_strfunc.h:1403
Definition: item_strfunc.h:1431
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1437
String * val_str(String *) override
Definition: item_strfunc.cc:4631
enum Functype functype() const override
Definition: item_strfunc.h:1436
Item_func_get_partition_nodegroup(const POS &pos, Item *a)
Definition: item_strfunc.h:1433
const char * func_name() const override
Definition: item_strfunc.h:1447
Definition: item_strfunc.h:1216
Item_func_gtid_subtract(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1220
String buf1
Definition: item_strfunc.h:1217
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:4192
const char * func_name() const override
Definition: item_strfunc.h:1223
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4174
String buf2
Definition: item_strfunc.h:1217
Definition: item_strfunc.h:864
String tmp_value
Definition: item_strfunc.h:865
const char * func_name() const override
Definition: item_strfunc.h:869
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:871
Item_func_hex(const POS &pos, Item *a)
Definition: item_strfunc.h:868
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:3262
Definition: item_strfunc.h:375
String * val_str(String *) override
Definition: item_strfunc.cc:1175
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1227
const char * func_name() const override
Definition: item_strfunc.h:386
String tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:378
Item_func_insert(const POS &pos, Item *org, Item *start, Item *length, Item *new_str)
Definition: item_strfunc.h:381
String tmp_value
Definition: item_strfunc.h:376
Definition: item_strfunc.h:1361
Item_func_internal_get_comment_or_error(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1363
const char * func_name() const override
Definition: item_strfunc.h:1380
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1367
String * val_str(String *) override
Definition: item_strfunc.cc:4554
enum Functype functype() const override
Definition: item_strfunc.h:1366
Definition: item_strfunc.h:1726
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1732
String * val_str(String *) override
This function prepares string representing EXTRA column for I_S.COLUMNS.
Definition: item_strfunc.cc:5327
Item_func_internal_get_dd_column_extra(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1728
enum Functype functype() const override
Definition: item_strfunc.h:1731
const char * func_name() const override
Definition: item_strfunc.h:1742
Definition: item_strfunc.h:1684
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1690
enum Functype functype() const override
Definition: item_strfunc.h:1689
const char * func_name() const override
Definition: item_strfunc.h:1698
Item_func_internal_get_enabled_role_json(const POS &pos)
Definition: item_strfunc.h:1686
String * val_str(String *) override
Definition: item_strfunc.cc:5246
Definition: item_strfunc.h:1665
Item_func_internal_get_hostname(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1667
enum Functype functype() const override
Definition: item_strfunc.h:1670
const char * func_name() const override
Definition: item_strfunc.h:1679
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1671
String * val_str(String *) override
Definition: item_strfunc.cc:5211
Definition: item_strfunc.h:1705
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1711
enum Functype functype() const override
Definition: item_strfunc.h:1710
Item_func_internal_get_mandatory_roles_json(const POS &pos)
Definition: item_strfunc.h:1707
const char * func_name() const override
Definition: item_strfunc.h:1719
String * val_str(String *) override
Definition: item_strfunc.cc:5278
Definition: item_strfunc.h:1646
const char * func_name() const override
Definition: item_strfunc.h:1660
String * val_str(String *) override
Definition: item_strfunc.cc:5174
Item_func_internal_get_username(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1648
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1652
enum Functype functype() const override
Definition: item_strfunc.h:1651
Definition: item_strfunc.h:1547
String * val_str(String *) override
Definition: item_strfunc.cc:4750
const char * func_name() const override
Definition: item_strfunc.h:1564
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1554
enum Functype functype() const override
Definition: item_strfunc.h:1553
Item_func_internal_tablespace_extra(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1549
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1483
String * val_str(String *) override
Definition: item_strfunc.cc:4688
const char * func_name() const override
Definition: item_strfunc.h:1493
Item_func_internal_tablespace_logfile_group_name(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1478
enum Functype functype() const override
Definition: item_strfunc.h:1482
Definition: item_strfunc.h:1523
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1530
Item_func_internal_tablespace_row_format(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1525
String * val_str(String *) override
Definition: item_strfunc.cc:4728
const char * func_name() const override
Definition: item_strfunc.h:1540
enum Functype functype() const override
Definition: item_strfunc.h:1529
Definition: item_strfunc.h:1500
Item_func_internal_tablespace_status(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1502
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1507
String * val_str(String *) override
Definition: item_strfunc.cc:4711
const char * func_name() const override
Definition: item_strfunc.h:1517
enum Functype functype() const override
Definition: item_strfunc.h:1506
Definition: item_strfunc.h:1454
enum Functype functype() const override
Definition: item_strfunc.h:1460
String * val_str(String *) override
Definition: item_strfunc.cc:4671
const char * func_name() const override
Definition: item_strfunc.h:1471
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1461
Item_func_internal_tablespace_type(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1456
Definition: item_strfunc.h:839
const char * func_name() const override
Definition: item_strfunc.h:845
longlong val_int() override
Definition: item_strfunc.cc:2787
Item_func_is_uuid(const POS &pos, Item *a)
Definition: item_strfunc.h:843
Item_bool_func super
Definition: item_strfunc.h:840
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:846
Definition: item_strfunc.h:414
const char * func_name() const override
Definition: item_strfunc.h:421
Item_func_left(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:418
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1344
String tmp_value
Definition: item_strfunc.h:415
String * val_str(String *) override
Definition: item_strfunc.cc:1296
Definition: item_strfunc.h:919
const char * func_name() const override
Definition: item_strfunc.h:923
Item_func_like_range_max(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:921
Definition: item_strfunc.h:912
Item_func_like_range_min(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:914
const char * func_name() const override
Definition: item_strfunc.h:916
Definition: item_strfunc.h:892
String max_str
Definition: item_strfunc.h:895
const bool is_min
Definition: item_strfunc.h:896
Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
Definition: item_strfunc.h:899
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:904
String min_str
Definition: item_strfunc.h:894
String * val_str(String *) override
Definition: item_strfunc.cc:3336
Definition: item_strfunc.h:400
Item_func_lower(const POS &pos, Item *item)
Definition: item_strfunc.h:402
const char * func_name() const override
Definition: item_strfunc.h:403
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1274
Definition: item_strfunc.h:800
const char * func_name() const override
Definition: item_strfunc.h:808
String * val_str(String *) override
Definition: item_strfunc.cc:2800
Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:804
String tmp_value
Definition: item_strfunc.h:801
String lpad_str
Definition: item_strfunc.h:801
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2667
Definition: item_strfunc.h:545
Item_func_ltrim(const POS &pos, Item *a)
Definition: item_strfunc.h:547
Definition: item_strfunc.h:694
Item_func_make_set(const POS &pos, Item *a, PT_item_list *opt_list)
Definition: item_strfunc.h:701
String * val_str(String *str) override
Definition: item_strfunc.cc:2278
bool walk(Item_processor processor, enum_walk walk, uchar *arg) override
Definition: item_strfunc.h:719
Item_str_func super
Definition: item_strfunc.h:695
const char * func_name() const override
Definition: item_strfunc.h:717
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2337
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2252
String tmp_str
Definition: item_strfunc.h:698
void split_sum_func(THD *thd, Ref_item_array ref_item_array, mem_root_deque< Item * > *fields) override
See comments in Item_cmp_func::split_sum_func()
Definition: item_strfunc.cc:2246
bool fix_fields(THD *thd, Item **ref) override
Definition: item_strfunc.h:706
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:2236
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_strfunc.cc:2270
Item * item
Definition: item_strfunc.h:697
Item * transform(Item_transformer transformer, uchar *arg) override
Transform an Item_func object with a transformer callback function.
Definition: item_strfunc.cc:2330
Definition: item_strfunc.h:178
Item_func_md5(const POS &pos, Item *a)
Definition: item_strfunc.h:182
String tmp_value
Definition: item_strfunc.h:179
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:222
const char * func_name() const override
Definition: item_strfunc.h:185
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:180
Definition: item_strfunc.h:992
String * val_str(String *) override
QUOTE() function returns argument string in single quotes suitable for using in a SQL statement.
Definition: item_strfunc.cc:3713
const char * func_name() const override
Definition: item_strfunc.h:997
Item_func_quote(const POS &pos, Item *a)
Definition: item_strfunc.h:996
String tmp_value
Definition: item_strfunc.h:993
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3675
Definition: item_strfunc.h:304
const char * func_name() const override
Definition: item_strfunc.h:317
static const ulonglong MAX_RANDOM_BYTES_BUFFER
limitation from the SSL library
Definition: item_strfunc.h:308
Item_str_func super
Definition: item_strfunc.h:305
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:585
Item_func_random_bytes(const POS &pos, Item *a)
Definition: item_strfunc.h:311
String * val_str(String *a) override
Definition: item_strfunc.cc:591
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:568
Definition: item_strfunc.h:1604
Item_func_remove_dd_property_key(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1606
String * val_str(String *) override
This function removes a key value from given property string.
Definition: item_strfunc.cc:5105
const char * func_name() const override
Definition: item_strfunc.h:1618
enum Functype functype() const override
Definition: item_strfunc.h:1609
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1610
Definition: item_strfunc.h:770
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2398
String * val_str(String *) override
Item_func_repeat::str is carefully written to avoid reallocs as much as possible at the cost of a loc...
Definition: item_strfunc.cc:2438
String tmp_value
Definition: item_strfunc.h:771
Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:774
const char * func_name() const override
Definition: item_strfunc.h:778
Definition: item_strfunc.h:362
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1156
String * val_str(String *) override
Replace all occurences of string2 in string1 with string3.
Definition: item_strfunc.cc:1097
String tmp_value
Definition: item_strfunc.h:363
String tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:365
const char * func_name() const override
Definition: item_strfunc.h:372
String tmp_value2
Definition: item_strfunc.h:363
Item_func_replace(const POS &pos, Item *org, Item *find, Item *replace)
Definition: item_strfunc.h:368
Definition: item_strfunc.h:350
Item_func_reverse(Item *a)
Definition: item_strfunc.h:354
String * val_str(String *) override
Definition: item_strfunc.cc:1049
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1085
String tmp_value
Definition: item_strfunc.h:351
Item_func_reverse(const POS &pos, Item *a)
Definition: item_strfunc.h:355
const char * func_name() const override
Definition: item_strfunc.h:359
Definition: item_strfunc.h:424
const char * func_name() const override
Definition: item_strfunc.h:432
Item_func_right(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:428
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1375
String * val_str(String *) override
Definition: item_strfunc.cc:1353
String tmp_value
Definition: item_strfunc.h:425
Definition: item_strfunc.h:1259
Item_func_roles_graphml(const POS &pos)
Definition: item_strfunc.h:1264
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5031
const char * func_name() const override
Definition: item_strfunc.h:1274
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1289
Item_func_sysconst super
Definition: item_strfunc.h:1260
Item_func_roles_graphml()
Definition: item_strfunc.h:1263
bool calculate_graphml(THD *thd)
Constructs and caches the graphml string.
Definition: item_strfunc.cc:5011
String * val_str(String *) override
Definition: item_strfunc.cc:5026
bool value_cache_set
Set to true if value_cache is set.
Definition: item_strfunc.h:1292
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1269
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1276
Definition: item_strfunc.h:789
String tmp_value
Definition: item_strfunc.h:790
Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:793
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2541
String * val_str(String *) override
Definition: item_strfunc.cc:2567
const char * func_name() const override
Definition: item_strfunc.h:797
String rpad_str
Definition: item_strfunc.h:790
Definition: item_strfunc.h:551
Item_func_rtrim(const POS &pos, Item *a)
Definition: item_strfunc.h:553
Definition: item_strfunc.h:1053
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_strfunc.cc:3045
LEX_STRING collation_string
Definition: item_strfunc.h:1056
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3060
Item_func_set_collation(const POS &pos, Item *a, const LEX_STRING &collation_string_arg)
Definition: item_strfunc.h:1059
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3018
enum Functype functype() const override
Definition: item_strfunc.h:1068
String * val_str(String *) override
Definition: item_strfunc.cc:3010
Item_str_func super
Definition: item_strfunc.h:1054
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:3000
const char * func_name() const override
Definition: item_strfunc.h:1067
Item_field * field_for_view_update() override
Definition: item_strfunc.h:1071
Definition: item_strfunc.h:196
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:266
const char * func_name() const override
Definition: item_strfunc.h:202
Item_func_sha2(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:198
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:340
Definition: item_strfunc.h:188
const char * func_name() const override
Definition: item_strfunc.h:193
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:230
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:251
Item_func_sha(const POS &pos, Item *a)
Definition: item_strfunc.h:190
Definition: item_strfunc.h:672
Item_func_soundex(const POS &pos, Item *a)
Definition: item_strfunc.h:677
String tmp_value
Definition: item_strfunc.h:673
Item_func_soundex(Item *a)
Definition: item_strfunc.h:676
String * val_str(String *) override
Definition: item_strfunc.cc:1929
const char * func_name() const override
Definition: item_strfunc.h:680
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1885
Definition: item_strfunc.h:781
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2482
String * val_str(String *) override
Definition: item_strfunc.cc:2513
Item_func_space(const POS &pos, Item *arg1)
Definition: item_strfunc.h:783
const char * func_name() const override
Definition: item_strfunc.h:786
Definition: item_strfunc.h:237
bool resolve_type(THD *thd) override
The type is always LONGTEXT, just like the digest_text columns in Performance Schema.
Definition: item_strfunc.cc:915
const char * func_name() const override
Definition: item_strfunc.h:242
uchar * m_token_buffer
Definition: item_strfunc.h:260
Item_func_statement_digest_text(const POS &pos, Item *query_string)
Definition: item_strfunc.h:239
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_strfunc.h:250
String * val_str(String *) override
Definition: item_strfunc.cc:923
Definition: item_strfunc.h:215
uchar * m_token_buffer
Definition: item_strfunc.h:234
Item_func_statement_digest(const POS &pos, Item *query_string)
Definition: item_strfunc.h:217
String * val_str_ascii(String *) override
Implementation of the STATEMENT_DIGEST() native function.
Definition: item_strfunc.cc:885
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:870
const char * func_name() const override
Definition: item_strfunc.h:220
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_strfunc.h:221
Definition: item_strfunc.h:453
const char * func_name() const override
Definition: item_strfunc.h:461
String * val_str(String *) override
Definition: item_strfunc.cc:1478
Item_func_substr_index(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:457
String tmp_value
Definition: item_strfunc.h:454
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1468
Definition: item_strfunc.h:435
Item_func_substr(Item *a, Item *b)
Definition: item_strfunc.h:441
Item_func_substr(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:444
String tmp_value
Definition: item_strfunc.h:438
Item_func_substr(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:442
const char * func_name() const override
Definition: item_strfunc.h:450
Item_str_func super
Definition: item_strfunc.h:436
String * val_str(String *) override
Definition: item_strfunc.cc:1385
Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:445
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1428
Definition: item_strfunc.h:557
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_strfunc.h:575
Item * safe_charset_converter(THD *thd, const CHARSET_INFO *tocs) override
Definition: item_strfunc.cc:1762
virtual const Name_string fully_qualified_func_name() const =0
Item_func_sysconst(const POS &pos)
Definition: item_strfunc.h:564
Item_str_func super
Definition: item_strfunc.h:558
Item_func_sysconst()
Definition: item_strfunc.h:561
Definition: item_strfunc.h:205
Item_func_to_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:209
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:625
const char * func_name() const override
Definition: item_strfunc.h:212
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:641
String tmp_value
Definition: item_strfunc.h:206
Definition: item_strfunc.h:464
const bool m_trim_trailing
Definition: item_strfunc.h:485
bool trim_trailing() const
Definition: item_strfunc.h:517
bool trim_leading() const
Definition: item_strfunc.h:512
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1693
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:1732
TRIM_MODE
Why all the trim modes in this enum? We need to maintain parsing information, so that our print() fun...
Definition: item_strfunc.h:471
@ TRIM_BOTH_DEFAULT
Definition: item_strfunc.h:472
@ TRIM_LTRIM
Definition: item_strfunc.h:476
@ TRIM_RTRIM
Definition: item_strfunc.h:477
@ TRIM_BOTH
Definition: item_strfunc.h:473
@ TRIM_LEADING
Definition: item_strfunc.h:474
@ TRIM_TRAILING
Definition: item_strfunc.h:475
Item_func_trim(Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:500
Item_func_trim(Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:488
Item_func_trim(const POS &pos, Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:506
String tmp_value
Definition: item_strfunc.h:481
const TRIM_MODE m_trim_mode
Definition: item_strfunc.h:483
Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:494
String remove
Definition: item_strfunc.h:482
const bool m_trim_leading
Definition: item_strfunc.h:484
const char * func_name() const override
Definition: item_strfunc.h:524
String * val_str(String *) override
Definition: item_strfunc.cc:1596
Definition: item_strfunc.h:1177
const char * func_name() const override
Definition: item_strfunc.h:1188
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1182
String * val_str(String *str) override
Definition: item_strfunc.cc:3962
String buffer
Definition: item_strfunc.h:1178
Item_func_uncompress(const POS &pos, Item *a)
Definition: item_strfunc.h:1181
Definition: item_strfunc.h:1152
const char * func_name() const override
Definition: item_strfunc.h:1158
Item_func_uncompressed_length(const POS &pos, Item *a)
Definition: item_strfunc.h:1156
String value
Definition: item_strfunc.h:1153
longlong val_int() override
Definition: item_strfunc.cc:3864
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1159
Definition: item_strfunc.h:878
Item_func_unhex(const POS &pos, Item *a)
Definition: item_strfunc.h:882
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3292
String * val_str(String *) override
Convert given hex string to a binary string.
Definition: item_strfunc.cc:3304
String tmp_value
Definition: item_strfunc.h:879
const char * func_name() const override
Definition: item_strfunc.h:886
Definition: item_strfunc.h:407
Item_func_upper(const POS &pos, Item *item)
Definition: item_strfunc.h:409
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1285
const char * func_name() const override
Definition: item_strfunc.h:410
Definition: item_strfunc.h:605
Item_func_user(const POS &pos)
Definition: item_strfunc.h:618
table_map get_initial_pseudo_tables() const override
Returns the pseudo tables depended upon in order to evaluate this function expression.
Definition: item_strfunc.h:622
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:645
String * val_str(String *) override
Definition: item_strfunc.cc:1813
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:1867
Item_func_sysconst super
Definition: item_strfunc.h:606
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.h:639
Item_func_user()
Definition: item_strfunc.h:617
const char * func_name() const override
Definition: item_strfunc.h:644
bool evaluate(const char *user, const char *host)
Evaluate user name, must be called once per execution.
Definition: item_strfunc.cc:1844
type_conversion_status save_in_field_inner(Field *field, bool) override
We override Item::save_in_field_inner() for reasons explained in the comment of that function - we ne...
Definition: item_strfunc.cc:1808
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:635
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_strfunc.h:628
bool m_evaluated
True when function value is evaluated, set to false after each execution.
Definition: item_strfunc.h:610
Definition: item_strfunc.h:811
String * val_str(String *) override
Definition: item_strfunc.cc:2702
Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:818
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2694
Item_func_uuid_to_bin(const POS &pos, Item *arg1)
Definition: item_strfunc.h:816
uchar m_bin_buf[binary_log::Uuid::BYTE_LENGTH]
Buffer to store the binary result.
Definition: item_strfunc.h:813
const char * func_name() const override
Definition: item_strfunc.h:822
Definition: item_strfunc.h:1192
Item_func_uuid(const POS &pos)
Definition: item_strfunc.h:1197
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_strfunc.h:1206
table_map get_initial_pseudo_tables() const override
Returns the pseudo tables depended upon in order to evaluate this function expression.
Definition: item_strfunc.h:1200
String * val_str(String *) override
Definition: item_strfunc.cc:4169
const char * func_name() const override
Definition: item_strfunc.h:1204
Item_func_uuid()
Definition: item_strfunc.h:1196
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4049
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:4055
Item_str_func super
Definition: item_strfunc.h:1193
Definition: item_strfunc.h:1106
String * val_str(String *) override
Definition: item_strfunc.cc:3172
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_strfunc.cc:3153
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3119
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:3096
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3107
const uint num_codepoints
Definition: item_strfunc.h:1111
String tmp_value
Definition: item_strfunc.h:1109
const char * func_name() const override
Definition: item_strfunc.h:1128
Item_str_func super
Definition: item_strfunc.h:1107
Item_field * m_field_ref
Definition: item_strfunc.h:1113
const uint result_length
Definition: item_strfunc.h:1112
Item_func_weight_string(const POS &pos, Item *a, uint result_length_arg, uint num_codepoints_arg, uint flags_arg, bool as_binary_arg=false)
Definition: item_strfunc.h:1117
const bool as_binary
Definition: item_strfunc.h:1114
uint flags
Definition: item_strfunc.h:1110
Definition: item_func.h:93
Item ** args
Array of pointers to arguments.
Definition: item_func.h:100
Functype
Definition: item_func.h:178
@ COLLATE_FUNC
Definition: item_func.h:223
@ DD_INTERNAL_FUNC
Definition: item_func.h:233
@ TYPECAST_FUNC
Definition: item_func.h:225
bool param_type_is_default(THD *thd, uint start, uint end, uint step, enum_field_types def)
For arguments of this Item_func ("args" array), in range [start, start+step, start+2*step,...
Definition: item_func.cc:508
bool fix_fields(THD *, Item **ref) override
Definition: item_func.cc:386
uint arg_count
How many arguments in 'args'.
Definition: item_func.h:123
bool null_on_null
Affects how to determine that NULL argument implies a NULL function return.
Definition: item_func.h:157
Definition: item_func.h:896
Definition: item_strfunc.h:948
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:3514
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:962
String tmp_value
Definition: item_strfunc.h:951
Item_str_func super
Definition: item_strfunc.h:949
String * val_str(String *) override
Definition: item_strfunc.cc:3522
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_strfunc.h:969
Item_load_file(const POS &pos, Item *a)
Definition: item_strfunc.h:954
const char * func_name() const override
Definition: item_strfunc.h:958
table_map get_initial_pseudo_tables() const override
Returns the pseudo tables depended upon in order to evaluate this function expression.
Definition: item_strfunc.h:959
virtual const char * func_name() const =0
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item.cc:10121
Definition: item_strfunc.h:141
String * val_str_ascii(String *) override=0
String * val_str(String *str) override
Definition: item_strfunc.h:172
Item_str_ascii_func(Item *a, Item *b)
Definition: item_strfunc.h:156
Item_str_ascii_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:167
Item_str_ascii_func()
Definition: item_strfunc.h:145
Item_str_ascii_func(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:164
String ascii_buf
Definition: item_strfunc.h:142
Item_str_ascii_func(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:159
Item_str_ascii_func(const POS &pos, Item *a)
Definition: item_strfunc.h:152
Item_str_ascii_func(Item *a)
Definition: item_strfunc.h:149
Definition: item_strfunc.h:389
String * val_str(String *) override
Definition: item_strfunc.cc:1242
Item_str_conv(const POS &pos, Item *item)
Definition: item_strfunc.h:396
String tmp_value
Definition: item_strfunc.h:393
uint multiply
Definition: item_strfunc.h:391
my_charset_conv_case converter
Definition: item_strfunc.h:392
Definition: item_strfunc.h:75
Item_str_func()
Definition: item_strfunc.h:79
String * val_str_from_val_str_ascii(String *str, String *str2)
Definition: item_strfunc.cc:137
Item_str_func(Item *a, Item *b)
Definition: item_strfunc.h:87
my_decimal * val_decimal(my_decimal *) override
Definition: item_strfunc.cc:169
String * push_packet_overflow_warning(THD *thd, const char *func)
Calls push_warning_printf for packet overflow.
Definition: item_strfunc.cc:1334
Item_str_func(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:109
Item_str_func(mem_root_deque< Item * > *list)
Definition: item_strfunc.h:107
Item_str_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:93
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_strfunc.h:115
Item_func super
Definition: item_strfunc.h:76
bool get_time(MYSQL_TIME *ltime) override
Definition: item_strfunc.h:118
Item_str_func(Item *a)
Definition: item_strfunc.h:83
Item_str_func(Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:96
void left_right_max_length(THD *thd)
Definition: item_strfunc.cc:1317
enum Item_result result_type() const override
Definition: item_strfunc.h:121
Item_str_func(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:91
longlong val_int() override
Definition: item_strfunc.h:112
Item_str_func(const POS &pos, Item *a)
Definition: item_strfunc.h:85
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:124
double val_real() override
Definition: item_strfunc.h:113
Item_str_func(const POS &pos)
Definition: item_strfunc.h:81
Item_str_func(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:89
Item_str_func(Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:101
bool fix_fields(THD *thd, Item **ref) override
Definition: item_strfunc.cc:159
Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:104
Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:98
Definition: item_strfunc.h:927
Item_typecast_char(Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:934
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3467
const char * func_name() const override
Definition: item_strfunc.h:941
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_strfunc.cc:3366
String * val_str(String *a) override
Definition: item_strfunc.cc:3396
const CHARSET_INFO * cast_cs
Definition: item_strfunc.h:929
enum Functype functype() const override
Definition: item_strfunc.h:939
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3383
String tmp_value
Definition: item_strfunc.h:931
longlong cast_length
Definition: item_strfunc.h:928
bool charset_conversion
Definition: item_strfunc.h:930
const CHARSET_INFO * from_cs
Definition: item_strfunc.h:929
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:802
String str_value
str_values's main purpose is to cache the value in save_in_field
Definition: item.h:3245
void set_nullable(bool nullable)
Definition: item.h:3328
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3252
bool is_nullable() const
Definition: item.h:3327
bool get_time_from_string(MYSQL_TIME *ltime)
Convert val_str() to time in MYSQL_TIME.
Definition: item.cc:1456
static const CHARSET_INFO * default_charset()
Definition: item.cc:1568
void set_data_type_blob(uint32 max_l)
Set the Item to be of BLOB type.
Definition: item.h:1470
virtual bool fix_fields(THD *, Item **)
Definition: item.cc:4483
bool fixed
True if item has been resolved.
Definition: item.h:3316
bool null_value
True if item is null.
Definition: item.h:3353
virtual bool check_cols(uint c)
Definition: item.cc:1127
virtual String * val_str(String *str)=0
bool unsigned_flag
Definition: item.h:3354
virtual Item_field * field_for_view_update()
Definition: item.h:2910
longlong val_int_from_string()
Definition: item.cc:484
bool get_date_from_string(MYSQL_TIME *ltime, my_time_flags_t flags)
Convert val_str() to date in MYSQL_TIME.
Definition: item.cc:1369
void set_data_type_string(uint32 max_l)
Set the Item to be variable length string.
Definition: item.h:1388
bool may_evaluate_const(const THD *thd) const
Return true if this is a const item that may be evaluated in the current phase of statement processin...
Definition: item.cc:1119
uint32 max_length
Maximum length of result of evaluating this item, in number of bytes.
Definition: item.h:3270
virtual bool walk(Item_processor processor, enum_walk walk[[maybe_unused]], uchar *arg)
Traverses a tree of Items in prefix and/or postfix order.
Definition: item.h:2364
double val_real_from_string()
Definition: item.cc:430
Definition: sql_list.h:431
Definition: sql_locale.h:36
Storage for name strings.
Definition: item.h:285
Wrapper class for an Item list head, used to allocate Item lists in the parser in a context-independe...
Definition: parse_tree_helpers.h:101
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:102
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:165
void mem_free()
Definition: sql_string.h:376
void mark_as_const()
Definition: sql_string.h:245
bool copy()
Definition: sql_string.cc:191
void set(String &str, size_t offset, size_t arg_length)
Definition: sql_string.h:278
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:821
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:92
Dialog Client Authentication nullptr
Definition: dialog.cc:352
char * pos
Definition: do_ctype.cc:76
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:30
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:65
static const std::string dec("DECRYPTION")
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:165
Item *(Item::* Item_transformer)(uchar *arg)
Type for transformers used by Item::transform and Item::compile.
Definition: item.h:719
#define NAME_STRING(x)
Definition: item.h:345
CHARSET_INFO * mysqld_collation_get_by_name(const char *name, CHARSET_INFO *name_cs=system_charset_info)
Get collation by name, send error to client on failure.
Definition: item_strfunc.cc:4919
String * mysql_generate_uuid(String *str)
Generate Universal Unique Identifier (UUID).
Definition: item_strfunc.cc:4063
A better implementation of the UNIX ctype(3) library.
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1512
#define MY_CS_UNICODE
Definition: m_ctype.h:117
size_t(* my_charset_conv_case)(const CHARSET_INFO *, char *, size_t, char *, size_t)
Definition: m_ctype.h:266
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:510
#define MY_REPERTOIRE_ASCII
Definition: m_ctype.h:129
Common definition used by mysys, performance schema and server & client.
static constexpr int HOSTNAME_LENGTH
Definition: my_hostname.h:42
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
unsigned char uchar
Definition: my_inttypes.h:51
long long int longlong
Definition: my_inttypes.h:54
uint32_t uint32
Definition: my_inttypes.h:66
uint64_t table_map
Definition: my_table_map.h:29
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:82
Common definition between mysql server & client.
#define MAX_BLOB_WIDTH
Default width for blob in bytes.
Definition: mysql_com.h:902
#define USERNAME_LENGTH
Definition: mysql_com.h:68
#define USERNAME_CHAR_LENGTH
Definition: mysql_com.h:63
Time declarations shared between the server and client API: you should not add anything to this heade...
char * user
Definition: mysqladmin.cc:59
const char * host
Definition: mysqladmin.cc:58
static bool replace
Definition: mysqlimport.cc:65
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1056
Definition: commit_order_queue.h:33
const byte * find(const Pages *pages, const page_id_t &page_id) noexcept
Find a doublewrite copy of a page.
Definition: buf0dblwr.cc:2519
PT & ref(PT *tp)
Definition: tablespace_impl.cc:358
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
type_conversion_status
Status when storing a value in a field or converting from one datatype to another.
Definition: field.h:200
@ VGS_CHECK_CONSTRAINT
Definition: field.h:474
@ VGS_GENERATED_COLUMN
Definition: field.h:472
@ DERIVATION_COERCIBLE
Definition: field.h:180
@ DERIVATION_SYSCONST
Definition: field.h:181
File containing constants that can be used throughout the server.
bool(Item::* Item_processor)(uchar *arg)
Processor type for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:452
#define RAND_TABLE_BIT
Definition: sql_const.h:110
enum_walk
Enumeration for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:434
#define INNER_TABLE_BIT
Definition: sql_const.h:108
#define MAX_FIELD_NAME
Definition: sql_const.h:49
Our own string classes, used pervasively throughout the executor.
case opt name
Definition: sslopt-case.h:32
Definition: m_ctype.h:354
Struct used to pass around arguments to/from check_function_as_value_generator.
Definition: item.h:485
const char * banned_function_name
the name of the function which is not allowed
Definition: item.h:499
Value_generator_source source
Definition: item.h:497
Definition: mysql_lex_string.h:34
Definition: mysql_time.h:81
Definition: item.h:395
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:90
Bison "location" class.
Definition: parse_location.h:42
static const size_t BYTE_LENGTH
The number of bytes in the data of a Uuid.
Definition: uuid.h:136
static const size_t TEXT_LENGTH
The number of bytes in the textual representation of a Uuid.
Definition: uuid.h:154
unsigned int uint
Definition: uca-dump.cc:29
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:38
@ STRING_RESULT
not valid for UDFs
Definition: udf_registration_types.h:40