MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 "mysql/gtid/uuid.h" // Uuid
35
36#include "my_hostname.h" // HOSTNAME_LENGTH
37#include "my_inttypes.h"
38#include "my_table_map.h"
39#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
54#include <openssl/evp.h>
55
56class MY_LOCALE;
57class PT_item_list;
58class THD;
59class my_decimal;
60struct Parse_context;
61
62template <class T>
63class List;
64
66 const char *name, CHARSET_INFO *name_cs = system_charset_info);
67
68/**
69 Generate Universal Unique Identifier (UUID).
70
71 @param str Pointer to string which will hold the UUID.
72
73 @return str Pointer to string which contains the UUID.
74*/
75
77
78class Item_str_func : public Item_func {
80
81 public:
83
84 explicit Item_str_func(const POS &pos) : super(pos) {}
85
87
88 Item_str_func(const POS &pos, Item *a) : Item_func(pos, a) {}
89
90 Item_str_func(Item *a, Item *b) : Item_func(a, b) {}
91
92 Item_str_func(const POS &pos, Item *a, Item *b) : Item_func(pos, a, b) {}
93
94 Item_str_func(Item *a, Item *b, Item *c) : Item_func(a, b, c) {}
95
96 Item_str_func(const POS &pos, Item *a, Item *b, Item *c)
97 : Item_func(pos, a, b, c) {}
98
99 Item_str_func(Item *a, Item *b, Item *c, Item *d) : Item_func(a, b, c, d) {}
100
101 Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d)
102 : Item_func(pos, a, b, c, d) {}
103
104 Item_str_func(Item *a, Item *b, Item *c, Item *d, Item *e)
105 : Item_func(a, b, c, d, e) {}
106
107 Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
108 : Item_func(pos, a, b, c, d, e) {}
109 Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e,
110 Item *f)
111 : Item_func(pos, a, b, c, d, e, f) {}
113
114 Item_str_func(const POS &pos, PT_item_list *opt_list)
115 : Item_func(pos, opt_list) {}
116
117 longlong val_int() override { return val_int_from_string(); }
118 double val_real() override { return val_real_from_string(); }
119 my_decimal *val_decimal(my_decimal *) override;
120 bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override {
121 return get_date_from_string(ltime, fuzzydate);
122 }
123 bool get_time(MYSQL_TIME *ltime) override {
124 return get_time_from_string(ltime);
125 }
126 enum Item_result result_type() const override { return STRING_RESULT; }
127 void left_right_max_length(THD *thd);
128 bool fix_fields(THD *thd, Item **ref) override;
129 bool resolve_type(THD *thd) override {
130 if (param_type_is_default(thd, 0, -1)) return true;
131 return false;
132 }
134
135 protected:
136 /**
137 Calls push_warning_printf for packet overflow.
138 @return error_str().
139 */
140 String *push_packet_overflow_warning(THD *thd, const char *func);
141
142 void add_json_info(Json_object *obj) override {
143 obj->add_alias("func_name", create_dom_ptr<Json_string>(func_name()));
144 }
145};
146
147/*
148 Functions that return values with ASCII repertoire
149*/
152
153 public:
156 }
157
160 }
161 Item_str_ascii_func(const POS &pos, Item *a) : Item_str_func(pos, a) {
163 }
164
167 }
168 Item_str_ascii_func(const POS &pos, Item *a, Item *b)
169 : Item_str_func(pos, a, b) {
171 }
172
175 }
176 Item_str_ascii_func(const POS &pos, Item *a, Item *b, Item *c)
177 : Item_str_func(pos, a, b, c) {
179 }
180
181 String *val_str(String *str) override {
183 }
184 String *val_str_ascii(String *) override = 0;
185};
186
187class Item_func_md5 final : public Item_str_ascii_func {
189
190 public:
191 Item_func_md5(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
192 String *val_str_ascii(String *) override;
193 bool resolve_type(THD *thd) override;
194 const char *func_name() const override { return "md5"; }
195};
196
198 public:
199 Item_func_sha(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
200 String *val_str_ascii(String *) override;
201 bool resolve_type(THD *thd) override;
202 const char *func_name() const override { return "sha"; }
203};
204
206 public:
207 Item_func_sha2(const POS &pos, Item *a, Item *b)
208 : Item_str_ascii_func(pos, a, b) {}
209 String *val_str_ascii(String *) override;
210 bool resolve_type(THD *thd) override;
211 const char *func_name() const override { return "sha2"; }
212};
213
216
217 public:
218 Item_func_to_base64(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
219 String *val_str_ascii(String *) override;
220 bool resolve_type(THD *) override;
221 const char *func_name() const override { return "to_base64"; }
222};
223
225 public:
226 Item_func_statement_digest(const POS &pos, Item *query_string)
227 : Item_str_ascii_func(pos, query_string) {}
228
229 const char *func_name() const override { return "statement_digest"; }
230 bool check_function_as_value_generator(uchar *checker_args) override {
232 pointer_cast<Check_function_as_value_generator_parameters *>(
233 checker_args);
234 func_arg->banned_function_name = func_name();
235 return (func_arg->source == VGS_GENERATED_COLUMN);
236 }
237
238 bool resolve_type(THD *thd) override;
239
240 String *val_str_ascii(String *) override;
241
242 private:
244};
245
247 public:
248 Item_func_statement_digest_text(const POS &pos, Item *query_string)
249 : Item_str_func(pos, query_string) {}
250
251 const char *func_name() const override { return "statement_digest_text"; }
252
253 /**
254 The type is always LONGTEXT, just like the digest_text columns in
255 Performance Schema
256 */
257 bool resolve_type(THD *thd) override;
258
259 bool check_function_as_value_generator(uchar *checker_args) override {
261 pointer_cast<Check_function_as_value_generator_parameters *>(
262 checker_args);
263 func_arg->banned_function_name = func_name();
264 return (func_arg->source == VGS_GENERATED_COLUMN);
265 }
266 String *val_str(String *) override;
267
268 private:
270};
271
274
275 public:
276 Item_func_from_base64(const POS &pos, Item *a) : Item_str_func(pos, a) {}
277 String *val_str(String *) override;
278 bool resolve_type(THD *thd) override;
279 const char *func_name() const override { return "from_base64"; }
280};
281
285 EVP_CIPHER_CTX *ctx{nullptr};
286#if OPENSSL_VERSION_NUMBER < 0x10100000L
287 EVP_CIPHER_CTX stack_ctx;
288#endif
289
290 public:
291 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b)
292 : Item_str_func(pos, a, b) {
294 }
295 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c)
296 : Item_str_func(pos, a, b, c) {
298 }
299 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
300 : Item_str_func(pos, a, b, c, d) {
302 }
303 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
304 Item *e)
305 : Item_str_func(pos, a, b, c, d, e) {
307 }
308 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
309 Item *e, Item *f)
310 : Item_str_func(pos, a, b, c, d, e, f) {
312 }
314
315 void create_op_context();
316 void destroy_op_context();
317 bool do_itemize(Parse_context *pc, Item **res) override;
318 String *val_str(String *) override;
319 bool resolve_type(THD *) override;
320 const char *func_name() const override { return "aes_encrypt"; }
321};
322
325 EVP_CIPHER_CTX *ctx{nullptr};
326#if OPENSSL_VERSION_NUMBER < 0x10100000L
327 EVP_CIPHER_CTX stack_ctx;
328#endif
329
330 public:
331 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b)
332 : Item_str_func(pos, a, b) {
334 }
335 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c)
336 : Item_str_func(pos, a, b, c) {
338 }
339 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
340 : Item_str_func(pos, a, b, c, d) {
342 }
343 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
344 Item *e)
345 : Item_str_func(pos, a, b, c, d, e) {
347 }
348 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
349 Item *e, Item *f)
350 : Item_str_func(pos, a, b, c, d, e, f) {
352 }
354
355 void create_op_context();
356 void destroy_op_context();
357 bool do_itemize(Parse_context *pc, Item **res) override;
358 String *val_str(String *) override;
359 bool resolve_type(THD *thd) override;
360 const char *func_name() const override { return "aes_decrypt"; }
361};
362
365
366 /** limitation from the SSL library */
368
369 public:
370 Item_func_random_bytes(const POS &pos, Item *a) : Item_str_func(pos, a) {}
371
372 bool do_itemize(Parse_context *pc, Item **res) override;
373 bool resolve_type(THD *thd) override;
374 String *val_str(String *a) override;
375
376 const char *func_name() const override { return "random_bytes"; }
378 return RAND_TABLE_BIT;
379 }
380};
381
383 String tmp_value{"", 0, collation.collation}; // Initialize to empty
384 public:
385 Item_func_concat(const POS &pos, PT_item_list *opt_list)
386 : Item_str_func(pos, opt_list) {}
388 Item_func_concat(const POS &pos, Item *a, Item *b)
389 : Item_str_func(pos, a, b) {}
390
391 String *val_str(String *) override;
392 bool resolve_type(THD *thd) override;
393 const char *func_name() const override { return "concat"; }
394};
395
397 String tmp_value{"", 0, collation.collation}; // Initialize to empty
398 public:
401 null_on_null = false;
402 }
403 Item_func_concat_ws(const POS &pos, PT_item_list *opt_list)
404 : Item_str_func(pos, opt_list) {
405 null_on_null = false;
406 }
407 String *val_str(String *) override;
408 bool resolve_type(THD *thd) override;
409 const char *func_name() const override { return "concat_ws"; }
410};
411
414
415 public:
417 Item_func_reverse(const POS &pos, Item *a) : Item_str_func(pos, a) {}
418
419 String *val_str(String *) override;
420 bool resolve_type(THD *thd) override;
421 const char *func_name() const override { return "reverse"; }
422};
423
426 /// Holds result in case we need to allocate our own result buffer.
428
429 public:
431 : Item_str_func(pos, org, find, replace) {}
432 String *val_str(String *) override;
433 bool resolve_type(THD *thd) override;
434 const char *func_name() const override { return "replace"; }
435};
436
439 /// Holds result in case we need to allocate our own result buffer.
441
442 public:
444 Item *new_str)
445 : Item_str_func(pos, org, start, length, new_str) {}
446 String *val_str(String *) override;
447 bool resolve_type(THD *thd) override;
448 const char *func_name() const override { return "insert"; }
449};
450
452 protected:
456
457 public:
458 Item_str_conv(const POS &pos, Item *item) : Item_str_func(pos, item) {}
459 String *val_str(String *) override;
460};
461
463 public:
464 Item_func_lower(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
465 const char *func_name() const override { return "lower"; }
466 bool resolve_type(THD *) override;
467};
468
470 public:
471 Item_func_upper(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
472 const char *func_name() const override { return "upper"; }
473 bool resolve_type(THD *) override;
474};
475
478
479 public:
480 Item_func_left(const POS &pos, Item *a, Item *b) : Item_str_func(pos, a, b) {}
481 String *val_str(String *) override;
482 bool resolve_type(THD *thd) override;
483 const char *func_name() const override { return "left"; }
484};
485
488
489 public:
490 Item_func_right(const POS &pos, Item *a, Item *b)
491 : Item_str_func(pos, a, b) {}
492 String *val_str(String *) override;
493 bool resolve_type(THD *thd) override;
494 const char *func_name() const override { return "right"; }
495};
496
499
501
502 public:
504 Item_func_substr(const POS &pos, Item *a, Item *b) : super(pos, a, b) {}
505
506 Item_func_substr(Item *a, Item *b, Item *c) : Item_str_func(a, b, c) {}
507 Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
508 : super(pos, a, b, c) {}
509
510 String *val_str(String *) override;
511 bool resolve_type(THD *thd) override;
512 const char *func_name() const override { return "substr"; }
513};
514
517
518 public:
519 Item_func_substr_index(const POS &pos, Item *a, Item *b, Item *c)
520 : Item_str_func(pos, a, b, c) {}
521 String *val_str(String *) override;
522 bool resolve_type(THD *) override;
523 const char *func_name() const override { return "substring_index"; }
524};
525
527 public:
528 /**
529 Why all the trim modes in this enum?
530 We need to maintain parsing information, so that our print() function
531 can reproduce correct messages and view definitions.
532 */
540 };
541
542 private:
546 const bool m_trim_leading;
547 const bool m_trim_trailing;
548
549 public:
551 : Item_str_func(a, b),
552 m_trim_mode(tm),
555
556 Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
557 : Item_str_func(pos, a, b),
558 m_trim_mode(tm),
561
563 : Item_str_func(a),
564 m_trim_mode(tm),
567
568 Item_func_trim(const POS &pos, Item *a, TRIM_MODE tm)
569 : Item_str_func(pos, a),
570 m_trim_mode(tm),
573
574 bool trim_leading() const {
577 }
578
579 bool trim_trailing() const {
582 }
583
584 String *val_str(String *) override;
585 bool resolve_type(THD *) override;
586 const char *func_name() const override {
587 switch (m_trim_mode) {
589 return "trim";
590 case TRIM_BOTH:
591 return "trim";
592 case TRIM_LEADING:
593 return "ltrim";
594 case TRIM_TRAILING:
595 return "rtrim";
596 case TRIM_LTRIM:
597 return "ltrim";
598 case TRIM_RTRIM:
599 return "rtrim";
600 }
601 return nullptr;
602 }
603 void print(const THD *thd, String *str,
604 enum_query_type query_type) const override;
605};
606
607class Item_func_ltrim final : public Item_func_trim {
608 public:
609 Item_func_ltrim(const POS &pos, Item *a)
610 : Item_func_trim(pos, a, TRIM_LTRIM) {}
611};
612
613class Item_func_rtrim final : public Item_func_trim {
614 public:
615 Item_func_rtrim(const POS &pos, Item *a)
616 : Item_func_trim(pos, a, TRIM_RTRIM) {}
617};
618
621
622 public:
625 }
626 explicit Item_func_sysconst(const POS &pos) : super(pos) {
628 }
629 /*
630 Used to create correct Item name in new converted item in
631 safe_charset_converter, return string representation of this function
632 call
633 */
634 virtual const Name_string fully_qualified_func_name() const = 0;
635 bool check_function_as_value_generator(uchar *checker_args) override {
637 pointer_cast<Check_function_as_value_generator_parameters *>(
638 checker_args);
639 func_arg->banned_function_name = func_name();
640 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
641 (func_arg->source == VGS_CHECK_CONSTRAINT));
642 }
643};
644
647
648 public:
649 explicit Item_func_database(const POS &pos) : Item_func_sysconst(pos) {}
650
651 bool do_itemize(Parse_context *pc, Item **res) override;
652
653 String *val_str(String *) override;
654 bool resolve_type(THD *) override {
656 set_nullable(true);
657 return false;
658 }
659 const char *func_name() const override { return "database"; }
660 const Name_string fully_qualified_func_name() const override {
661 return NAME_STRING("database()");
662 }
663};
664
667
668 protected:
669 /// True when function value is evaluated, set to false after each execution
670 bool m_evaluated = false;
671
672 /// Evaluate user name, must be called once per execution
673 bool evaluate(const char *user, const char *host);
674 type_conversion_status save_in_field_inner(Field *field, bool) override;
675
676 public:
678 explicit Item_func_user(const POS &pos) : super(pos) {
680 }
681
683 return INNER_TABLE_BIT;
684 }
685
686 bool do_itemize(Parse_context *pc, Item **res) override;
687
688 bool check_function_as_value_generator(uchar *checker_args) override {
690 pointer_cast<Check_function_as_value_generator_parameters *>(
691 checker_args);
692 func_arg->banned_function_name = func_name();
693 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
694 (func_arg->source == VGS_CHECK_CONSTRAINT));
695 }
696 bool resolve_type(THD *) override {
698 return false;
699 }
700 void cleanup() override {
701 m_evaluated = false;
704 }
705 const char *func_name() const override { return "user"; }
706 const Name_string fully_qualified_func_name() const override {
707 return NAME_STRING("user()");
708 }
709
710 String *val_str(String *) override;
711};
712
715 /**
716 Used to pass a security context to the resolver functions.
717 Only used for definer views. In all other contexts, the security context
718 passed here is nullptr and is instead looked up dynamically at run time
719 from the current THD.
720 */
722
723 /// Copied from m_name_resolution_ctx in fix_fields if the definer
724 /// Security_context is set in Name_resolution_context
727
728 protected:
729 type_conversion_status save_in_field_inner(Field *field, bool) override;
730
731 /// Overridden to copy definer priv_user and priv_host
732 bool resolve_type(THD *) override;
733
734 public:
735 explicit Item_func_current_user(const POS &pos) : super(pos) {}
736
737 bool do_itemize(Parse_context *pc, Item **res) override;
738 const char *func_name() const override { return "current_user"; }
739 const Name_string fully_qualified_func_name() const override {
740 return NAME_STRING("current_user()");
741 }
742
743 String *val_str(String *) override;
744};
745
748
749 public:
751 Item_func_soundex(const POS &pos, Item *a) : Item_str_func(pos, a) {}
752 String *val_str(String *) override;
753 bool resolve_type(THD *thd) override;
754 const char *func_name() const override { return "soundex"; }
755};
756
757class Item_func_elt final : public Item_str_func {
758 public:
759 Item_func_elt(const POS &pos, PT_item_list *opt_list)
760 : Item_str_func(pos, opt_list) {}
761 double val_real() override;
762 longlong val_int() override;
763 String *val_str(String *str) override;
764 bool resolve_type(THD *thd) override;
765 const char *func_name() const override { return "elt"; }
766};
767
768class Item_func_make_set final : public Item_str_func {
770
772
773 public:
774 Item_func_make_set(const POS &pos, PT_item_list *opt_list)
775 : Item_str_func(pos, opt_list) {}
776
777 String *val_str(String *str) override;
778 bool fix_fields(THD *thd, Item **ref) override;
779 bool resolve_type(THD *) override;
780 const char *func_name() const override { return "make_set"; }
781
782 void print(const THD *thd, String *str,
783 enum_query_type query_type) const override;
784};
785
789
790 public:
791 Item_func_format(const POS &pos, Item *org, Item *dec)
792 : Item_str_ascii_func(pos, org, dec) {}
793 Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
794 : Item_str_ascii_func(pos, org, dec, lang) {}
795
796 MY_LOCALE *get_locale(Item *item);
797 String *val_str_ascii(String *) override;
798 bool resolve_type(THD *thd) override;
799 const char *func_name() const override { return "format"; }
800 void print(const THD *thd, String *str,
801 enum_query_type query_type) const override;
802};
803
804class Item_func_char final : public Item_str_func {
805 public:
807 : Item_str_func(pos, list) {
809 null_on_null = false;
810 }
812 : Item_str_func(pos, list) {
814 null_on_null = false;
815 }
816 String *val_str(String *) override;
817 bool resolve_type(THD *thd) override {
818 if (param_type_is_default(thd, 0, -1, MYSQL_TYPE_LONGLONG)) return true;
819 if (reject_vector_args()) return true;
821 return false;
822 }
823 const char *func_name() const override { return "char"; }
824 void add_json_info(Json_object *obj) override {
826 obj->add_alias("charset",
827 create_dom_ptr<Json_string>(collation.collation->csname));
828 }
829};
830
831class Item_func_repeat final : public Item_str_func {
833
834 public:
835 Item_func_repeat(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 *thd) override;
839 const char *func_name() const override { return "repeat"; }
840};
841
842class Item_func_space final : public Item_str_func {
843 public:
844 Item_func_space(const POS &pos, Item *arg1) : Item_str_func(pos, arg1) {}
845 String *val_str(String *) override;
846 bool resolve_type(THD *) override;
847 const char *func_name() const override { return "space"; }
848};
849
850class Item_func_rpad final : public Item_str_func {
852
853 public:
854 Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
855 : Item_str_func(pos, arg1, arg2, arg3) {}
856 String *val_str(String *) override;
857 bool resolve_type(THD *) override;
858 const char *func_name() const override { return "rpad"; }
859};
860
861class Item_func_lpad final : public Item_str_func {
863
864 public:
865 Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
866 : Item_str_func(pos, arg1, arg2, arg3) {}
867 String *val_str(String *) override;
868 bool resolve_type(THD *) override;
869 const char *func_name() const override { return "lpad"; }
870};
871
873 /// Buffer to store the binary result
875
876 public:
877 Item_func_uuid_to_bin(const POS &pos, Item *arg1)
878 : Item_str_func(pos, arg1) {}
879 Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
880 : Item_str_func(pos, arg1, arg2) {}
881 String *val_str(String *) override;
882 bool resolve_type(THD *) override;
883 const char *func_name() const override { return "uuid_to_bin"; }
884};
885
887 /// Buffer to store the text result
889
890 public:
891 Item_func_bin_to_uuid(const POS &pos, Item *arg1)
892 : Item_str_ascii_func(pos, arg1) {}
893 Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
894 : Item_str_ascii_func(pos, arg1, arg2) {}
895 String *val_str_ascii(String *) override;
896 bool resolve_type(THD *thd) override;
897 const char *func_name() const override { return "bin_to_uuid"; }
898};
899
900class Item_func_is_uuid final : public Item_bool_func {
902
903 public:
904 Item_func_is_uuid(const POS &pos, Item *a) : Item_bool_func(pos, a) {}
905 longlong val_int() override;
906 const char *func_name() const override { return "is_uuid"; }
907 bool resolve_type(THD *thd) override {
908 if (reject_vector_args()) return true;
909 bool res = super::resolve_type(thd);
910 set_nullable(true);
911 return res;
912 }
913};
914
915class Item_func_conv final : public Item_str_func {
916 public:
917 // 64 digits plus possible '-'.
918 static constexpr uint32_t CONV_MAX_LENGTH = 64U + 1U;
919 Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
920 : Item_str_func(pos, a, b, c) {}
921 const char *func_name() const override { return "conv"; }
922 String *val_str(String *) override;
923 bool resolve_type(THD *) override;
924};
925
928
929 public:
930 Item_func_hex(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
931 const char *func_name() const override { return "hex"; }
932 String *val_str_ascii(String *) override;
933 bool resolve_type(THD *thd) override;
934};
935
936class Item_func_unhex final : public Item_str_func {
938
939 public:
940 Item_func_unhex(const POS &pos, Item *a) : Item_str_func(pos, a) {
941 /* there can be bad hex strings */
942 set_nullable(true);
943 }
944 const char *func_name() const override { return "unhex"; }
945 String *val_str(String *) override;
946 bool resolve_type(THD *thd) override;
947};
948
949#ifndef NDEBUG
951 protected:
954 const bool is_min;
955
956 public:
957 Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
958 : Item_str_func(pos, a, b), is_min(is_min_arg) {
959 set_nullable(true);
960 }
961 String *val_str(String *) override;
962 bool resolve_type(THD *thd) override {
963 if (param_type_is_default(thd, 0, 1)) return true;
964 if (param_type_is_default(thd, 1, 2, MYSQL_TYPE_LONGLONG)) return true;
965 if (reject_vector_args()) return true;
967 return false;
968 }
969};
970
972 public:
974 : Item_func_like_range(pos, a, b, true) {}
975 const char *func_name() const override { return "like_range_min"; }
976};
977
979 public:
981 : Item_func_like_range(pos, a, b, false) {}
982 const char *func_name() const override { return "like_range_max"; }
983};
984#endif
985
986/**
987 The following types of conversions are considered safe:
988
989 Conversion to and from "binary".
990 Conversion to Unicode.
991 Other kind of conversions are potentially lossy.
992*/
994 protected:
995 /// If true, conversion is needed so do it, else allow string copy.
997 /// The character set we are converting to
999 /// The character set we are converting from
1000 const CHARSET_INFO *m_from_cs{nullptr};
1002 /// Marks whether the underlying Item is constant and may be cached.
1004 /// Length argument value, if any given.
1005 longlong m_cast_length{-1}; // a priori not used
1006 public:
1008
1009 protected:
1010 /**
1011 Helper for CAST and CONVERT type resolution: common logic to compute the
1012 maximum numbers of characters of the type of the conversion.
1013
1014 @returns the maximum numbers of characters possible after the conversion
1015 */
1017
1018 bool resolve_type(THD *thd) override;
1019
1020 void add_json_info(Json_object *obj) override {
1022 obj->add_alias("charset", create_dom_ptr<Json_string>(m_cast_cs->csname));
1023 }
1024
1025 public:
1027 bool cache_if_const)
1028 : Item_str_func(a), m_cast_cs(cs_arg) {
1029 if (cache_if_const && args[0]->may_evaluate_const(thd)) {
1030 uint errors = 0;
1031 String tmp, *str = args[0]->val_str(&tmp);
1032 if (!str || str_value.copy(str->ptr(), str->length(), str->charset(),
1033 m_cast_cs, &errors))
1034 null_value = true;
1035 m_use_cached_value = true;
1037 m_safe = (errors == 0);
1038 } else {
1039 m_use_cached_value = false;
1040 // Marks whether the conversion is safe
1042 cs_arg == &my_charset_bin || (cs_arg->state & MY_CS_UNICODE));
1043 }
1044 }
1045 Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
1046 : Item_str_func(pos, a), m_cast_cs(cs_arg) {}
1047
1048 String *val_str(String *) override;
1049};
1050
1052 protected:
1053 void add_json_info(Json_object *obj) override;
1054
1055 public:
1056 Item_typecast_char(THD *thd, Item *a, longlong length_arg,
1057 const CHARSET_INFO *cs_arg)
1058 : Item_charset_conversion(thd, a, cs_arg, false) {
1059 m_cast_length = length_arg;
1060 }
1061 Item_typecast_char(const POS &pos, Item *a, longlong length_arg,
1062 const CHARSET_INFO *cs_arg)
1063 : Item_charset_conversion(pos, a, cs_arg) {
1064 m_cast_length = length_arg;
1065 }
1066 enum Functype functype() const override { return TYPECAST_FUNC; }
1067 bool eq_specific(const Item *item) const override;
1068 const char *func_name() const override { return "cast_as_char"; }
1069 void print(const THD *thd, String *str,
1070 enum_query_type query_type) const override;
1071};
1072
1073class Item_load_file final : public Item_str_func {
1075
1077
1078 public:
1079 Item_load_file(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1080
1081 bool do_itemize(Parse_context *pc, Item **res) override;
1082 String *val_str(String *) override;
1083 const char *func_name() const override { return "load_file"; }
1085 return INNER_TABLE_BIT;
1086 }
1087 bool resolve_type(THD *thd) override {
1088 if (param_type_is_default(thd, 0, 1)) return true;
1089 if (reject_vector_args()) return true;
1092 set_nullable(true);
1093 return false;
1094 }
1095 bool check_function_as_value_generator(uchar *checker_args) override {
1097 pointer_cast<Check_function_as_value_generator_parameters *>(
1098 checker_args);
1099 func_arg->banned_function_name = func_name();
1100 return true;
1101 }
1102};
1103
1105 public:
1106 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
1107 : Item_str_func(pos, a, b, c) {}
1108 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
1109 : Item_str_func(pos, a, b, c, d) {}
1110 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d,
1111 Item *e)
1112 : Item_str_func(pos, a, b, c, d, e) {}
1113 String *val_str(String *str) override;
1114 bool resolve_type(THD *) override;
1115 const char *func_name() const override { return "export_set"; }
1116};
1117
1120
1121 public:
1122 Item_func_quote(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1123 const char *func_name() const override { return "quote"; }
1124 String *val_str(String *) override;
1125 bool resolve_type(THD *thd) override;
1126};
1127
1129 public:
1131 : Item_charset_conversion(pos, a, cs) {
1132 m_safe = false;
1133 }
1134
1136 bool cache_if_const)
1137 : Item_charset_conversion(thd, a, cs, cache_if_const) {
1138 assert(args[0]->fixed);
1139 }
1140 const char *func_name() const override { return "convert"; }
1141 void print(const THD *thd, String *str,
1142 enum_query_type query_type) const override;
1143 bool eq_specific(const Item *item) const override;
1144};
1145
1148
1150
1151 public:
1153 const LEX_STRING &collation_string_arg)
1154 : super(pos, a, nullptr), collation_string(collation_string_arg) {}
1155
1156 bool do_itemize(Parse_context *pc, Item **res) override;
1157 String *val_str(String *) override;
1158 bool resolve_type(THD *) override;
1159 bool eq_specific(const Item *item) const override;
1160 const char *func_name() const override { return "collate"; }
1161 enum Functype functype() const override { return COLLATE_FUNC; }
1162 void print(const THD *thd, String *str,
1163 enum_query_type query_type) const override;
1165 /* this function is transparent for view updating */
1166 return args[0]->field_for_view_update();
1167 }
1168
1169 protected:
1170 void add_json_info(Json_object *obj) override {
1171 obj->add_alias("collation",
1172 create_dom_ptr<Json_string>(collation_string.str,
1174 }
1175};
1176
1177class Item_func_charset final : public Item_str_func {
1178 public:
1179 Item_func_charset(const POS &pos, Item *a) : Item_str_func(pos, a) {
1180 null_on_null = false;
1181 }
1182 String *val_str(String *) override;
1183 const char *func_name() const override { return "charset"; }
1184 bool resolve_type(THD *thd) override {
1186 set_nullable(false);
1187 return Item_str_func::resolve_type(thd);
1188 }
1189};
1190
1192 public:
1193 Item_func_collation(const POS &pos, Item *a) : Item_str_func(pos, a) {
1194 null_on_null = false;
1195 }
1196 String *val_str(String *) override;
1197 const char *func_name() const override { return "collation"; }
1198 bool resolve_type(THD *thd) override {
1199 if (Item_str_func::resolve_type(thd)) return true;
1201 set_nullable(false);
1202 return false;
1203 }
1204};
1205
1208
1210 uint flags;
1211 const uint result_length;
1213 const bool as_binary;
1214
1215 public:
1216 const uint num_codepoints;
1217 Item_func_weight_string(const POS &pos, Item *a, uint result_length_arg,
1218 uint num_codepoints_arg, uint flags_arg,
1219 bool as_binary_arg = false)
1220 : Item_str_func(pos, a),
1221 flags(flags_arg),
1222 result_length(result_length_arg),
1223 as_binary(as_binary_arg),
1224 num_codepoints(num_codepoints_arg) {}
1225
1226 bool do_itemize(Parse_context *pc, Item **res) override;
1227
1228 const char *func_name() const override { return "weight_string"; }
1229 bool eq_specific(const Item *item) const override;
1230 String *val_str(String *) override;
1231 bool resolve_type(THD *) override;
1232 void print(const THD *thd, String *str,
1233 enum_query_type query_type) const override;
1234};
1235
1236class Item_func_crc32 final : public Item_int_func {
1238
1239 public:
1240 Item_func_crc32(const POS &pos, Item *a) : Item_int_func(pos, a) {
1241 unsigned_flag = true;
1242 }
1243 const char *func_name() const override { return "crc32"; }
1244 bool resolve_type(THD *thd) override {
1245 if (param_type_is_default(thd, 0, 1)) return true;
1246 max_length = 10;
1247 return false;
1248 }
1249 longlong val_int() override;
1250};
1251
1254
1255 public:
1257 : Item_int_func(pos, a) {}
1258 const char *func_name() const override { return "uncompressed_length"; }
1259 bool resolve_type(THD *thd) override {
1260 if (param_type_is_default(thd, 0, 1)) return true;
1261 if (reject_vector_args()) return true;
1262 max_length = 10;
1263 return false;
1264 }
1265 longlong val_int() override;
1266};
1267
1268class Item_func_compress final : public Item_str_func {
1270
1271 public:
1272 Item_func_compress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1273 bool resolve_type(THD *thd) override;
1274 const char *func_name() const override { return "compress"; }
1275 String *val_str(String *str) override;
1276};
1277
1280
1281 public:
1282 Item_func_to_vector(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1283 bool resolve_type(THD *thd) override;
1284 const char *func_name() const override { return "to_vector"; }
1285 String *val_str(String *str) override;
1286};
1287
1289 static const uint32 per_value_chars = 16;
1293
1294 public:
1295 Item_func_from_vector(const POS &pos, Item *a) : Item_str_func(pos, a) {
1297 }
1298 bool resolve_type(THD *thd) override;
1299 const char *func_name() const override { return "from_vector"; }
1300 String *val_str(String *str) override;
1301};
1302
1305
1306 public:
1307 Item_func_uncompress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1308 bool resolve_type(THD *thd) override {
1309 if (reject_vector_args()) return true;
1310 if (Item_str_func::resolve_type(thd)) return true;
1311 set_nullable(true);
1313 return false;
1314 }
1315 const char *func_name() const override { return "uncompress"; }
1316 String *val_str(String *str) override;
1317};
1318
1319class Item_func_uuid final : public Item_str_func {
1321
1322 public:
1324 explicit Item_func_uuid(const POS &pos) : Item_str_func(pos) {}
1325
1326 bool do_itemize(Parse_context *pc, Item **res) override;
1328 return RAND_TABLE_BIT;
1329 }
1330 bool resolve_type(THD *) override;
1331 const char *func_name() const override { return "uuid"; }
1332 String *val_str(String *) override;
1333 bool check_function_as_value_generator(uchar *checker_args) override {
1335 pointer_cast<Check_function_as_value_generator_parameters *>(
1336 checker_args);
1337 func_arg->banned_function_name = func_name();
1338 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
1339 (func_arg->source == VGS_CHECK_CONSTRAINT));
1340 }
1341};
1342
1345
1346 public:
1348 explicit Item_func_current_role(const POS &pos)
1349 : super(pos), value_cache_set(false) {}
1350 const char *func_name() const override { return "current_role"; }
1351 void cleanup() override;
1352 String *val_str(String *) override;
1353 bool resolve_type(THD *) override {
1355 return false;
1356 }
1358 return NAME_STRING("current_role()");
1359 }
1360
1361 protected:
1362 void set_current_role(THD *thd);
1363 /** a flag whether @ref value_cache is set or not */
1365 /**
1366 @brief Cache for the result value
1367
1368 Set by init(). And consumed by val_str().
1369 Needed to avoid re-calculation of the current_roles() in the
1370 course of the query.
1371 */
1373};
1374
1377
1378 public:
1380 explicit Item_func_roles_graphml(const POS &pos)
1381 : super(pos), value_cache_set(false) {}
1382 String *val_str(String *) override;
1383 void cleanup() override;
1384
1385 bool resolve_type(THD *) override {
1387 return false;
1388 }
1389
1390 const char *func_name() const override { return "roles_graphml"; }
1391
1393 return NAME_STRING("roles_graphml()");
1394 }
1395
1396 protected:
1397 bool calculate_graphml(THD *thd);
1398 /**
1399 @brief Cache for the result value
1400
1401 Set by init(). And consumed by val_str().
1402 Needed to avoid re-calculation of the current_roles() in the
1403 course of the query.
1404 */
1406
1407 /** Set to true if @ref value_cache is set */
1409};
1410
1412 public:
1414 : Item_str_func(pos, a, b, c) {}
1415
1416 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1417 bool resolve_type(THD *) override {
1418 /*
1419 There are 14 kinds of grants, with a max length
1420 per privileges is 11 chars.
1421 So, setting max approximate to 200.
1422 */
1424 set_nullable(true);
1425 null_on_null = false;
1426
1427 return false;
1428 }
1429
1430 const char *func_name() const override { return "get_dd_column_privileges"; }
1431
1432 String *val_str(String *) override;
1433};
1434
1436 public:
1438 : Item_str_func(pos, a, b, c) {}
1439
1440 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1441 bool resolve_type(THD *) override {
1442 // maximum string length of all options is expected
1443 // to be less than 256 characters.
1445 set_nullable(false);
1446 null_on_null = false;
1447
1448 return false;
1449 }
1450
1451 const char *func_name() const override { return "get_dd_create_options"; }
1452
1453 String *val_str(String *) override;
1454};
1455
1457 public:
1459 : Item_str_func(pos, a) {}
1460
1461 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1462 bool resolve_type(THD *) override {
1463 // maximum string length of all options is expected
1464 // to be less than 256 characters.
1466 set_nullable(false);
1467 null_on_null = false;
1468
1469 return false;
1470 }
1471
1472 const char *func_name() const override { return "get_dd_schema_options"; }
1473
1474 String *val_str(String *) override;
1475};
1476
1478 public:
1480 : Item_str_func(pos, list) {}
1481
1482 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1483 bool resolve_type(THD *) override {
1484 /*
1485 maximum expected string length to be less than 2048 characters,
1486 which is same as size of column holding comments in dictionary,
1487 i.e., the mysql.tables.comment DD column.
1488 */
1490 set_nullable(true);
1491 null_on_null = false;
1492
1493 return false;
1494 }
1495
1496 const char *func_name() const override {
1497 return "internal_get_comment_or_error";
1498 }
1499
1500 String *val_str(String *) override;
1501};
1502
1504 public:
1506 : Item_str_func(pos, a, b) {}
1507
1508 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1509 bool resolve_type(THD *) override {
1510 /* maximum string length of the property value is expected
1511 to be less than 256 characters. */
1513 set_nullable(false);
1514 null_on_null = false;
1515
1516 return false;
1517 }
1518
1519 const char *func_name() const override {
1520 return "get_dd_tablespace_private_data";
1521 }
1522
1523 String *val_str(String *) override;
1524};
1525
1527 public:
1529 : Item_str_func(pos, a, b) {}
1530
1531 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1532 bool resolve_type(THD *) override {
1533 /* maximum string length of the property value is expected
1534 to be less than 256 characters. */
1536 set_nullable(false);
1537 null_on_null = false;
1538
1539 return false;
1540 }
1541
1542 const char *func_name() const override { return "get_dd_index_private_data"; }
1543
1544 String *val_str(String *) override;
1545};
1546
1548 public:
1550 : Item_str_func(pos, a) {}
1551
1552 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1553 bool resolve_type(THD *) override {
1554 // maximum string length of all options is expected
1555 // to be less than 256 characters.
1557 set_nullable(true);
1558 null_on_null = false;
1559
1560 return false;
1561 }
1562
1563 const char *func_name() const override {
1564 return "internal_get_partition_nodegroup";
1565 }
1566
1567 String *val_str(String *) override;
1568};
1569
1571 public:
1573 Item *d)
1574 : Item_str_func(pos, a, b, c, d) {}
1575
1576 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1577 bool resolve_type(THD *) override {
1578 // maximum string length of all options is expected
1579 // to be less than 256 characters.
1581 set_nullable(true);
1582 null_on_null = false;
1583
1584 return false;
1585 }
1586
1587 const char *func_name() const override { return "internal_tablespace_type"; }
1588
1589 String *val_str(String *) override;
1590};
1591
1593 public:
1595 Item *b, Item *c, Item *d)
1596 : Item_str_func(pos, a, b, c, d) {}
1597
1598 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1599 bool resolve_type(THD *) override {
1600 // maximum string length of all options is expected
1601 // to be less than 256 characters.
1603 set_nullable(true);
1604 null_on_null = false;
1605
1606 return false;
1607 }
1608
1609 const char *func_name() const override {
1610 return "internal_tablespace_logfile_group_name";
1611 }
1612
1613 String *val_str(String *) override;
1614};
1615
1617 public:
1619 Item *c, Item *d)
1620 : Item_str_func(pos, a, b, c, d) {}
1621
1622 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1623 bool resolve_type(THD *) override {
1624 // maximum string length of all options is expected
1625 // to be less than 256 characters.
1627 set_nullable(true);
1628 null_on_null = false;
1629
1630 return false;
1631 }
1632
1633 const char *func_name() const override {
1634 return "internal_tablespace_status";
1635 }
1636 String *val_str(String *) override;
1637};
1638
1640 public:
1642 Item *c, Item *d)
1643 : Item_str_func(pos, a, b, c, d) {}
1644
1645 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1646 bool resolve_type(THD *) override {
1647 // maximum string length of all options is expected
1648 // to be less than 256 characters.
1650 set_nullable(true);
1651 null_on_null = false;
1652
1653 return false;
1654 }
1655
1656 const char *func_name() const override {
1657 return "internal_tablespace_row_format";
1658 }
1659
1660 String *val_str(String *) override;
1661};
1662
1664 public:
1666 Item *d)
1667 : Item_str_func(pos, a, b, c, d) {}
1668
1669 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1670 bool resolve_type(THD *) override {
1671 // maximum string length of all options is expected
1672 // to be less than 256 characters.
1674 set_nullable(true);
1675 null_on_null = false;
1676
1677 return false;
1678 }
1679
1680 const char *func_name() const override { return "internal_tablespace_extra"; }
1681
1682 String *val_str(String *) override;
1683};
1684
1686 public:
1688 : Item_str_func(pos, list) {}
1689
1690 bool resolve_type(THD *) override {
1691 set_nullable(false);
1693 return false;
1694 }
1695
1696 const char *func_name() const override { return "convert_cpu_id_mask"; }
1697
1698 String *val_str(String *) override;
1699};
1700
1702 public:
1704 : Item_str_func(pos, a, b) {}
1705
1706 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1707 bool resolve_type(THD *) override {
1709 set_nullable(true);
1710 null_on_null = false;
1711
1712 return false;
1713 }
1714
1715 const char *func_name() const override { return "get_dd_property_key_value"; }
1716
1717 String *val_str(String *) override;
1718};
1719
1721 public:
1723 : Item_str_func(pos, a, b) {}
1724
1725 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1726 bool resolve_type(THD *) override {
1728 set_nullable(true);
1729 null_on_null = false;
1730
1731 return false;
1732 }
1733
1734 const char *func_name() const override { return "remove_dd_property_key"; }
1735
1736 String *val_str(String *) override;
1737};
1738
1740 public:
1742 : Item_str_func(pos, a, b) {}
1743
1744 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1745 bool resolve_type(THD *) override {
1746 // maximum string length of all options is expected
1747 // to be less than 256 characters.
1749 set_nullable(true);
1750 null_on_null = false;
1751
1752 return false;
1753 }
1754
1755 const char *func_name() const override {
1756 return "convert_interval_to_user_interval";
1757 }
1758
1759 String *val_str(String *) override;
1760};
1761
1763 public:
1765 : Item_str_func(pos, list) {}
1766
1767 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1768 bool resolve_type(THD *) override {
1770 set_nullable(true);
1771 null_on_null = false;
1772
1773 return false;
1774 }
1775
1776 const char *func_name() const override { return "internal_get_username"; }
1777
1778 String *val_str(String *) override;
1779};
1780
1782 public:
1784 : Item_str_func(pos, list) {}
1785
1786 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1787 bool resolve_type(THD *) override {
1789 set_nullable(true);
1790 null_on_null = false;
1791
1792 return false;
1793 }
1794
1795 const char *func_name() const override { return "internal_get_hostname"; }
1796
1797 String *val_str(String *) override;
1798};
1799
1801 public:
1803 : Item_str_func(pos) {}
1804
1805 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1806 bool resolve_type(THD *) override {
1808 set_nullable(true);
1809 null_on_null = false;
1810
1811 return false;
1812 }
1813
1814 const char *func_name() const override {
1815 return "internal_get_enabled_role_json";
1816 }
1817
1818 String *val_str(String *) override;
1819};
1820
1822 public:
1824 : Item_str_func(pos) {}
1825
1826 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1827 bool resolve_type(THD *) override {
1829 set_nullable(true);
1830 null_on_null = false;
1831
1832 return false;
1833 }
1834
1835 const char *func_name() const override {
1836 return "internal_get_mandatory_roles_json";
1837 }
1838
1839 String *val_str(String *) override;
1840};
1841
1843 public:
1845 : Item_str_func(pos, list) {}
1846
1847 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1848 bool resolve_type(THD *) override {
1849 // maximum string length of all options is expected
1850 // to be less than 256 characters.
1852 set_nullable(false);
1853 null_on_null = false;
1854
1855 return false;
1856 }
1857
1858 const char *func_name() const override {
1859 return "internal_get_dd_column_extra";
1860 }
1861
1862 String *val_str(String *) override;
1863};
1864
1865#endif /* ITEM_STRFUNC_INCLUDED */
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
void set(const DTCollation &dt)
Definition: item.h:205
void set_repertoire(uint repertoire_arg)
Definition: item.h:231
const CHARSET_INFO * collation
Definition: item.h:187
static const uint32 max_dimensions
Definition: field.h:3948
Definition: field.h:577
Definition: item_cmpfunc.h:294
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:328
The following types of conversions are considered safe:
Definition: item_strfunc.h:993
const CHARSET_INFO * m_cast_cs
The character set we are converting to.
Definition: item_strfunc.h:998
bool m_safe
Definition: item_strfunc.h:1007
bool m_charset_conversion
If true, conversion is needed so do it, else allow string copy.
Definition: item_strfunc.h:996
const CHARSET_INFO * m_from_cs
The character set we are converting from.
Definition: item_strfunc.h:1000
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3616
Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1045
bool m_use_cached_value
Marks whether the underlying Item is constant and may be cached.
Definition: item_strfunc.h:1003
String * val_str(String *) override
Definition: item_strfunc.cc:3507
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:1020
longlong m_cast_length
Length argument value, if any given.
Definition: item_strfunc.h:1005
String m_tmp_value
Definition: item_strfunc.h:1001
Item_charset_conversion(THD *thd, Item *a, const CHARSET_INFO *cs_arg, bool cache_if_const)
Definition: item_strfunc.h:1026
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:3585
Definition: item.h:4386
Definition: item_strfunc.h:323
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:339
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:343
String * val_str(String *) override
Definition: item_strfunc.cc:689
void destroy_op_context()
Definition: item_strfunc.cc:673
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:679
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:335
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:331
Item_str_func super
Definition: item_strfunc.h:324
EVP_CIPHER_CTX * ctx
Definition: item_strfunc.h:325
const char * func_name() const override
Definition: item_strfunc.h:360
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e, Item *f)
Definition: item_strfunc.h:348
void create_op_context()
Definition: item_strfunc.cc:665
~Item_func_aes_decrypt() override
Definition: item_strfunc.h:353
EVP_CIPHER_CTX stack_ctx
Definition: item_strfunc.h:327
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:740
Definition: item_strfunc.h:282
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e, Item *f)
Definition: item_strfunc.h:308
void create_op_context()
Definition: item_strfunc.cc:572
String * val_str(String *) override
Definition: item_strfunc.cc:596
const char * func_name() const override
Definition: item_strfunc.h:320
EVP_CIPHER_CTX * ctx
Definition: item_strfunc.h:285
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:295
EVP_CIPHER_CTX stack_ctx
Definition: item_strfunc.h:287
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:291
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:586
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:655
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:299
~Item_func_aes_encrypt() override
Definition: item_strfunc.h:313
String tmp_value
Definition: item_strfunc.h:283
Item_str_func super
Definition: item_strfunc.h:284
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:303
void destroy_op_context()
Definition: item_strfunc.cc:580
Definition: item_strfunc.h:886
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2876
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2886
Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:893
Item_func_bin_to_uuid(const POS &pos, Item *arg1)
Definition: item_strfunc.h:891
const char * func_name() const override
Definition: item_strfunc.h:897
char m_text_buf[mysql::gtid::Uuid::TEXT_LENGTH+1]
Buffer to store the text result.
Definition: item_strfunc.h:888
Definition: item_strfunc.h:804
Item_func_char(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:806
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:824
Item_func_char(const POS &pos, PT_item_list *list, const CHARSET_INFO *cs)
Definition: item_strfunc.h:811
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:817
String * val_str(String *) override
Definition: item_strfunc.cc:2520
const char * func_name() const override
Definition: item_strfunc.h:823
Definition: item_strfunc.h:1177
Item_func_charset(const POS &pos, Item *a)
Definition: item_strfunc.h:1179
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1184
String * val_str(String *) override
Definition: item_strfunc.cc:3184
const char * func_name() const override
Definition: item_strfunc.h:1183
Definition: item_strfunc.h:1191
String * val_str(String *) override
Definition: item_strfunc.cc:3198
const char * func_name() const override
Definition: item_strfunc.h:1197
Item_func_collation(const POS &pos, Item *a)
Definition: item_strfunc.h:1193
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1198
Definition: item_strfunc.h:1268
String buffer
Definition: item_strfunc.h:1269
Item_func_compress(const POS &pos, Item *a)
Definition: item_strfunc.h:1272
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4089
String * val_str(String *str) override
Definition: item_strfunc.cc:4097
const char * func_name() const override
Definition: item_strfunc.h:1274
Definition: item_strfunc.h:396
const char * func_name() const override
Definition: item_strfunc.h:409
Item_func_concat_ws(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:403
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1213
String tmp_value
Definition: item_strfunc.h:397
String * val_str(String *) override
concat with separator.
Definition: item_strfunc.cc:1180
Item_func_concat_ws(mem_root_deque< Item * > *list)
Definition: item_strfunc.h:399
Definition: item_strfunc.h:382
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:1130
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1155
Item_func_concat(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:388
Item_func_concat(Item *a, Item *b)
Definition: item_strfunc.h:387
Item_func_concat(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:385
const char * func_name() const override
Definition: item_strfunc.h:393
String tmp_value
Definition: item_strfunc.h:383
Definition: item_strfunc.h:1128
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3092
Item_func_conv_charset(const POS &pos, Item *a, const CHARSET_INFO *cs)
Definition: item_strfunc.h:1130
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3098
const char * func_name() const override
Definition: item_strfunc.h:1140
Item_func_conv_charset(THD *thd, Item *a, const CHARSET_INFO *cs, bool cache_if_const)
Definition: item_strfunc.h:1135
Definition: item_strfunc.h:915
String * val_str(String *) override
Definition: item_strfunc.cc:3021
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3013
static constexpr uint32_t CONV_MAX_LENGTH
Definition: item_strfunc.h:918
Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:919
const char * func_name() const override
Definition: item_strfunc.h:921
Definition: item_strfunc.h:1685
const char * func_name() const override
Definition: item_strfunc.h:1696
Item_func_convert_cpu_id_mask(const POS &pos, Item *list)
Definition: item_strfunc.h:1687
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1690
String * val_str(String *) override
Definition: item_strfunc.cc:5165
Definition: item_strfunc.h:1739
const char * func_name() const override
Definition: item_strfunc.h:1755
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1745
enum Functype functype() const override
Definition: item_strfunc.h:1744
String * val_str(String *) override
Definition: item_strfunc.cc:5379
Item_func_convert_interval_to_user_interval(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1741
Definition: item_strfunc.h:1236
const char * func_name() const override
Definition: item_strfunc.h:1243
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1244
Item_func_crc32(const POS &pos, Item *a)
Definition: item_strfunc.h:1240
longlong val_int() override
Definition: item_strfunc.cc:4077
String value
Definition: item_strfunc.h:1237
Definition: item_strfunc.h:1343
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1357
void set_current_role(THD *thd)
Definition: item_strfunc.cc:5221
Item_func_current_role()
Definition: item_strfunc.h:1347
const char * func_name() const override
Definition: item_strfunc.h:1350
bool value_cache_set
a flag whether value_cache is set or not
Definition: item_strfunc.h:1364
Item_func_sysconst super
Definition: item_strfunc.h:1344
Item_func_current_role(const POS &pos)
Definition: item_strfunc.h:1348
String * val_str(String *) override
Definition: item_strfunc.cc:5216
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1353
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1372
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5208
Definition: item_strfunc.h:713
Item_func_user super
Definition: item_strfunc.h:714
bool resolve_type(THD *) override
Overridden to copy definer priv_user and priv_host.
Definition: item_strfunc.cc:2012
Item_func_current_user(const POS &pos)
Definition: item_strfunc.h:735
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:739
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:2089
const char * func_name() const override
Definition: item_strfunc.h:738
LEX_CSTRING m_definer_priv_host
Definition: item_strfunc.h:726
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:2006
LEX_CSTRING m_definer_priv_user
Copied from m_name_resolution_ctx in fix_fields if the definer Security_context is set in Name_resolu...
Definition: item_strfunc.h:725
String * val_str(String *) override
Definition: item_strfunc.cc:2037
Name_resolution_context * m_name_resolution_ctx
Used to pass a security context to the resolver functions.
Definition: item_strfunc.h:721
Definition: item_strfunc.h:645
Item_func_sysconst super
Definition: item_strfunc.h:646
String * val_str(String *) override
Definition: item_strfunc.cc:1976
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:654
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:660
Item_func_database(const POS &pos)
Definition: item_strfunc.h:649
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:1968
const char * func_name() const override
Definition: item_strfunc.h:659
Definition: item_strfunc.h:757
const char * func_name() const override
Definition: item_strfunc.h:765
longlong val_int() override
Definition: item_strfunc.cc:2419
String * val_str(String *str) override
Definition: item_strfunc.cc:2432
double val_real() override
Definition: item_strfunc.cc:2407
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2388
Item_func_elt(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:759
Definition: item_strfunc.h:1104
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1106
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:1110
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1108
String * val_str(String *str) override
Definition: item_strfunc.cc:3742
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3811
const char * func_name() const override
Definition: item_strfunc.h:1115
Definition: item_strfunc.h:786
const char * func_name() const override
Definition: item_strfunc.h:799
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2375
String tmp_str
Definition: item_strfunc.h:787
MY_LOCALE * get_locale(Item *item)
Definition: item_strfunc.cc:2244
MY_LOCALE * locale
Definition: item_strfunc.h:788
Item_func_format(const POS &pos, Item *org, Item *dec)
Definition: item_strfunc.h:791
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2284
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2259
Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
Definition: item_strfunc.h:793
Definition: item_strfunc.h:272
String tmp_value
Definition: item_strfunc.h:273
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:838
const char * func_name() const override
Definition: item_strfunc.h:279
String * val_str(String *) override
Definition: item_strfunc.cc:852
Item_func_from_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:276
Definition: item_strfunc.h:1288
Item_func_from_vector(const POS &pos, Item *a)
Definition: item_strfunc.h:1295
const char * func_name() const override
Definition: item_strfunc.h:1299
String buffer
Definition: item_strfunc.h:1292
static const uint32 per_value_chars
Definition: item_strfunc.h:1289
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4189
static const uint32 max_output_bytes
Definition: item_strfunc.h:1290
String * val_str(String *str) override
Definition: item_strfunc.cc:4204
Definition: item_strfunc.h:1411
Item_func_get_dd_column_privileges(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1413
const char * func_name() const override
Definition: item_strfunc.h:1430
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1417
enum Functype functype() const override
Definition: item_strfunc.h:1416
String * val_str(String *) override
This function prepares string with list of column privileges.
Definition: item_strfunc.cc:4463
Definition: item_strfunc.h:1435
enum Functype functype() const override
Definition: item_strfunc.h:1440
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1441
String * val_str(String *) override
This function prepares string representing create_options for table.
Definition: item_strfunc.cc:4535
Item_func_get_dd_create_options(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1437
const char * func_name() const override
Definition: item_strfunc.h:1451
Definition: item_strfunc.h:1526
const char * func_name() const override
Definition: item_strfunc.h:1542
Item_func_get_dd_index_private_data(const POS &pos, Item *a, Item *b)
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:1532
String * val_str(String *) override
This function prepares string representing se_private_data for index.
Definition: item_strfunc.cc:5080
enum Functype functype() const override
Definition: item_strfunc.h:1531
Definition: item_strfunc.h:1701
String * val_str(String *) override
This function prepares string representing value stored at key supplied.
Definition: item_strfunc.cc:5276
enum Functype functype() const override
Definition: item_strfunc.h:1706
Item_func_get_dd_property_key_value(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1703
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1707
const char * func_name() const override
Definition: item_strfunc.h:1715
Definition: item_strfunc.h:1456
String * val_str(String *) override
This function prepares string representing options for a schema.
Definition: item_strfunc.cc:4736
const char * func_name() const override
Definition: item_strfunc.h:1472
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1462
enum Functype functype() const override
Definition: item_strfunc.h:1461
Item_func_get_dd_schema_options(const POS &pos, Item *a)
Definition: item_strfunc.h:1458
Definition: item_strfunc.h:1503
String * val_str(String *) override
This function prepares string representing se_private_data for tablespace.
Definition: item_strfunc.cc:5014
const char * func_name() const override
Definition: item_strfunc.h:1519
enum Functype functype() const override
Definition: item_strfunc.h:1508
Item_func_get_dd_tablespace_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1505
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1509
Definition: item_strfunc.h:1547
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1553
String * val_str(String *) override
Definition: item_strfunc.cc:4861
enum Functype functype() const override
Definition: item_strfunc.h:1552
Item_func_get_partition_nodegroup(const POS &pos, Item *a)
Definition: item_strfunc.h:1549
const char * func_name() const override
Definition: item_strfunc.h:1563
Definition: item_strfunc.h:926
String tmp_value
Definition: item_strfunc.h:927
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3364
Item_func_hex(const POS &pos, Item *a)
Definition: item_strfunc.h:930
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:3376
const char * func_name() const override
Definition: item_strfunc.h:931
Definition: item_strfunc.h:437
String * val_str(String *) override
Definition: item_strfunc.cc:1374
const char * func_name() const override
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:1426
String tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:440
Item_func_insert(const POS &pos, Item *org, Item *start, Item *length, Item *new_str)
Definition: item_strfunc.h:443
String tmp_value
Definition: item_strfunc.h:438
Definition: item_strfunc.h:1477
Item_func_internal_get_comment_or_error(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1479
const char * func_name() const override
Definition: item_strfunc.h:1496
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1483
String * val_str(String *) override
Definition: item_strfunc.cc:4784
enum Functype functype() const override
Definition: item_strfunc.h:1482
Definition: item_strfunc.h:1842
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1848
String * val_str(String *) override
This function prepares string representing EXTRA column for I_S.COLUMNS.
Definition: item_strfunc.cc:5556
const char * func_name() const override
Definition: item_strfunc.h:1858
Item_func_internal_get_dd_column_extra(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1844
enum Functype functype() const override
Definition: item_strfunc.h:1847
Definition: item_strfunc.h:1800
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1806
enum Functype functype() const override
Definition: item_strfunc.h:1805
Item_func_internal_get_enabled_role_json(const POS &pos)
Definition: item_strfunc.h:1802
String * val_str(String *) override
Definition: item_strfunc.cc:5475
const char * func_name() const override
Definition: item_strfunc.h:1814
Definition: item_strfunc.h:1781
Item_func_internal_get_hostname(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1783
enum Functype functype() const override
Definition: item_strfunc.h:1786
const char * func_name() const override
Definition: item_strfunc.h:1795
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1787
String * val_str(String *) override
Definition: item_strfunc.cc:5440
Definition: item_strfunc.h:1821
const char * func_name() const override
Definition: item_strfunc.h:1835
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1827
enum Functype functype() const override
Definition: item_strfunc.h:1826
Item_func_internal_get_mandatory_roles_json(const POS &pos)
Definition: item_strfunc.h:1823
String * val_str(String *) override
Definition: item_strfunc.cc:5507
Definition: item_strfunc.h:1762
String * val_str(String *) override
Definition: item_strfunc.cc:5403
Item_func_internal_get_username(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1764
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1768
enum Functype functype() const override
Definition: item_strfunc.h:1767
const char * func_name() const override
Definition: item_strfunc.h:1776
Definition: item_strfunc.h:1663
String * val_str(String *) override
Definition: item_strfunc.cc:4980
const char * func_name() const override
Definition: item_strfunc.h:1680
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1670
enum Functype functype() const override
Definition: item_strfunc.h:1669
Item_func_internal_tablespace_extra(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1665
const char * func_name() const override
Definition: item_strfunc.h:1609
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1599
String * val_str(String *) override
Definition: item_strfunc.cc:4918
Item_func_internal_tablespace_logfile_group_name(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1594
enum Functype functype() const override
Definition: item_strfunc.h:1598
Definition: item_strfunc.h:1639
const char * func_name() const override
Definition: item_strfunc.h:1656
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1646
Item_func_internal_tablespace_row_format(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1641
String * val_str(String *) override
Definition: item_strfunc.cc:4958
enum Functype functype() const override
Definition: item_strfunc.h:1645
Definition: item_strfunc.h:1616
Item_func_internal_tablespace_status(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1618
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1623
String * val_str(String *) override
Definition: item_strfunc.cc:4941
enum Functype functype() const override
Definition: item_strfunc.h:1622
const char * func_name() const override
Definition: item_strfunc.h:1633
Definition: item_strfunc.h:1570
enum Functype functype() const override
Definition: item_strfunc.h:1576
String * val_str(String *) override
Definition: item_strfunc.cc:4901
const char * func_name() const override
Definition: item_strfunc.h:1587
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1577
Item_func_internal_tablespace_type(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1572
Definition: item_strfunc.h:900
const char * func_name() const override
Definition: item_strfunc.h:906
longlong val_int() override
Definition: item_strfunc.cc:2926
Item_func_is_uuid(const POS &pos, Item *a)
Definition: item_strfunc.h:904
Item_bool_func super
Definition: item_strfunc.h:901
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:907
Definition: item_strfunc.h:476
Item_func_left(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:480
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1546
String tmp_value
Definition: item_strfunc.h:477
String * val_str(String *) override
Definition: item_strfunc.cc:1499
const char * func_name() const override
Definition: item_strfunc.h:483
Definition: item_strfunc.h:978
const char * func_name() const override
Definition: item_strfunc.h:982
Item_func_like_range_max(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:980
Definition: item_strfunc.h:971
const char * func_name() const override
Definition: item_strfunc.h:975
Item_func_like_range_min(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:973
Definition: item_strfunc.h:950
String max_str
Definition: item_strfunc.h:953
const bool is_min
Definition: item_strfunc.h:954
Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
Definition: item_strfunc.h:957
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:962
String min_str
Definition: item_strfunc.h:952
String * val_str(String *) override
Definition: item_strfunc.cc:3451
Definition: item_strfunc.h:462
const char * func_name() const override
Definition: item_strfunc.h:465
Item_func_lower(const POS &pos, Item *item)
Definition: item_strfunc.h:464
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1475
Definition: item_strfunc.h:861
String * val_str(String *) override
Definition: item_strfunc.cc:2940
Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:865
String tmp_value
Definition: item_strfunc.h:862
String lpad_str
Definition: item_strfunc.h:862
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2807
const char * func_name() const override
Definition: item_strfunc.h:869
Definition: item_strfunc.h:607
Item_func_ltrim(const POS &pos, Item *a)
Definition: item_strfunc.h:609
Definition: item_strfunc.h:768
String * val_str(String *str) override
Definition: item_strfunc.cc:2472
Item_str_func super
Definition: item_strfunc.h:769
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2509
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2456
String tmp_str
Definition: item_strfunc.h:771
Item_func_make_set(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:774
bool fix_fields(THD *thd, Item **ref) override
Definition: item_strfunc.cc:2452
const char * func_name() const override
Definition: item_strfunc.h:780
Definition: item_strfunc.h:187
const char * func_name() const override
Definition: item_strfunc.h:194
Item_func_md5(const POS &pos, Item *a)
Definition: item_strfunc.h:191
String tmp_value
Definition: item_strfunc.h:188
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:236
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:193
Definition: item_strfunc.h:1118
String * val_str(String *) override
QUOTE() function returns argument string in single quotes suitable for using in a SQL statement.
Definition: item_strfunc.cc:3872
Item_func_quote(const POS &pos, Item *a)
Definition: item_strfunc.h:1122
String tmp_value
Definition: item_strfunc.h:1119
const char * func_name() const override
Definition: item_strfunc.h:1123
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3831
Definition: item_strfunc.h:363
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:377
static const ulonglong MAX_RANDOM_BYTES_BUFFER
limitation from the SSL library
Definition: item_strfunc.h:367
Item_str_func super
Definition: item_strfunc.h:364
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:748
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:765
Item_func_random_bytes(const POS &pos, Item *a)
Definition: item_strfunc.h:370
String * val_str(String *a) override
Definition: item_strfunc.cc:772
const char * func_name() const override
Definition: item_strfunc.h:376
Definition: item_strfunc.h:1720
Item_func_remove_dd_property_key(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1722
const char * func_name() const override
Definition: item_strfunc.h:1734
String * val_str(String *) override
This function removes a key value from given property string.
Definition: item_strfunc.cc:5333
enum Functype functype() const override
Definition: item_strfunc.h:1725
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1726
Definition: item_strfunc.h:831
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2570
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:2604
String tmp_value
Definition: item_strfunc.h:832
Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:835
const char * func_name() const override
Definition: item_strfunc.h:839
Definition: item_strfunc.h:424
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1352
String * val_str(String *) override
Replace all occurrences of string2 in string1 with string3.
Definition: item_strfunc.cc:1290
const char * func_name() const override
Definition: item_strfunc.h:434
String tmp_value
Definition: item_strfunc.h:425
String tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:427
String tmp_value2
Definition: item_strfunc.h:425
Item_func_replace(const POS &pos, Item *org, Item *find, Item *replace)
Definition: item_strfunc.h:430
Definition: item_strfunc.h:412
Item_func_reverse(Item *a)
Definition: item_strfunc.h:416
String * val_str(String *) override
Definition: item_strfunc.cc:1235
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1277
String tmp_value
Definition: item_strfunc.h:413
Item_func_reverse(const POS &pos, Item *a)
Definition: item_strfunc.h:417
const char * func_name() const override
Definition: item_strfunc.h:421
Definition: item_strfunc.h:486
Item_func_right(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:490
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1578
const char * func_name() const override
Definition: item_strfunc.h:494
String * val_str(String *) override
Definition: item_strfunc.cc:1556
String tmp_value
Definition: item_strfunc.h:487
Definition: item_strfunc.h:1375
Item_func_roles_graphml(const POS &pos)
Definition: item_strfunc.h:1380
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5259
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1405
Item_func_sysconst super
Definition: item_strfunc.h:1376
const char * func_name() const override
Definition: item_strfunc.h:1390
Item_func_roles_graphml()
Definition: item_strfunc.h:1379
bool calculate_graphml(THD *thd)
Constructs and caches the graphml string.
Definition: item_strfunc.cc:5239
String * val_str(String *) override
Definition: item_strfunc.cc:5254
bool value_cache_set
Set to true if value_cache is set.
Definition: item_strfunc.h:1408
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1385
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1392
Definition: item_strfunc.h:850
String tmp_value
Definition: item_strfunc.h:851
Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:854
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2708
String * val_str(String *) override
Definition: item_strfunc.cc:2735
const char * func_name() const override
Definition: item_strfunc.h:858
String rpad_str
Definition: item_strfunc.h:851
Definition: item_strfunc.h:613
Item_func_rtrim(const POS &pos, Item *a)
Definition: item_strfunc.h:615
Definition: item_strfunc.h:1146
LEX_STRING collation_string
Definition: item_strfunc.h:1149
Item_field * field_for_view_update() override
Definition: item_strfunc.h:1164
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3166
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3173
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:1170
Item_func_set_collation(const POS &pos, Item *a, const LEX_STRING &collation_string_arg)
Definition: item_strfunc.h:1152
const char * func_name() const override
Definition: item_strfunc.h:1160
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3125
enum Functype functype() const override
Definition: item_strfunc.h:1161
String * val_str(String *) override
Definition: item_strfunc.cc:3117
Item_str_func super
Definition: item_strfunc.h:1147
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3107
Definition: item_strfunc.h:205
const char * func_name() const override
Definition: item_strfunc.h:211
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:280
Item_func_sha2(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:207
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:354
Definition: item_strfunc.h:197
const char * func_name() const override
Definition: item_strfunc.h:202
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:244
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:265
Item_func_sha(const POS &pos, Item *a)
Definition: item_strfunc.h:199
Definition: item_strfunc.h:746
Item_func_soundex(const POS &pos, Item *a)
Definition: item_strfunc.h:751
String tmp_value
Definition: item_strfunc.h:747
Item_func_soundex(Item *a)
Definition: item_strfunc.h:750
String * val_str(String *) override
Definition: item_strfunc.cc:2142
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2097
const char * func_name() const override
Definition: item_strfunc.h:754
Definition: item_strfunc.h:842
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2648
String * val_str(String *) override
Definition: item_strfunc.cc:2680
const char * func_name() const override
Definition: item_strfunc.h:847
Item_func_space(const POS &pos, Item *arg1)
Definition: item_strfunc.h:844
Definition: item_strfunc.h:246
bool resolve_type(THD *thd) override
The type is always LONGTEXT, just like the digest_text columns in Performance Schema.
Definition: item_strfunc.cc:1090
const char * func_name() const override
Definition: item_strfunc.h:251
uchar * m_token_buffer
Definition: item_strfunc.h:269
Item_func_statement_digest_text(const POS &pos, Item *query_string)
Definition: item_strfunc.h:248
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:259
String * val_str(String *) override
Definition: item_strfunc.cc:1099
Definition: item_strfunc.h:224
uchar * m_token_buffer
Definition: item_strfunc.h:243
Item_func_statement_digest(const POS &pos, Item *query_string)
Definition: item_strfunc.h:226
const char * func_name() const override
Definition: item_strfunc.h:229
String * val_str_ascii(String *) override
Implementation of the STATEMENT_DIGEST() native function.
Definition: item_strfunc.cc:1060
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1044
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:230
Definition: item_strfunc.h:515
String * val_str(String *) override
Definition: item_strfunc.cc:1688
Item_func_substr_index(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:519
String tmp_value
Definition: item_strfunc.h:516
const char * func_name() const override
Definition: item_strfunc.h:523
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1677
Definition: item_strfunc.h:497
const char * func_name() const override
Definition: item_strfunc.h:512
Item_func_substr(Item *a, Item *b)
Definition: item_strfunc.h:503
Item_func_substr(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:506
String tmp_value
Definition: item_strfunc.h:500
Item_func_substr(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:504
Item_str_func super
Definition: item_strfunc.h:498
String * val_str(String *) override
Definition: item_strfunc.cc:1589
Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:507
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1636
Definition: item_strfunc.h:619
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:635
virtual const Name_string fully_qualified_func_name() const =0
Item_func_sysconst(const POS &pos)
Definition: item_strfunc.h:626
Item_str_func super
Definition: item_strfunc.h:620
Item_func_sysconst()
Definition: item_strfunc.h:623
Definition: item_strfunc.h:214
const char * func_name() const override
Definition: item_strfunc.h:221
Item_func_to_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:218
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:803
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:820
String tmp_value
Definition: item_strfunc.h:215
Definition: item_strfunc.h:1278
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4146
String * val_str(String *str) override
Definition: item_strfunc.cc:4161
String buffer
Definition: item_strfunc.h:1279
const char * func_name() const override
Definition: item_strfunc.h:1284
Item_func_to_vector(const POS &pos, Item *a)
Definition: item_strfunc.h:1282
Definition: item_strfunc.h:526
const bool m_trim_trailing
Definition: item_strfunc.h:547
bool trim_trailing() const
Definition: item_strfunc.h:579
bool trim_leading() const
Definition: item_strfunc.h:574
const char * func_name() const override
Definition: item_strfunc.h:586
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1898
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:1938
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:533
@ TRIM_BOTH_DEFAULT
Definition: item_strfunc.h:534
@ TRIM_LTRIM
Definition: item_strfunc.h:538
@ TRIM_RTRIM
Definition: item_strfunc.h:539
@ TRIM_BOTH
Definition: item_strfunc.h:535
@ TRIM_LEADING
Definition: item_strfunc.h:536
@ TRIM_TRAILING
Definition: item_strfunc.h:537
Item_func_trim(Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:562
Item_func_trim(Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:550
Item_func_trim(const POS &pos, Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:568
String tmp_value
Definition: item_strfunc.h:543
const TRIM_MODE m_trim_mode
Definition: item_strfunc.h:545
Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:556
String remove
Definition: item_strfunc.h:544
const bool m_trim_leading
Definition: item_strfunc.h:546
String * val_str(String *) override
Definition: item_strfunc.cc:1803
Definition: item_strfunc.h:1303
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1308
const char * func_name() const override
Definition: item_strfunc.h:1315
String * val_str(String *str) override
Definition: item_strfunc.cc:4236
String buffer
Definition: item_strfunc.h:1304
Item_func_uncompress(const POS &pos, Item *a)
Definition: item_strfunc.h:1307
Definition: item_strfunc.h:1252
const char * func_name() const override
Definition: item_strfunc.h:1258
Item_func_uncompressed_length(const POS &pos, Item *a)
Definition: item_strfunc.h:1256
String value
Definition: item_strfunc.h:1253
longlong val_int() override
Definition: item_strfunc.cc:4048
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1259
Definition: item_strfunc.h:936
Item_func_unhex(const POS &pos, Item *a)
Definition: item_strfunc.h:940
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3406
String * val_str(String *) override
Convert given hex string to a binary string.
Definition: item_strfunc.cc:3419
String tmp_value
Definition: item_strfunc.h:937
const char * func_name() const override
Definition: item_strfunc.h:944
Definition: item_strfunc.h:469
Item_func_upper(const POS &pos, Item *item)
Definition: item_strfunc.h:471
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1487
const char * func_name() const override
Definition: item_strfunc.h:472
Definition: item_strfunc.h:665
Item_func_user(const POS &pos)
Definition: item_strfunc.h:678
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:682
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:706
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:2079
String * val_str(String *) override
Definition: item_strfunc.cc:1997
Item_func_sysconst super
Definition: item_strfunc.h:666
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.h:700
Item_func_user()
Definition: item_strfunc.h:677
const char * func_name() const override
Definition: item_strfunc.h:705
bool evaluate(const char *user, const char *host)
Evaluate user name, must be called once per execution.
Definition: item_strfunc.cc:2056
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:1992
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:696
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:688
bool m_evaluated
True when function value is evaluated, set to false after each execution.
Definition: item_strfunc.h:670
Definition: item_strfunc.h:872
String * val_str(String *) override
Definition: item_strfunc.cc:2844
Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:879
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2835
uchar m_bin_buf[mysql::gtid::Uuid::BYTE_LENGTH]
Buffer to store the binary result.
Definition: item_strfunc.h:874
Item_func_uuid_to_bin(const POS &pos, Item *arg1)
Definition: item_strfunc.h:877
const char * func_name() const override
Definition: item_strfunc.h:883
Definition: item_strfunc.h:1319
Item_func_uuid(const POS &pos)
Definition: item_strfunc.h:1324
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:1333
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:1327
String * val_str(String *) override
Definition: item_strfunc.cc:4444
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:4329
const char * func_name() const override
Definition: item_strfunc.h:1331
Item_func_uuid()
Definition: item_strfunc.h:1323
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4322
Item_str_func super
Definition: item_strfunc.h:1320
Definition: item_strfunc.h:1206
String * val_str(String *) override
Definition: item_strfunc.cc:3276
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3232
const char * func_name() const override
Definition: item_strfunc.h:1228
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3220
const uint num_codepoints
Definition: item_strfunc.h:1216
String tmp_value
Definition: item_strfunc.h:1209
Item_str_func super
Definition: item_strfunc.h:1207
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3209
Item_field * m_field_ref
Definition: item_strfunc.h:1212
const uint result_length
Definition: item_strfunc.h:1211
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3267
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:1217
const bool as_binary
Definition: item_strfunc.h:1213
uint flags
Definition: item_strfunc.h:1210
Definition: item_func.h:100
Item ** args
Array of pointers to arguments.
Definition: item_func.h:107
bool reject_vector_args()
Definition: item_func.cc:1596
Functype
Definition: item_func.h:209
@ COLLATE_FUNC
Definition: item_func.h:256
@ DD_INTERNAL_FUNC
Definition: item_func.h:266
@ TYPECAST_FUNC
Definition: item_func.h:258
virtual const char * func_name() const =0
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:528
uint arg_count
How many arguments in 'args'.
Definition: item_func.h:130
bool null_on_null
Affects how to determine that NULL argument implies a NULL function return.
Definition: item_func.h:186
Definition: item_func.h:1020
Definition: item_strfunc.h:1073
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3669
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1087
String tmp_value
Definition: item_strfunc.h:1076
Item_str_func super
Definition: item_strfunc.h:1074
String * val_str(String *) override
Definition: item_strfunc.cc:3677
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:1095
Item_load_file(const POS &pos, Item *a)
Definition: item_strfunc.h:1079
const char * func_name() const override
Definition: item_strfunc.h:1083
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:1084
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item.cc:10772
Definition: item_strfunc.h:150
Item_str_ascii_func(Item *a, Item *b)
Definition: item_strfunc.h:165
Item_str_ascii_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:176
String * val_str_ascii(String *) override=0
Item_str_ascii_func()
Definition: item_strfunc.h:154
Item_str_ascii_func(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:173
String ascii_buf
Definition: item_strfunc.h:151
Item_str_ascii_func(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:168
Item_str_ascii_func(const POS &pos, Item *a)
Definition: item_strfunc.h:161
Item_str_ascii_func(Item *a)
Definition: item_strfunc.h:158
String * val_str(String *str) override
Definition: item_strfunc.h:181
Definition: item_strfunc.h:451
String * val_str(String *) override
Definition: item_strfunc.cc:1443
Item_str_conv(const POS &pos, Item *item)
Definition: item_strfunc.h:458
String tmp_value
Definition: item_strfunc.h:455
uint multiply
Definition: item_strfunc.h:453
my_charset_conv_case converter
Definition: item_strfunc.h:454
Definition: item_strfunc.h:78
Item_str_func()
Definition: item_strfunc.h:82
String * val_str_from_val_str_ascii(String *str, String *str2)
Definition: item_strfunc.cc:150
Item_str_func(Item *a, Item *b)
Definition: item_strfunc.h:90
my_decimal * val_decimal(my_decimal *) override
Definition: item_strfunc.cc:182
String * push_packet_overflow_warning(THD *thd, const char *func)
Calls push_warning_printf for packet overflow.
Definition: item_strfunc.cc:1536
Item_str_func(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:114
Item_str_func(mem_root_deque< Item * > *list)
Definition: item_strfunc.h:112
Item_str_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:96
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:142
bool get_date(MYSQL_TIME *ltime, my_time_flags_t fuzzydate) override
Definition: item_strfunc.h:120
Item_func super
Definition: item_strfunc.h:79
bool get_time(MYSQL_TIME *ltime) override
Definition: item_strfunc.h:123
Item_str_func(Item *a)
Definition: item_strfunc.h:86
Item_str_func(Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:99
void left_right_max_length(THD *thd)
Definition: item_strfunc.cc:1519
enum Item_result result_type() const override
Definition: item_strfunc.h:126
Item_str_func(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:94
longlong val_int() override
Definition: item_strfunc.h:117
Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e, Item *f)
Definition: item_strfunc.h:109
Item_str_func(const POS &pos, Item *a)
Definition: item_strfunc.h:88
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:129
double val_real() override
Definition: item_strfunc.h:118
Item_str_func(const POS &pos)
Definition: item_strfunc.h:84
Item_str_func(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:92
Item_str_func(Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:104
bool fix_fields(THD *thd, Item **ref) override
Definition: item_strfunc.cc:172
Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:107
Item_str_func(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:101
Definition: item_strfunc.h:1051
const char * func_name() const override
Definition: item_strfunc.h:1068
Item_typecast_char(THD *thd, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1056
Item_typecast_char(const POS &pos, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1061
enum Functype functype() const override
Definition: item_strfunc.h:1066
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3488
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.cc:3501
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3481
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
String str_value
str_values's main purpose is to cache the value in save_in_field
Definition: item.h:3576
void set_nullable(bool nullable)
Definition: item.h:3688
void set_data_type_blob(enum_field_types type, uint32 max_l)
Set the Item to be of BLOB type.
Definition: item.h:1683
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3583
bool get_time_from_string(MYSQL_TIME *ltime)
Convert val_str() to time in MYSQL_TIME.
Definition: item.cc:1648
virtual Item_field * field_for_view_update()
Definition: item.h:3185
bool fixed
True if item has been resolved.
Definition: item.h:3676
bool null_value
True if item is null.
Definition: item.h:3713
bool unsigned_flag
Definition: item.h:3714
longlong val_int_from_string()
Definition: item.cc:526
bool get_date_from_string(MYSQL_TIME *ltime, my_time_flags_t flags)
Convert val_str() to date in MYSQL_TIME.
Definition: item.cc:1561
void set_data_type_string(uint32 max_l)
Set the Item to be variable length string.
Definition: item.h:1600
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:1410
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:3601
double val_real_from_string()
Definition: item.cc:472
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:367
bool add_alias(std::string_view key, Json_dom *value)
Insert the value into the object.
Definition: json_dom.h:409
Definition: sql_list.h:494
Definition: sql_locale.h:37
Storage for name strings.
Definition: item.h:298
Wrapper class for an Item list head, used to allocate Item lists in the parser in a context-independe...
Definition: parse_tree_helpers.h:105
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:231
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
void mem_free()
Definition: sql_string.h:400
void mark_as_const()
Definition: sql_string.h:247
bool copy()
Definition: sql_string.cc:198
void set(String &str, size_t offset, size_t arg_length)
Definition: sql_string.h:302
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
my_decimal class limits 'decimal_t' type to what we need in MySQL.
Definition: my_decimal.h:96
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:31
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:64
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:86
static const std::string dec("DECRYPTION")
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
#define NAME_STRING(x)
Definition: item.h:358
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:5149
String * mysql_generate_uuid(String *str)
Generate Universal Unique Identifier (UUID).
Definition: item_strfunc.cc:4337
A better implementation of the UNIX ctype(3) library.
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:500
size_t(* my_charset_conv_case)(const CHARSET_INFO *, char *, size_t, char *, size_t)
Definition: m_ctype.h:336
static constexpr uint32_t MY_CS_UNICODE
Definition: m_ctype.h:130
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_utf8mb4_0900_bin
Definition: ctype-uca.cc:11481
static constexpr uint32_t MY_REPERTOIRE_ASCII
Definition: m_ctype.h:152
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1562
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:907
#define USERNAME_LENGTH
Definition: mysql_com.h:69
#define NAME_CHAR_LEN
Field/table name length.
Definition: mysql_com.h:60
#define USERNAME_CHAR_LENGTH
Definition: mysql_com.h:64
Time declarations shared between the server and client API: you should not add anything to this heade...
char * user
Definition: mysqladmin.cc:67
const char * host
Definition: mysqladmin.cc:66
static bool replace
Definition: mysqlimport.cc:70
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1117
Definition: commit_order_queue.h:34
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
Container::const_iterator find(const Container &c, Value &&value)
Definition: generic.h:39
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2880
type_conversion_status
Status when storing a value in a field or converting from one datatype to another.
Definition: field.h:204
@ VGS_CHECK_CONSTRAINT
Definition: field.h:478
@ VGS_GENERATED_COLUMN
Definition: field.h:476
@ DERIVATION_COERCIBLE
Definition: field.h:184
@ DERIVATION_SYSCONST
Definition: field.h:185
File containing constants that can be used throughout the server.
constexpr const table_map RAND_TABLE_BIT
Definition: sql_const.h:113
constexpr const table_map INNER_TABLE_BIT
Definition: sql_const.h:111
Our own string classes, used pervasively throughout the executor.
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
const char * csname
Definition: m_ctype.h:426
unsigned state
Definition: m_ctype.h:425
Struct used to pass around arguments to/from check_function_as_value_generator.
Definition: item.h:488
const char * banned_function_name
the name of the function which is not allowed
Definition: item.h:502
Value_generator_source source
Definition: item.h:500
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35
char * str
Definition: mysql_lex_string.h:36
size_t length
Definition: mysql_lex_string.h:37
Definition: mysql_time.h:82
Bison "location" class.
Definition: parse_location.h:43
Instances of Name_resolution_context store the information necessary for name resolution of Items and...
Definition: item.h:415
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:421
static const size_t TEXT_LENGTH
The number of bytes in the textual representation of a Uuid.
Definition: uuid.h:168
static constexpr std::size_t BYTE_LENGTH
The number of bytes in the data of a Uuid.
Definition: uuid.h:143
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