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