MySQL 8.0.37
Source Code Documentation
item_strfunc.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2024, 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
677
678 protected:
679 type_conversion_status save_in_field_inner(Field *field, bool) override;
680
681 public:
682 explicit Item_func_current_user(const POS &pos) : super(pos) {}
683
684 bool itemize(Parse_context *pc, Item **res) override;
685 const char *func_name() const override { return "current_user"; }
686 const Name_string fully_qualified_func_name() const override {
687 return NAME_STRING("current_user()");
688 }
689
690 String *val_str(String *) override;
691};
692
695
696 public:
698 Item_func_soundex(const POS &pos, Item *a) : Item_str_func(pos, a) {}
699 String *val_str(String *) override;
700 bool resolve_type(THD *thd) override;
701 const char *func_name() const override { return "soundex"; }
702};
703
704class Item_func_elt final : public Item_str_func {
705 public:
706 Item_func_elt(const POS &pos, PT_item_list *opt_list)
707 : Item_str_func(pos, opt_list) {}
708 double val_real() override;
709 longlong val_int() override;
710 String *val_str(String *str) override;
711 bool resolve_type(THD *thd) override;
712 const char *func_name() const override { return "elt"; }
713};
714
715class Item_func_make_set final : public Item_str_func {
717
720
721 public:
722 Item_func_make_set(const POS &pos, Item *a, PT_item_list *opt_list)
723 : Item_str_func(pos, opt_list), item(a) {}
724
725 bool itemize(Parse_context *pc, Item **res) override;
726 String *val_str(String *str) override;
727 bool fix_fields(THD *thd, Item **ref) override;
728 void fix_after_pullout(Query_block *parent_query_block,
729 Query_block *removed_query_block) override;
730 void split_sum_func(THD *thd, Ref_item_array ref_item_array,
731 mem_root_deque<Item *> *fields) override;
732 bool resolve_type(THD *) override;
733 void update_used_tables() override;
734 const char *func_name() const override { return "make_set"; }
735
736 bool walk(Item_processor processor, enum_walk walk, uchar *arg) override {
737 if ((walk & enum_walk::PREFIX) && (this->*processor)(arg)) return true;
738 if (item->walk(processor, walk, arg)) return true;
739 for (uint i = 0; i < arg_count; i++) {
740 if (args[i]->walk(processor, walk, arg)) return true;
741 }
742 return ((walk & enum_walk::POSTFIX) && (this->*processor)(arg));
743 }
744
745 Item *transform(Item_transformer transformer, uchar *arg) override;
746 void print(const THD *thd, String *str,
747 enum_query_type query_type) const override;
748};
749
753
754 public:
755 Item_func_format(const POS &pos, Item *org, Item *dec)
756 : Item_str_ascii_func(pos, org, dec) {}
757 Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
758 : Item_str_ascii_func(pos, org, dec, lang) {}
759
760 MY_LOCALE *get_locale(Item *item);
761 String *val_str_ascii(String *) override;
762 bool resolve_type(THD *thd) override;
763 const char *func_name() const override { return "format"; }
764 void print(const THD *thd, String *str,
765 enum_query_type query_type) const override;
766};
767
768class Item_func_char final : public Item_str_func {
769 public:
771 : Item_str_func(pos, list) {
773 }
775 : Item_str_func(pos, list) {
777 }
778 String *val_str(String *) override;
779 bool resolve_type(THD *thd) override {
780 if (param_type_is_default(thd, 0, -1, MYSQL_TYPE_LONGLONG)) return true;
782 return false;
783 }
784 const char *func_name() const override { return "char"; }
785};
786
787class Item_func_repeat final : public Item_str_func {
789
790 public:
791 Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
792 : Item_str_func(pos, arg1, arg2) {}
793 String *val_str(String *) override;
794 bool resolve_type(THD *thd) override;
795 const char *func_name() const override { return "repeat"; }
796};
797
798class Item_func_space final : public Item_str_func {
799 public:
800 Item_func_space(const POS &pos, Item *arg1) : Item_str_func(pos, arg1) {}
801 String *val_str(String *) override;
802 bool resolve_type(THD *) override;
803 const char *func_name() const override { return "space"; }
804};
805
806class Item_func_rpad final : public Item_str_func {
808
809 public:
810 Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
811 : Item_str_func(pos, arg1, arg2, arg3) {}
812 String *val_str(String *) override;
813 bool resolve_type(THD *) override;
814 const char *func_name() const override { return "rpad"; }
815};
816
817class Item_func_lpad final : public Item_str_func {
819
820 public:
821 Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
822 : Item_str_func(pos, arg1, arg2, arg3) {}
823 String *val_str(String *) override;
824 bool resolve_type(THD *) override;
825 const char *func_name() const override { return "lpad"; }
826};
827
829 /// Buffer to store the binary result
831
832 public:
833 Item_func_uuid_to_bin(const POS &pos, Item *arg1)
834 : Item_str_func(pos, arg1) {}
835 Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
836 : Item_str_func(pos, arg1, arg2) {}
837 String *val_str(String *) override;
838 bool resolve_type(THD *) override;
839 const char *func_name() const override { return "uuid_to_bin"; }
840};
841
843 /// Buffer to store the text result
845
846 public:
847 Item_func_bin_to_uuid(const POS &pos, Item *arg1)
848 : Item_str_ascii_func(pos, arg1) {}
849 Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
850 : Item_str_ascii_func(pos, arg1, arg2) {}
851 String *val_str_ascii(String *) override;
852 bool resolve_type(THD *thd) override;
853 const char *func_name() const override { return "bin_to_uuid"; }
854};
855
856class Item_func_is_uuid final : public Item_bool_func {
858
859 public:
860 Item_func_is_uuid(const POS &pos, Item *a) : Item_bool_func(pos, a) {}
861 longlong val_int() override;
862 const char *func_name() const override { return "is_uuid"; }
863 bool resolve_type(THD *thd) override {
864 bool res = super::resolve_type(thd);
865 set_nullable(true);
866 return res;
867 }
868};
869
870class Item_func_conv final : public Item_str_func {
871 public:
872 // 64 digits plus possible '-'.
873 static constexpr uint32_t CONV_MAX_LENGTH = 64U + 1U;
874 Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
875 : Item_str_func(pos, a, b, c) {}
876 const char *func_name() const override { return "conv"; }
877 String *val_str(String *) override;
878 bool resolve_type(THD *) override;
879};
880
883
884 public:
885 Item_func_hex(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
886 const char *func_name() const override { return "hex"; }
887 String *val_str_ascii(String *) override;
888 bool resolve_type(THD *thd) override;
889};
890
891class Item_func_unhex final : public Item_str_func {
893
894 public:
895 Item_func_unhex(const POS &pos, Item *a) : Item_str_func(pos, a) {
896 /* there can be bad hex strings */
897 set_nullable(true);
898 }
899 const char *func_name() const override { return "unhex"; }
900 String *val_str(String *) override;
901 bool resolve_type(THD *thd) override;
902};
903
904#ifndef NDEBUG
906 protected:
909 const bool is_min;
910
911 public:
912 Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
913 : Item_str_func(pos, a, b), is_min(is_min_arg) {
914 set_nullable(true);
915 }
916 String *val_str(String *) override;
917 bool resolve_type(THD *thd) override {
918 if (param_type_is_default(thd, 0, 1)) return true;
919 if (param_type_is_default(thd, 1, 2, MYSQL_TYPE_LONGLONG)) return true;
921 return false;
922 }
923};
924
926 public:
928 : Item_func_like_range(pos, a, b, true) {}
929 const char *func_name() const override { return "like_range_min"; }
930};
931
933 public:
935 : Item_func_like_range(pos, a, b, false) {}
936 const char *func_name() const override { return "like_range_max"; }
937};
938#endif
939
940/**
941 The following types of conversions are considered safe:
942
943 Conversion to and from "binary".
944 Conversion to Unicode.
945 Other kind of conversions are potentially lossy.
946*/
948 protected:
949 /// If true, conversion is needed so do it, else allow string copy.
951 /// The character set we are converting to
953 /// The character set we are converting from
954 const CHARSET_INFO *m_from_cs{nullptr};
956 /// Marks whether the underlying Item is constant and may be cached.
958 /// Length argument value, if any given.
959 longlong m_cast_length{-1}; // a priori not used
960 public:
961 bool m_safe;
962
963 protected:
964 /**
965 Helper for CAST and CONVERT type resolution: common logic to compute the
966 maximum numbers of characters of the type of the conversion.
967
968 @returns the maximum numbers of characters possible after the conversion
969 */
971
972 bool resolve_type(THD *thd) override;
973
974 public:
976 bool cache_if_const)
977 : Item_str_func(a), m_cast_cs(cs_arg) {
978 if (cache_if_const && args[0]->may_evaluate_const(thd)) {
979 uint errors = 0;
980 String tmp, *str = args[0]->val_str(&tmp);
981 if (!str || str_value.copy(str->ptr(), str->length(), str->charset(),
982 m_cast_cs, &errors))
983 null_value = true;
984 m_use_cached_value = true;
986 m_safe = (errors == 0);
987 } else {
988 m_use_cached_value = false;
989 // Marks whether the conversion is safe
991 cs_arg == &my_charset_bin || (cs_arg->state & MY_CS_UNICODE));
992 }
993 }
994 Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
995 : Item_str_func(pos, a), m_cast_cs(cs_arg) {}
996
997 String *val_str(String *) override;
998};
999
1001 public:
1002 Item_typecast_char(THD *thd, Item *a, longlong length_arg,
1003 const CHARSET_INFO *cs_arg)
1004 : Item_charset_conversion(thd, a, cs_arg, false) {
1005 m_cast_length = length_arg;
1006 }
1007 Item_typecast_char(const POS &pos, Item *a, longlong length_arg,
1008 const CHARSET_INFO *cs_arg)
1009 : Item_charset_conversion(pos, a, cs_arg) {
1010 m_cast_length = length_arg;
1011 }
1012 enum Functype functype() const override { return TYPECAST_FUNC; }
1013 bool eq(const Item *item, bool binary_cmp) const override;
1014 const char *func_name() const override { return "cast_as_char"; }
1015 void print(const THD *thd, String *str,
1016 enum_query_type query_type) const override;
1017};
1018
1019class Item_load_file final : public Item_str_func {
1021
1023
1024 public:
1025 Item_load_file(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1026
1027 bool itemize(Parse_context *pc, Item **res) override;
1028 String *val_str(String *) override;
1029 const char *func_name() const override { return "load_file"; }
1031 return INNER_TABLE_BIT;
1032 }
1033 bool resolve_type(THD *thd) override {
1034 if (param_type_is_default(thd, 0, 1)) return true;
1037 set_nullable(true);
1038 return false;
1039 }
1040 bool check_function_as_value_generator(uchar *checker_args) override {
1042 pointer_cast<Check_function_as_value_generator_parameters *>(
1043 checker_args);
1044 func_arg->banned_function_name = func_name();
1045 return true;
1046 }
1047};
1048
1050 public:
1051 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
1052 : Item_str_func(pos, a, b, c) {}
1053 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
1054 : Item_str_func(pos, a, b, c, d) {}
1055 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d,
1056 Item *e)
1057 : Item_str_func(pos, a, b, c, d, e) {}
1058 String *val_str(String *str) override;
1059 bool resolve_type(THD *) override;
1060 const char *func_name() const override { return "export_set"; }
1061};
1062
1065
1066 public:
1067 Item_func_quote(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1068 const char *func_name() const override { return "quote"; }
1069 String *val_str(String *) override;
1070 bool resolve_type(THD *thd) override;
1071};
1072
1074 public:
1076 : Item_charset_conversion(pos, a, cs) {
1077 m_safe = false;
1078 }
1079
1081 bool cache_if_const)
1082 : Item_charset_conversion(thd, a, cs, cache_if_const) {
1083 assert(args[0]->fixed);
1084 }
1085 const char *func_name() const override { return "convert"; }
1086 void print(const THD *thd, String *str,
1087 enum_query_type query_type) const override;
1088};
1089
1092
1094
1095 public:
1097 const LEX_STRING &collation_string_arg)
1098 : super(pos, a, nullptr), collation_string(collation_string_arg) {}
1099
1100 bool itemize(Parse_context *pc, Item **res) override;
1101 String *val_str(String *) override;
1102 bool resolve_type(THD *) override;
1103 bool eq(const Item *item, bool binary_cmp) const override;
1104 const char *func_name() const override { return "collate"; }
1105 enum Functype functype() const override { return COLLATE_FUNC; }
1106 void print(const THD *thd, String *str,
1107 enum_query_type query_type) const override;
1109 /* this function is transparent for view updating */
1110 return args[0]->field_for_view_update();
1111 }
1112};
1113
1114class Item_func_charset final : public Item_str_func {
1115 public:
1116 Item_func_charset(const POS &pos, Item *a) : Item_str_func(pos, a) {
1117 null_on_null = false;
1118 }
1119 String *val_str(String *) override;
1120 const char *func_name() const override { return "charset"; }
1121 bool resolve_type(THD *thd) override {
1123 set_nullable(false);
1124 return Item_str_func::resolve_type(thd);
1125 }
1126};
1127
1129 public:
1130 Item_func_collation(const POS &pos, Item *a) : Item_str_func(pos, a) {
1131 null_on_null = false;
1132 }
1133 String *val_str(String *) override;
1134 const char *func_name() const override { return "collation"; }
1135 bool resolve_type(THD *thd) override {
1136 if (Item_str_func::resolve_type(thd)) return true;
1138 set_nullable(false);
1139 return false;
1140 }
1141};
1142
1145
1151 const bool as_binary;
1152
1153 public:
1154 Item_func_weight_string(const POS &pos, Item *a, uint result_length_arg,
1155 uint num_codepoints_arg, uint flags_arg,
1156 bool as_binary_arg = false)
1157 : Item_str_func(pos, a),
1158 flags(flags_arg),
1159 num_codepoints(num_codepoints_arg),
1160 result_length(result_length_arg),
1161 as_binary(as_binary_arg) {}
1162
1163 bool itemize(Parse_context *pc, Item **res) override;
1164
1165 const char *func_name() const override { return "weight_string"; }
1166 bool eq(const Item *item, bool binary_cmp) const override;
1167 String *val_str(String *) override;
1168 bool resolve_type(THD *) override;
1169 void print(const THD *thd, String *str,
1170 enum_query_type query_type) const override;
1171};
1172
1173class Item_func_crc32 final : public Item_int_func {
1175
1176 public:
1177 Item_func_crc32(const POS &pos, Item *a) : Item_int_func(pos, a) {
1178 unsigned_flag = true;
1179 }
1180 const char *func_name() const override { return "crc32"; }
1181 bool resolve_type(THD *thd) override {
1182 if (param_type_is_default(thd, 0, 1)) return true;
1183 max_length = 10;
1184 return false;
1185 }
1186 longlong val_int() override;
1187};
1188
1191
1192 public:
1194 : Item_int_func(pos, a) {}
1195 const char *func_name() const override { return "uncompressed_length"; }
1196 bool resolve_type(THD *thd) override {
1197 if (param_type_is_default(thd, 0, 1)) return true;
1198 max_length = 10;
1199 return false;
1200 }
1201 longlong val_int() override;
1202};
1203
1204class Item_func_compress final : public Item_str_func {
1206
1207 public:
1208 Item_func_compress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1209 bool resolve_type(THD *thd) override;
1210 const char *func_name() const override { return "compress"; }
1211 String *val_str(String *str) override;
1212};
1213
1216
1217 public:
1218 Item_func_uncompress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1219 bool resolve_type(THD *thd) override {
1220 if (Item_str_func::resolve_type(thd)) return true;
1221 set_nullable(true);
1223 return false;
1224 }
1225 const char *func_name() const override { return "uncompress"; }
1226 String *val_str(String *str) override;
1227};
1228
1229class Item_func_uuid final : public Item_str_func {
1231
1232 public:
1234 explicit Item_func_uuid(const POS &pos) : Item_str_func(pos) {}
1235
1236 bool itemize(Parse_context *pc, Item **res) override;
1238 return RAND_TABLE_BIT;
1239 }
1240 bool resolve_type(THD *) override;
1241 const char *func_name() const override { return "uuid"; }
1242 String *val_str(String *) override;
1243 bool check_function_as_value_generator(uchar *checker_args) override {
1245 pointer_cast<Check_function_as_value_generator_parameters *>(
1246 checker_args);
1247 func_arg->banned_function_name = func_name();
1248 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
1249 (func_arg->source == VGS_CHECK_CONSTRAINT));
1250 }
1251};
1252
1255
1256 public:
1258 explicit Item_func_current_role(const POS &pos)
1259 : super(pos), value_cache_set(false) {}
1260 const char *func_name() const override { return "current_role"; }
1261 void cleanup() override;
1262 String *val_str(String *) override;
1263 bool resolve_type(THD *) override {
1265 return false;
1266 }
1268 return NAME_STRING("current_role()");
1269 }
1270
1271 protected:
1272 void set_current_role(THD *thd);
1273 /** a flag whether @ref value_cache is set or not */
1275 /**
1276 @brief Cache for the result value
1277
1278 Set by init(). And consumed by val_str().
1279 Needed to avoid re-calculation of the current_roles() in the
1280 course of the query.
1281 */
1283};
1284
1287
1288 public:
1290 explicit Item_func_roles_graphml(const POS &pos)
1291 : super(pos), value_cache_set(false) {}
1292 String *val_str(String *) override;
1293 void cleanup() override;
1294
1295 bool resolve_type(THD *) override {
1297 return false;
1298 }
1299
1300 const char *func_name() const override { return "roles_graphml"; }
1301
1303 return NAME_STRING("roles_graphml()");
1304 }
1305
1306 protected:
1307 bool calculate_graphml(THD *thd);
1308 /**
1309 @brief Cache for the result value
1310
1311 Set by init(). And consumed by val_str().
1312 Needed to avoid re-calculation of the current_roles() in the
1313 course of the query.
1314 */
1316
1317 /** Set to true if @ref value_cache is set */
1319};
1320
1322 public:
1324 : Item_str_func(pos, a, b, c) {}
1325
1326 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1327 bool resolve_type(THD *) override {
1328 /*
1329 There are 14 kinds of grants, with a max length
1330 per privileges is 11 chars.
1331 So, setting max approximate to 200.
1332 */
1334 set_nullable(true);
1335 null_on_null = false;
1336
1337 return false;
1338 }
1339
1340 const char *func_name() const override { return "get_dd_column_privileges"; }
1341
1342 String *val_str(String *) override;
1343};
1344
1346 public:
1348 : Item_str_func(pos, a, b, c) {}
1349
1350 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1351 bool resolve_type(THD *) override {
1352 // maximum string length of all options is expected
1353 // to be less than 256 characters.
1355 set_nullable(false);
1356 null_on_null = false;
1357
1358 return false;
1359 }
1360
1361 const char *func_name() const override { return "get_dd_create_options"; }
1362
1363 String *val_str(String *) override;
1364};
1365
1367 public:
1369 : Item_str_func(pos, a) {}
1370
1371 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1372 bool resolve_type(THD *) override {
1373 // maximum string length of all options is expected
1374 // to be less than 256 characters.
1376 set_nullable(false);
1377 null_on_null = false;
1378
1379 return false;
1380 }
1381
1382 const char *func_name() const override { return "get_dd_schema_options"; }
1383
1384 String *val_str(String *) override;
1385};
1386
1388 public:
1390 : Item_str_func(pos, list) {}
1391
1392 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1393 bool resolve_type(THD *) override {
1394 /*
1395 maximum expected string length to be less than 2048 characters,
1396 which is same as size of column holding comments in dictionary,
1397 i.e., the mysql.tables.comment DD column.
1398 */
1400 set_nullable(true);
1401 null_on_null = false;
1402
1403 return false;
1404 }
1405
1406 const char *func_name() const override {
1407 return "internal_get_comment_or_error";
1408 }
1409
1410 String *val_str(String *) override;
1411};
1412
1414 public:
1416 : Item_str_func(pos, a, b) {}
1417
1418 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1419 bool resolve_type(THD *) override {
1420 /* maximum string length of the property value is expected
1421 to be less than 256 characters. */
1423 set_nullable(false);
1424 null_on_null = false;
1425
1426 return false;
1427 }
1428
1429 const char *func_name() const override {
1430 return "get_dd_tablespace_private_data";
1431 }
1432
1433 String *val_str(String *) override;
1434};
1435
1437 public:
1439 : Item_str_func(pos, a, b) {}
1440
1441 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1442 bool resolve_type(THD *) override {
1443 /* maximum string length of the property value is expected
1444 to be less than 256 characters. */
1446 set_nullable(false);
1447 null_on_null = false;
1448
1449 return false;
1450 }
1451
1452 const char *func_name() const override { return "get_dd_index_private_data"; }
1453
1454 String *val_str(String *) override;
1455};
1456
1458 public:
1460 : Item_str_func(pos, a) {}
1461
1462 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1463 bool resolve_type(THD *) override {
1464 // maximum string length of all options is expected
1465 // to be less than 256 characters.
1467 set_nullable(true);
1468 null_on_null = false;
1469
1470 return false;
1471 }
1472
1473 const char *func_name() const override {
1474 return "internal_get_partition_nodegroup";
1475 }
1476
1477 String *val_str(String *) override;
1478};
1479
1481 public:
1483 Item *d)
1484 : Item_str_func(pos, a, b, c, d) {}
1485
1486 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1487 bool resolve_type(THD *) override {
1488 // maximum string length of all options is expected
1489 // to be less than 256 characters.
1491 set_nullable(true);
1492 null_on_null = false;
1493
1494 return false;
1495 }
1496
1497 const char *func_name() const override { return "internal_tablespace_type"; }
1498
1499 String *val_str(String *) override;
1500};
1501
1503 public:
1505 Item *b, Item *c, Item *d)
1506 : Item_str_func(pos, a, b, c, d) {}
1507
1508 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1509 bool resolve_type(THD *) override {
1510 // maximum string length of all options is expected
1511 // to be less than 256 characters.
1513 set_nullable(true);
1514 null_on_null = false;
1515
1516 return false;
1517 }
1518
1519 const char *func_name() const override {
1520 return "internal_tablespace_logfile_group_name";
1521 }
1522
1523 String *val_str(String *) override;
1524};
1525
1527 public:
1529 Item *c, Item *d)
1530 : Item_str_func(pos, a, b, c, d) {}
1531
1532 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1533 bool resolve_type(THD *) override {
1534 // maximum string length of all options is expected
1535 // to be less than 256 characters.
1537 set_nullable(true);
1538 null_on_null = false;
1539
1540 return false;
1541 }
1542
1543 const char *func_name() const override {
1544 return "internal_tablespace_status";
1545 }
1546 String *val_str(String *) override;
1547};
1548
1550 public:
1552 Item *c, Item *d)
1553 : Item_str_func(pos, a, b, c, d) {}
1554
1555 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1556 bool resolve_type(THD *) override {
1557 // maximum string length of all options is expected
1558 // to be less than 256 characters.
1560 set_nullable(true);
1561 null_on_null = false;
1562
1563 return false;
1564 }
1565
1566 const char *func_name() const override {
1567 return "internal_tablespace_row_format";
1568 }
1569
1570 String *val_str(String *) override;
1571};
1572
1574 public:
1576 Item *d)
1577 : Item_str_func(pos, a, b, c, d) {}
1578
1579 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1580 bool resolve_type(THD *) override {
1581 // maximum string length of all options is expected
1582 // to be less than 256 characters.
1584 set_nullable(true);
1585 null_on_null = false;
1586
1587 return false;
1588 }
1589
1590 const char *func_name() const override { return "internal_tablespace_extra"; }
1591
1592 String *val_str(String *) override;
1593};
1594
1596 public:
1598 : Item_str_func(pos, list) {}
1599
1600 bool resolve_type(THD *) override {
1601 set_nullable(false);
1603 return false;
1604 }
1605
1606 const char *func_name() const override { return "convert_cpu_id_mask"; }
1607
1608 String *val_str(String *) override;
1609};
1610
1612 public:
1614 : Item_str_func(pos, a, b) {}
1615
1616 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1617 bool resolve_type(THD *) override {
1619 set_nullable(true);
1620 null_on_null = false;
1621
1622 return false;
1623 }
1624
1625 const char *func_name() const override { return "get_dd_property_key_value"; }
1626
1627 String *val_str(String *) override;
1628};
1629
1631 public:
1633 : Item_str_func(pos, a, b) {}
1634
1635 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1636 bool resolve_type(THD *) override {
1638 set_nullable(true);
1639 null_on_null = false;
1640
1641 return false;
1642 }
1643
1644 const char *func_name() const override { return "remove_dd_property_key"; }
1645
1646 String *val_str(String *) override;
1647};
1648
1650 public:
1652 : Item_str_func(pos, a, b) {}
1653
1654 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1655 bool resolve_type(THD *) override {
1656 // maximum string length of all options is expected
1657 // to be less than 256 characters.
1659 set_nullable(true);
1660 null_on_null = false;
1661
1662 return false;
1663 }
1664
1665 const char *func_name() const override {
1666 return "convert_interval_to_user_interval";
1667 }
1668
1669 String *val_str(String *) override;
1670};
1671
1673 public:
1675 : Item_str_func(pos, list) {}
1676
1677 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1678 bool resolve_type(THD *) override {
1680 set_nullable(true);
1681 null_on_null = false;
1682
1683 return false;
1684 }
1685
1686 const char *func_name() const override { return "internal_get_username"; }
1687
1688 String *val_str(String *) override;
1689};
1690
1692 public:
1694 : Item_str_func(pos, list) {}
1695
1696 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1697 bool resolve_type(THD *) override {
1699 set_nullable(true);
1700 null_on_null = false;
1701
1702 return false;
1703 }
1704
1705 const char *func_name() const override { return "internal_get_hostname"; }
1706
1707 String *val_str(String *) override;
1708};
1709
1711 public:
1713 : Item_str_func(pos) {}
1714
1715 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1716 bool resolve_type(THD *) override {
1718 set_nullable(true);
1719 null_on_null = false;
1720
1721 return false;
1722 }
1723
1724 const char *func_name() const override {
1725 return "internal_get_enabled_role_json";
1726 }
1727
1728 String *val_str(String *) override;
1729};
1730
1732 public:
1734 : Item_str_func(pos) {}
1735
1736 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1737 bool resolve_type(THD *) override {
1739 set_nullable(true);
1740 null_on_null = false;
1741
1742 return false;
1743 }
1744
1745 const char *func_name() const override {
1746 return "internal_get_mandatory_roles_json";
1747 }
1748
1749 String *val_str(String *) override;
1750};
1751
1753 public:
1755 : Item_str_func(pos, list) {}
1756
1757 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1758 bool resolve_type(THD *) override {
1759 // maximum string length of all options is expected
1760 // to be less than 256 characters.
1762 set_nullable(false);
1763 null_on_null = false;
1764
1765 return false;
1766 }
1767
1768 const char *func_name() const override {
1769 return "internal_get_dd_column_extra";
1770 }
1771
1772 String *val_str(String *) override;
1773};
1774
1775#endif /* ITEM_STRFUNC_INCLUDED */
void set(const DTCollation &dt)
Definition: item.h:194
void set_repertoire(uint repertoire_arg)
Definition: item.h:220
const CHARSET_INFO * collation
Definition: item.h:176
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:947
const CHARSET_INFO * m_cast_cs
The character set we are converting to.
Definition: item_strfunc.h:952
bool m_safe
Definition: item_strfunc.h:961
bool m_charset_conversion
If true, conversion is needed so do it, else allow string copy.
Definition: item_strfunc.h:950
const CHARSET_INFO * m_from_cs
The character set we are converting from.
Definition: item_strfunc.h:954
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3613
Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:994
bool m_use_cached_value
Marks whether the underlying Item is constant and may be cached.
Definition: item_strfunc.h:957
String * val_str(String *) override
Definition: item_strfunc.cc:3504
longlong m_cast_length
Length argument value, if any given.
Definition: item_strfunc.h:959
String m_tmp_value
Definition: item_strfunc.h:955
Item_charset_conversion(THD *thd, Item *a, const CHARSET_INFO *cs_arg, bool cache_if_const)
Definition: item_strfunc.h:975
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:3582
Definition: item.h:4170
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:842
char m_text_buf[binary_log::Uuid::TEXT_LENGTH+1]
Buffer to store the text result.
Definition: item_strfunc.h:844
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2859
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2868
Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:849
Item_func_bin_to_uuid(const POS &pos, Item *arg1)
Definition: item_strfunc.h:847
const char * func_name() const override
Definition: item_strfunc.h:853
Definition: item_strfunc.h:768
Item_func_char(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:770
Item_func_char(const POS &pos, PT_item_list *list, const CHARSET_INFO *cs)
Definition: item_strfunc.h:774
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:779
String * val_str(String *) override
Definition: item_strfunc.cc:2499
const char * func_name() const override
Definition: item_strfunc.h:784
Definition: item_strfunc.h:1114
Item_func_charset(const POS &pos, Item *a)
Definition: item_strfunc.h:1116
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1121
String * val_str(String *) override
Definition: item_strfunc.cc:3167
const char * func_name() const override
Definition: item_strfunc.h:1120
Definition: item_strfunc.h:1128
String * val_str(String *) override
Definition: item_strfunc.cc:3181
const char * func_name() const override
Definition: item_strfunc.h:1134
Item_func_collation(const POS &pos, Item *a)
Definition: item_strfunc.h:1130
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1135
Definition: item_strfunc.h:1204
String buffer
Definition: item_strfunc.h:1205
Item_func_compress(const POS &pos, Item *a)
Definition: item_strfunc.h:1208
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4069
String * val_str(String *str) override
Definition: item_strfunc.cc:4077
const char * func_name() const override
Definition: item_strfunc.h:1210
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:1073
Item_func_conv_charset(const POS &pos, Item *a, const CHARSET_INFO *cs)
Definition: item_strfunc.h:1075
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3074
const char * func_name() const override
Definition: item_strfunc.h:1085
Item_func_conv_charset(THD *thd, Item *a, const CHARSET_INFO *cs, bool cache_if_const)
Definition: item_strfunc.h:1080
Definition: item_strfunc.h:870
String * val_str(String *) override
Definition: item_strfunc.cc:3003
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2996
static constexpr uint32_t CONV_MAX_LENGTH
Definition: item_strfunc.h:873
Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:874
const char * func_name() const override
Definition: item_strfunc.h:876
Definition: item_strfunc.h:1595
const char * func_name() const override
Definition: item_strfunc.h:1606
Item_func_convert_cpu_id_mask(const POS &pos, Item *list)
Definition: item_strfunc.h:1597
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1600
String * val_str(String *) override
Definition: item_strfunc.cc:5057
Definition: item_strfunc.h:1649
const char * func_name() const override
Definition: item_strfunc.h:1665
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1655
enum Functype functype() const override
Definition: item_strfunc.h:1654
String * val_str(String *) override
Definition: item_strfunc.cc:5271
Item_func_convert_interval_to_user_interval(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1651
Definition: item_strfunc.h:1173
const char * func_name() const override
Definition: item_strfunc.h:1180
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1181
Item_func_crc32(const POS &pos, Item *a)
Definition: item_strfunc.h:1177
longlong val_int() override
Definition: item_strfunc.cc:4057
String value
Definition: item_strfunc.h:1174
Definition: item_strfunc.h:1253
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1267
void set_current_role(THD *thd)
Definition: item_strfunc.cc:5113
Item_func_current_role()
Definition: item_strfunc.h:1257
const char * func_name() const override
Definition: item_strfunc.h:1260
bool value_cache_set
a flag whether value_cache is set or not
Definition: item_strfunc.h:1274
Item_func_sysconst super
Definition: item_strfunc.h:1254
Item_func_current_role(const POS &pos)
Definition: item_strfunc.h:1258
String * val_str(String *) override
Definition: item_strfunc.cc:5108
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1263
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1282
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5100
Definition: item_strfunc.h:673
Item_func_user super
Definition: item_strfunc.h:674
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:2017
Item_func_current_user(const POS &pos)
Definition: item_strfunc.h:682
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:686
const char * func_name() const override
Definition: item_strfunc.h:685
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
String * val_str(String *) override
Definition: item_strfunc.cc:1968
Name_resolution_context * context
Definition: item_strfunc.h:676
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:704
const char * func_name() const override
Definition: item_strfunc.h:712
longlong val_int() override
Definition: item_strfunc.cc:2343
String * val_str(String *str) override
Definition: item_strfunc.cc:2356
double val_real() override
Definition: item_strfunc.cc:2331
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2313
Item_func_elt(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:706
Definition: item_strfunc.h:1049
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1051
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:1055
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1053
String * val_str(String *str) override
Definition: item_strfunc.cc:3734
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3803
const char * func_name() const override
Definition: item_strfunc.h:1060
Definition: item_strfunc.h:750
const char * func_name() const override
Definition: item_strfunc.h:763
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2300
String tmp_str
Definition: item_strfunc.h:751
MY_LOCALE * get_locale(Item *item)
Definition: item_strfunc.cc:2171
MY_LOCALE * locale
Definition: item_strfunc.h:752
Item_func_format(const POS &pos, Item *org, Item *dec)
Definition: item_strfunc.h:755
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2209
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2186
Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
Definition: item_strfunc.h:757
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:1321
Item_func_get_dd_column_privileges(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1323
const char * func_name() const override
Definition: item_strfunc.h:1340
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1327
enum Functype functype() const override
Definition: item_strfunc.h:1326
String * val_str(String *) override
This function prepares string with list of column privileges.
Definition: item_strfunc.cc:4353
Definition: item_strfunc.h:1345
enum Functype functype() const override
Definition: item_strfunc.h:1350
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1351
String * val_str(String *) override
This function prepares string representing create_options for table.
Definition: item_strfunc.cc:4425
Item_func_get_dd_create_options(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1347
const char * func_name() const override
Definition: item_strfunc.h:1361
Definition: item_strfunc.h:1436
const char * func_name() const override
Definition: item_strfunc.h:1452
Item_func_get_dd_index_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1438
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1442
String * val_str(String *) override
This function prepares string representing se_private_data for index.
Definition: item_strfunc.cc:4970
enum Functype functype() const override
Definition: item_strfunc.h:1441
Definition: item_strfunc.h:1611
String * val_str(String *) override
This function prepares string representing value stored at key supplied.
Definition: item_strfunc.cc:5168
enum Functype functype() const override
Definition: item_strfunc.h:1616
Item_func_get_dd_property_key_value(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1613
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1617
const char * func_name() const override
Definition: item_strfunc.h:1625
Definition: item_strfunc.h:1366
String * val_str(String *) override
This function prepares string representing options for a schema.
Definition: item_strfunc.cc:4626
const char * func_name() const override
Definition: item_strfunc.h:1382
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1372
enum Functype functype() const override
Definition: item_strfunc.h:1371
Item_func_get_dd_schema_options(const POS &pos, Item *a)
Definition: item_strfunc.h:1368
Definition: item_strfunc.h:1413
String * val_str(String *) override
This function prepares string representing se_private_data for tablespace.
Definition: item_strfunc.cc:4904
const char * func_name() const override
Definition: item_strfunc.h:1429
enum Functype functype() const override
Definition: item_strfunc.h:1418
Item_func_get_dd_tablespace_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1415
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1419
Definition: item_strfunc.h:1457
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1463
String * val_str(String *) override
Definition: item_strfunc.cc:4751
enum Functype functype() const override
Definition: item_strfunc.h:1462
Item_func_get_partition_nodegroup(const POS &pos, Item *a)
Definition: item_strfunc.h:1459
const char * func_name() const override
Definition: item_strfunc.h:1473
Definition: item_strfunc.h:881
String tmp_value
Definition: item_strfunc.h:882
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3358
Item_func_hex(const POS &pos, Item *a)
Definition: item_strfunc.h:885
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:3370
const char * func_name() const override
Definition: item_strfunc.h:886
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:1387
Item_func_internal_get_comment_or_error(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1389
const char * func_name() const override
Definition: item_strfunc.h:1406
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1393
String * val_str(String *) override
Definition: item_strfunc.cc:4674
enum Functype functype() const override
Definition: item_strfunc.h:1392
Definition: item_strfunc.h:1752
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1758
String * val_str(String *) override
This function prepares string representing EXTRA column for I_S.COLUMNS.
Definition: item_strfunc.cc:5447
const char * func_name() const override
Definition: item_strfunc.h:1768
Item_func_internal_get_dd_column_extra(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1754
enum Functype functype() const override
Definition: item_strfunc.h:1757
Definition: item_strfunc.h:1710
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1716
enum Functype functype() const override
Definition: item_strfunc.h:1715
Item_func_internal_get_enabled_role_json(const POS &pos)
Definition: item_strfunc.h:1712
String * val_str(String *) override
Definition: item_strfunc.cc:5366
const char * func_name() const override
Definition: item_strfunc.h:1724
Definition: item_strfunc.h:1691
Item_func_internal_get_hostname(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1693
enum Functype functype() const override
Definition: item_strfunc.h:1696
const char * func_name() const override
Definition: item_strfunc.h:1705
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1697
String * val_str(String *) override
Definition: item_strfunc.cc:5331
Definition: item_strfunc.h:1731
const char * func_name() const override
Definition: item_strfunc.h:1745
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1737
enum Functype functype() const override
Definition: item_strfunc.h:1736
Item_func_internal_get_mandatory_roles_json(const POS &pos)
Definition: item_strfunc.h:1733
String * val_str(String *) override
Definition: item_strfunc.cc:5398
Definition: item_strfunc.h:1672
String * val_str(String *) override
Definition: item_strfunc.cc:5294
Item_func_internal_get_username(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1674
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1678
enum Functype functype() const override
Definition: item_strfunc.h:1677
const char * func_name() const override
Definition: item_strfunc.h:1686
Definition: item_strfunc.h:1573
String * val_str(String *) override
Definition: item_strfunc.cc:4870
const char * func_name() const override
Definition: item_strfunc.h:1590
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1580
enum Functype functype() const override
Definition: item_strfunc.h:1579
Item_func_internal_tablespace_extra(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1575
const char * func_name() const override
Definition: item_strfunc.h:1519
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1509
String * val_str(String *) override
Definition: item_strfunc.cc:4808
Item_func_internal_tablespace_logfile_group_name(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1504
enum Functype functype() const override
Definition: item_strfunc.h:1508
Definition: item_strfunc.h:1549
const char * func_name() const override
Definition: item_strfunc.h:1566
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1556
Item_func_internal_tablespace_row_format(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1551
String * val_str(String *) override
Definition: item_strfunc.cc:4848
enum Functype functype() const override
Definition: item_strfunc.h:1555
Definition: item_strfunc.h:1526
Item_func_internal_tablespace_status(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1528
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1533
String * val_str(String *) override
Definition: item_strfunc.cc:4831
enum Functype functype() const override
Definition: item_strfunc.h:1532
const char * func_name() const override
Definition: item_strfunc.h:1543
Definition: item_strfunc.h:1480
enum Functype functype() const override
Definition: item_strfunc.h:1486
String * val_str(String *) override
Definition: item_strfunc.cc:4791
const char * func_name() const override
Definition: item_strfunc.h:1497
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1487
Item_func_internal_tablespace_type(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1482
Definition: item_strfunc.h:856
const char * func_name() const override
Definition: item_strfunc.h:862
longlong val_int() override
Definition: item_strfunc.cc:2910
Item_func_is_uuid(const POS &pos, Item *a)
Definition: item_strfunc.h:860
Item_bool_func super
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.h:863
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:932
const char * func_name() const override
Definition: item_strfunc.h:936
Item_func_like_range_max(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:934
Definition: item_strfunc.h:925
const char * func_name() const override
Definition: item_strfunc.h:929
Item_func_like_range_min(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:927
Definition: item_strfunc.h:905
String max_str
Definition: item_strfunc.h:908
const bool is_min
Definition: item_strfunc.h:909
Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
Definition: item_strfunc.h:912
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:917
String min_str
Definition: item_strfunc.h:907
String * val_str(String *) override
Definition: item_strfunc.cc:3444
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:817
String * val_str(String *) override
Definition: item_strfunc.cc:2923
Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:821
String tmp_value
Definition: item_strfunc.h:818
String lpad_str
Definition: item_strfunc.h:818
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2790
const char * func_name() const override
Definition: item_strfunc.h:825
Definition: item_strfunc.h:565
Item_func_ltrim(const POS &pos, Item *a)
Definition: item_strfunc.h:567
Definition: item_strfunc.h:715
Item_func_make_set(const POS &pos, Item *a, PT_item_list *opt_list)
Definition: item_strfunc.h:722
String * val_str(String *str) override
Definition: item_strfunc.cc:2444
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:736
Item_str_func super
Definition: item_strfunc.h:716
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2488
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2421
String tmp_str
Definition: item_strfunc.h:719
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:2386
bool fix_fields(THD *thd, Item **ref) override
Definition: item_strfunc.cc:2392
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:2376
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:2413
const char * func_name() const override
Definition: item_strfunc.h:734
void update_used_tables() override
Updates used tables, not null tables information and accumulates properties up the item tree,...
Definition: item_strfunc.cc:2436
Item * item
Definition: item_strfunc.h:718
Item * transform(Item_transformer transformer, uchar *arg) override
Transform an Item_func object with a transformer callback function.
Definition: item_strfunc.cc:2481
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:1063
String * val_str(String *) override
QUOTE() function returns argument string in single quotes suitable for using in a SQL statement.
Definition: item_strfunc.cc:3862
Item_func_quote(const POS &pos, Item *a)
Definition: item_strfunc.h:1067
String tmp_value
Definition: item_strfunc.h:1064
const char * func_name() const override
Definition: item_strfunc.h:1068
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3822
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:1630
Item_func_remove_dd_property_key(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1632
const char * func_name() const override
Definition: item_strfunc.h:1644
String * val_str(String *) override
This function removes a key value from given property string.
Definition: item_strfunc.cc:5225
enum Functype functype() const override
Definition: item_strfunc.h:1635
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1636
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.cc:2549
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:2589
String tmp_value
Definition: item_strfunc.h:788
Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:791
const char * func_name() const override
Definition: item_strfunc.h:795
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:1285
Item_func_roles_graphml(const POS &pos)
Definition: item_strfunc.h:1290
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5151
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1315
Item_func_sysconst super
Definition: item_strfunc.h:1286
const char * func_name() const override
Definition: item_strfunc.h:1300
Item_func_roles_graphml()
Definition: item_strfunc.h:1289
bool calculate_graphml(THD *thd)
Constructs and caches the graphml string.
Definition: item_strfunc.cc:5131
String * val_str(String *) override
Definition: item_strfunc.cc:5146
bool value_cache_set
Set to true if value_cache is set.
Definition: item_strfunc.h:1318
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1295
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1302
Definition: item_strfunc.h:806
String tmp_value
Definition: item_strfunc.h:807
Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:810
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2692
String * val_str(String *) override
Definition: item_strfunc.cc:2718
const char * func_name() const override
Definition: item_strfunc.h:814
String rpad_str
Definition: item_strfunc.h:807
Definition: item_strfunc.h:571
Item_func_rtrim(const POS &pos, Item *a)
Definition: item_strfunc.h:573
Definition: item_strfunc.h:1090
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_strfunc.cc:3141
LEX_STRING collation_string
Definition: item_strfunc.h:1093
Item_field * field_for_view_update() override
Definition: item_strfunc.h:1108
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3156
Item_func_set_collation(const POS &pos, Item *a, const LEX_STRING &collation_string_arg)
Definition: item_strfunc.h:1096
const char * func_name() const override
Definition: item_strfunc.h:1104
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3101
enum Functype functype() const override
Definition: item_strfunc.h:1105
String * val_str(String *) override
Definition: item_strfunc.cc:3093
Item_str_func super
Definition: item_strfunc.h:1091
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:3083
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:693
Item_func_soundex(const POS &pos, Item *a)
Definition: item_strfunc.h:698
String tmp_value
Definition: item_strfunc.h:694
Item_func_soundex(Item *a)
Definition: item_strfunc.h:697
String * val_str(String *) override
Definition: item_strfunc.cc:2069
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2025
const char * func_name() const override
Definition: item_strfunc.h:701
Definition: item_strfunc.h:798
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2633
String * val_str(String *) override
Definition: item_strfunc.cc:2664
const char * func_name() const override
Definition: item_strfunc.h:803
Item_func_space(const POS &pos, Item *arg1)
Definition: item_strfunc.h:800
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:1214
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1219
const char * func_name() const override
Definition: item_strfunc.h:1225
String * val_str(String *str) override
Definition: item_strfunc.cc:4126
String buffer
Definition: item_strfunc.h:1215
Item_func_uncompress(const POS &pos, Item *a)
Definition: item_strfunc.h:1218
Definition: item_strfunc.h:1189
const char * func_name() const override
Definition: item_strfunc.h:1195
Item_func_uncompressed_length(const POS &pos, Item *a)
Definition: item_strfunc.h:1193
String value
Definition: item_strfunc.h:1190
longlong val_int() override
Definition: item_strfunc.cc:4028
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1196
Definition: item_strfunc.h:891
Item_func_unhex(const POS &pos, Item *a)
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:3400
String * val_str(String *) override
Convert given hex string to a binary string.
Definition: item_strfunc.cc:3412
String tmp_value
Definition: item_strfunc.h:892
const char * func_name() const override
Definition: item_strfunc.h:899
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:2007
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:1984
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:828
String * val_str(String *) override
Definition: item_strfunc.cc:2825
Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:835
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2817
Item_func_uuid_to_bin(const POS &pos, Item *arg1)
Definition: item_strfunc.h:833
const char * func_name() const override
Definition: item_strfunc.h:839
uchar m_bin_buf[binary_log::Uuid::BYTE_LENGTH]
Buffer to store the binary result.
Definition: item_strfunc.h:830
Definition: item_strfunc.h:1229
Item_func_uuid(const POS &pos)
Definition: item_strfunc.h:1234
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:1243
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:1237
String * val_str(String *) override
Definition: item_strfunc.cc:4334
const char * func_name() const override
Definition: item_strfunc.h:1241
Item_func_uuid()
Definition: item_strfunc.h:1233
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4213
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:4219
Item_str_func super
Definition: item_strfunc.h:1230
Definition: item_strfunc.h:1143
String * val_str(String *) override
Definition: item_strfunc.cc:3268
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_strfunc.cc:3249
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3215
const char * func_name() const override
Definition: item_strfunc.h:1165
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:3192
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3203
const uint num_codepoints
Definition: item_strfunc.h:1148
String tmp_value
Definition: item_strfunc.h:1146
Item_str_func super
Definition: item_strfunc.h:1144
Item_field * m_field_ref
Definition: item_strfunc.h:1150
const uint result_length
Definition: item_strfunc.h:1149
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:1154
const bool as_binary
Definition: item_strfunc.h:1151
uint flags
Definition: item_strfunc.h:1147
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:1019
bool itemize(Parse_context *pc, Item **res) override
The same as contextualize() but with additional parameter.
Definition: item_strfunc.cc:3661
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1033
String tmp_value
Definition: item_strfunc.h:1022
Item_str_func super
Definition: item_strfunc.h:1020
String * val_str(String *) override
Definition: item_strfunc.cc:3669
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:1040
Item_load_file(const POS &pos, Item *a)
Definition: item_strfunc.h:1025
const char * func_name() const override
Definition: item_strfunc.h:1029
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:1030
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item.cc:10673
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:1000
const char * func_name() const override
Definition: item_strfunc.h:1014
Item_typecast_char(THD *thd, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1002
Item_typecast_char(const POS &pos, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1007
bool eq(const Item *item, bool binary_cmp) const override
Definition: item_strfunc.cc:3474
enum Functype functype() const override
Definition: item_strfunc.h:1012
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3491
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:851
String str_value
str_values's main purpose is to cache the value in save_in_field
Definition: item.h:3364
void set_nullable(bool nullable)
Definition: item.h:3467
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3371
bool get_time_from_string(MYSQL_TIME *ltime)
Convert val_str() to time in MYSQL_TIME.
Definition: item.cc:1540
void set_data_type_blob(uint32 max_l)
Set the Item to be of BLOB type.
Definition: item.h:1539
virtual Item_field * field_for_view_update()
Definition: item.h:3000
bool fixed
True if item has been resolved.
Definition: item.h:3455
bool null_value
True if item is null.
Definition: item.h:3492
bool unsigned_flag
Definition: item.h:3493
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:1453
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:2461
void set_data_type_string(uint32 max_l)
Set the Item to be variable length string.
Definition: item.h:1457
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:1203
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:3389
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:287
Wrapper class for an Item list head, used to allocate Item lists in the parser in a context-independe...
Definition: parse_tree_helpers.h:105
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:139
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1156
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:721
#define NAME_STRING(x)
Definition: item.h:347
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:5039
String * mysql_generate_uuid(String *str)
Generate Universal Unique Identifier (UUID).
Definition: item_strfunc.cc:4227
A better implementation of the UNIX ctype(3) library.
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1545
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 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:1044
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:3564
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:2878
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:112
enum_walk
Enumeration for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:287
bool(Item::*)(unsigned char *) Item_processor
Processor type for {Item,Query_block[_UNIT],Table_function}walk.
Definition: sql_const.h:305
constexpr const table_map INNER_TABLE_BIT
Definition: sql_const.h:110
constexpr const int MAX_FIELD_NAME
Definition: sql_const.h:44
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:487
const char * banned_function_name
the name of the function which is not allowed
Definition: item.h:501
Value_generator_source source
Definition: item.h:499
Definition: mysql_lex_string.h:35
Definition: mysql_time.h:82
Definition: item.h:397
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