MySQL 9.5.0
Source Code Documentation
item_strfunc.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24/* This file defines all string functions */
25#ifndef ITEM_STRFUNC_INCLUDED
26#define ITEM_STRFUNC_INCLUDED
27
28#include <assert.h>
29#include <sys/types.h>
30
31#include <cstdint> // uint32_t
32
33#include "lex_string.h"
34#include "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 val_date(Date_val *date, my_time_flags_t flags) override {
121 return get_date_from_string(date, flags);
122 }
123 bool val_time(Time_val *time) override { return get_time_from_string(time); }
126 }
127 enum Item_result result_type() const override { return STRING_RESULT; }
128 void left_right_max_length(THD *thd);
129 bool fix_fields(THD *thd, Item **ref) override;
130 bool resolve_type(THD *thd) override {
131 if (param_type_is_default(thd, 0, -1)) return true;
132 return false;
133 }
135
136 protected:
137 /**
138 Calls push_warning_printf for packet overflow.
139 @return error_str().
140 */
141 String *push_packet_overflow_warning(THD *thd, const char *func);
142
143 void add_json_info(Json_object *obj) override {
144 obj->add_alias("func_name", create_dom_ptr<Json_string>(func_name()));
145 }
146};
147
148/*
149 Functions that return values with ASCII repertoire
150*/
153
154 public:
157 }
158
161 }
162 Item_str_ascii_func(const POS &pos, Item *a) : Item_str_func(pos, a) {
164 }
165
168 }
169 Item_str_ascii_func(const POS &pos, Item *a, Item *b)
170 : Item_str_func(pos, a, b) {
172 }
173
176 }
177 Item_str_ascii_func(const POS &pos, Item *a, Item *b, Item *c)
178 : Item_str_func(pos, a, b, c) {
180 }
181
182 String *val_str(String *str) override {
184 }
185 String *val_str_ascii(String *) override = 0;
186};
187
188class Item_func_md5 final : public Item_str_ascii_func {
190
191 public:
192 Item_func_md5(const POS &pos, Item *a);
193 String *val_str_ascii(String *) override;
194 bool resolve_type(THD *thd) override;
195 const char *func_name() const override { return "md5"; }
196};
197
199 public:
200 Item_func_sha(const POS &pos, Item *a);
201 String *val_str_ascii(String *) override;
202 bool resolve_type(THD *thd) override;
203 const char *func_name() const override { return "sha"; }
204};
205
207 public:
208 Item_func_sha2(const POS &pos, Item *a, Item *b)
209 : Item_str_ascii_func(pos, a, b) {}
210 String *val_str_ascii(String *) override;
211 bool resolve_type(THD *thd) override;
212 const char *func_name() const override { return "sha2"; }
213};
214
217
218 public:
219 Item_func_to_base64(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
221 String *val_str_ascii(String *) override;
222 bool resolve_type(THD *) override;
223 const char *func_name() const override { return "to_base64"; }
224};
225
227 public:
228 Item_func_statement_digest(const POS &pos, Item *query_string)
229 : Item_str_ascii_func(pos, query_string) {}
230
231 const char *func_name() const override { return "statement_digest"; }
232 bool check_function_as_value_generator(uchar *checker_args) override {
234 pointer_cast<Check_function_as_value_generator_parameters *>(
235 checker_args);
236 func_arg->banned_function_name = func_name();
237 return (func_arg->source == VGS_GENERATED_COLUMN);
238 }
239
240 bool resolve_type(THD *thd) override;
241
242 String *val_str_ascii(String *) override;
243
244 private:
246};
247
249 public:
250 Item_func_statement_digest_text(const POS &pos, Item *query_string)
251 : Item_str_func(pos, query_string) {}
252
253 const char *func_name() const override { return "statement_digest_text"; }
254
255 /**
256 The type is always LONGTEXT, just like the digest_text columns in
257 Performance Schema
258 */
259 bool resolve_type(THD *thd) override;
260
261 bool check_function_as_value_generator(uchar *checker_args) override {
263 pointer_cast<Check_function_as_value_generator_parameters *>(
264 checker_args);
265 func_arg->banned_function_name = func_name();
266 return (func_arg->source == VGS_GENERATED_COLUMN);
267 }
268 String *val_str(String *) override;
269
270 private:
272};
273
276
277 public:
278 Item_func_from_base64(const POS &pos, Item *a) : Item_str_func(pos, a) {}
279 String *val_str(String *) override;
280 bool resolve_type(THD *thd) override;
281 const char *func_name() const override { return "from_base64"; }
282};
283
287 EVP_CIPHER_CTX *ctx{nullptr};
288#if OPENSSL_VERSION_NUMBER < 0x10100000L
289 EVP_CIPHER_CTX stack_ctx;
290#endif
291
292 public:
293 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b)
294 : Item_str_func(pos, a, b) {
296 }
297 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c)
298 : Item_str_func(pos, a, b, c) {
300 }
301 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
302 : Item_str_func(pos, a, b, c, d) {
304 }
305 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
306 Item *e)
307 : Item_str_func(pos, a, b, c, d, e) {
309 }
310 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
311 Item *e, Item *f)
312 : Item_str_func(pos, a, b, c, d, e, f) {
314 }
316
317 void create_op_context();
318 void destroy_op_context();
319 bool do_itemize(Parse_context *pc, Item **res) override;
320 String *val_str(String *) override;
321 bool resolve_type(THD *) override;
322 const char *func_name() const override { return "aes_encrypt"; }
323};
324
327 EVP_CIPHER_CTX *ctx{nullptr};
328#if OPENSSL_VERSION_NUMBER < 0x10100000L
329 EVP_CIPHER_CTX stack_ctx;
330#endif
331
332 public:
333 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b)
334 : Item_str_func(pos, a, b) {
336 }
337 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c)
338 : Item_str_func(pos, a, b, c) {
340 }
341 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
342 : Item_str_func(pos, a, b, c, d) {
344 }
345 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
346 Item *e)
347 : Item_str_func(pos, a, b, c, d, e) {
349 }
350 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
351 Item *e, Item *f)
352 : Item_str_func(pos, a, b, c, d, e, f) {
354 }
356
357 void create_op_context();
358 void destroy_op_context();
359 bool do_itemize(Parse_context *pc, Item **res) override;
360 String *val_str(String *) override;
361 bool resolve_type(THD *thd) override;
362 const char *func_name() const override { return "aes_decrypt"; }
363};
364
367
368 /** limitation from the SSL library */
370
371 public:
372 Item_func_random_bytes(const POS &pos, Item *a) : Item_str_func(pos, a) {}
373
374 bool do_itemize(Parse_context *pc, Item **res) override;
375 bool resolve_type(THD *thd) override;
376 String *val_str(String *a) override;
377
378 const char *func_name() const override { return "random_bytes"; }
380 return RAND_TABLE_BIT;
381 }
382};
383
385 String tmp_value{"", 0, collation.collation}; // Initialize to empty
386 public:
387 Item_func_concat(const POS &pos, PT_item_list *opt_list)
388 : Item_str_func(pos, opt_list) {}
390 Item_func_concat(const POS &pos, Item *a, Item *b)
391 : Item_str_func(pos, a, b) {}
392
393 String *val_str(String *) override;
394 bool resolve_type(THD *thd) override;
395 const char *func_name() const override { return "concat"; }
396};
397
399 String tmp_value{"", 0, collation.collation}; // Initialize to empty
400 public:
403 null_on_null = false;
404 }
405 Item_func_concat_ws(const POS &pos, PT_item_list *opt_list)
406 : Item_str_func(pos, opt_list) {
407 null_on_null = false;
408 }
409 String *val_str(String *) override;
410 bool resolve_type(THD *thd) override;
411 const char *func_name() const override { return "concat_ws"; }
412};
413
414/**
415 This class represents the function ETAG which is used to traverse the input
416 arguments and compute a 128 bits hash value.
417 */
420
421 public:
422 Item_func_etag(const POS &pos, PT_item_list *opt_list)
423 : Item_str_func(pos, opt_list) {}
425
426 String *val_str(String *) override;
427 bool resolve_type(THD *thd) override;
428 const char *func_name() const override { return "etag"; }
429 bool check_function_as_value_generator(uchar *checker_args) override {
431 pointer_cast<Check_function_as_value_generator_parameters *>(
432 checker_args);
433 func_arg->banned_function_name = func_name();
434 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
435 (func_arg->source == VGS_CHECK_CONSTRAINT));
436 }
437};
438
441
442 public:
444 Item_func_reverse(const POS &pos, Item *a) : Item_str_func(pos, a) {}
445
446 String *val_str(String *) override;
447 bool resolve_type(THD *thd) override;
448 const char *func_name() const override { return "reverse"; }
449};
450
453 /// Holds result in case we need to allocate our own result buffer.
455
456 public:
458 : Item_str_func(pos, org, find, replace) {}
459 String *val_str(String *) override;
460 bool resolve_type(THD *thd) override;
461 const char *func_name() const override { return "replace"; }
462};
463
466 /// Holds result in case we need to allocate our own result buffer.
468
469 public:
471 Item *new_str)
472 : Item_str_func(pos, org, start, length, new_str) {}
473 String *val_str(String *) override;
474 bool resolve_type(THD *thd) override;
475 const char *func_name() const override { return "insert"; }
476};
477
479 protected:
483
484 public:
485 Item_str_conv(const POS &pos, Item *item) : Item_str_func(pos, item) {}
486 String *val_str(String *) override;
487};
488
490 public:
491 Item_func_lower(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
492 const char *func_name() const override { return "lower"; }
493 bool resolve_type(THD *) override;
494};
495
497 public:
498 Item_func_upper(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
499 const char *func_name() const override { return "upper"; }
500 bool resolve_type(THD *) override;
501};
502
505
506 public:
507 Item_func_left(const POS &pos, Item *a, Item *b) : Item_str_func(pos, a, b) {}
508 String *val_str(String *) override;
509 bool resolve_type(THD *thd) override;
510 const char *func_name() const override { return "left"; }
511};
512
515
516 public:
517 Item_func_right(const POS &pos, Item *a, Item *b)
518 : Item_str_func(pos, a, b) {}
519 String *val_str(String *) override;
520 bool resolve_type(THD *thd) override;
521 const char *func_name() const override { return "right"; }
522};
523
526
528
529 public:
531 Item_func_substr(const POS &pos, Item *a, Item *b) : super(pos, a, b) {}
532
533 Item_func_substr(Item *a, Item *b, Item *c) : Item_str_func(a, b, c) {}
534 Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
535 : super(pos, a, b, c) {}
536
537 String *val_str(String *) override;
538 bool resolve_type(THD *thd) override;
539 const char *func_name() const override { return "substr"; }
540};
541
544
545 public:
546 Item_func_substr_index(const POS &pos, Item *a, Item *b, Item *c)
547 : Item_str_func(pos, a, b, c) {}
548 String *val_str(String *) override;
549 bool resolve_type(THD *) override;
550 const char *func_name() const override { return "substring_index"; }
551};
552
554 public:
555 /**
556 Why all the trim modes in this enum?
557 We need to maintain parsing information, so that our print() function
558 can reproduce correct messages and view definitions.
559 */
567 };
568
569 private:
573 const bool m_trim_leading;
574 const bool m_trim_trailing;
575
576 public:
578 : Item_str_func(a, b),
579 m_trim_mode(tm),
582
583 Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
584 : Item_str_func(pos, a, b),
585 m_trim_mode(tm),
588
590 : Item_str_func(a),
591 m_trim_mode(tm),
594
595 Item_func_trim(const POS &pos, Item *a, TRIM_MODE tm)
596 : Item_str_func(pos, a),
597 m_trim_mode(tm),
600
601 bool trim_leading() const {
604 }
605
606 bool trim_trailing() const {
609 }
610
611 String *val_str(String *) override;
612 bool resolve_type(THD *) override;
613 const char *func_name() const override {
614 switch (m_trim_mode) {
616 return "trim";
617 case TRIM_BOTH:
618 return "trim";
619 case TRIM_LEADING:
620 return "ltrim";
621 case TRIM_TRAILING:
622 return "rtrim";
623 case TRIM_LTRIM:
624 return "ltrim";
625 case TRIM_RTRIM:
626 return "rtrim";
627 }
628 return nullptr;
629 }
630 void print(const THD *thd, String *str,
631 enum_query_type query_type) const override;
632};
633
634class Item_func_ltrim final : public Item_func_trim {
635 public:
636 Item_func_ltrim(const POS &pos, Item *a)
637 : Item_func_trim(pos, a, TRIM_LTRIM) {}
638};
639
640class Item_func_rtrim final : public Item_func_trim {
641 public:
642 Item_func_rtrim(const POS &pos, Item *a)
643 : Item_func_trim(pos, a, TRIM_RTRIM) {}
644};
645
648
649 public:
652 }
653 explicit Item_func_sysconst(const POS &pos) : super(pos) {
655 }
656 /*
657 Used to create correct Item name in new converted item in
658 safe_charset_converter, return string representation of this function
659 call
660 */
661 virtual const Name_string fully_qualified_func_name() const = 0;
662 bool check_function_as_value_generator(uchar *checker_args) override {
664 pointer_cast<Check_function_as_value_generator_parameters *>(
665 checker_args);
666 func_arg->banned_function_name = func_name();
667 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
668 (func_arg->source == VGS_CHECK_CONSTRAINT));
669 }
670};
671
674
675 public:
676 explicit Item_func_database(const POS &pos) : Item_func_sysconst(pos) {}
677
678 bool do_itemize(Parse_context *pc, Item **res) override;
679
680 String *val_str(String *) override;
681 bool resolve_type(THD *) override {
683 set_nullable(true);
684 return false;
685 }
686 const char *func_name() const override { return "database"; }
687 const Name_string fully_qualified_func_name() const override {
688 return NAME_STRING("database()");
689 }
690};
691
694
695 protected:
696 /// True when function value is evaluated, set to false after each execution
697 bool m_evaluated = false;
698
699 /// Evaluate user name, must be called once per execution
700 bool evaluate(const char *user, const char *host);
701 type_conversion_status save_in_field_inner(Field *field, bool) override;
702
703 public:
705 explicit Item_func_user(const POS &pos) : super(pos) {
707 }
708
710 return INNER_TABLE_BIT;
711 }
712
713 bool do_itemize(Parse_context *pc, Item **res) override;
714
715 bool check_function_as_value_generator(uchar *checker_args) override {
717 pointer_cast<Check_function_as_value_generator_parameters *>(
718 checker_args);
719 func_arg->banned_function_name = func_name();
720 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
721 (func_arg->source == VGS_CHECK_CONSTRAINT));
722 }
723 bool resolve_type(THD *) override {
725 return false;
726 }
727 void cleanup() override {
728 m_evaluated = false;
731 }
732 const char *func_name() const override { return "user"; }
733 const Name_string fully_qualified_func_name() const override {
734 return NAME_STRING("user()");
735 }
736
737 String *val_str(String *) override;
738};
739
742 /**
743 Used to pass a security context to the resolver functions.
744 Only used for definer views. In all other contexts, the security context
745 passed here is nullptr and is instead looked up dynamically at run time
746 from the current THD.
747 */
749
750 /// Copied from m_name_resolution_ctx in fix_fields if the definer
751 /// Security_context is set in Name_resolution_context
754
755 protected:
756 type_conversion_status save_in_field_inner(Field *field, bool) override;
757
758 /// Overridden to copy definer priv_user and priv_host
759 bool resolve_type(THD *) override;
760
761 public:
762 explicit Item_func_current_user(const POS &pos) : super(pos) {}
763
764 bool do_itemize(Parse_context *pc, Item **res) override;
765 const char *func_name() const override { return "current_user"; }
766 const Name_string fully_qualified_func_name() const override {
767 return NAME_STRING("current_user()");
768 }
769
770 String *val_str(String *) override;
771};
772
775
776 public:
778 Item_func_soundex(const POS &pos, Item *a) : Item_str_func(pos, a) {}
779 String *val_str(String *) override;
780 bool resolve_type(THD *thd) override;
781 const char *func_name() const override { return "soundex"; }
782};
783
784class Item_func_elt final : public Item_str_func {
785 public:
786 Item_func_elt(const POS &pos, PT_item_list *opt_list)
787 : Item_str_func(pos, opt_list) {}
788 double val_real() override;
789 longlong val_int() override;
790 String *val_str(String *str) override;
791 bool resolve_type(THD *thd) override;
792 const char *func_name() const override { return "elt"; }
793};
794
795class Item_func_make_set final : public Item_str_func {
797
799
800 public:
801 Item_func_make_set(const POS &pos, PT_item_list *opt_list)
802 : Item_str_func(pos, opt_list) {}
803
804 String *val_str(String *str) override;
805 bool fix_fields(THD *thd, Item **ref) override;
806 bool resolve_type(THD *) override;
807 const char *func_name() const override { return "make_set"; }
808
809 void print(const THD *thd, String *str,
810 enum_query_type query_type) const override;
811};
812
816
817 public:
818 Item_func_format(const POS &pos, Item *org, Item *dec)
819 : Item_str_ascii_func(pos, org, dec) {}
820 Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
821 : Item_str_ascii_func(pos, org, dec, lang) {}
822
823 MY_LOCALE *get_locale(Item *item);
824 String *val_str_ascii(String *) override;
825 bool resolve_type(THD *thd) override;
826 const char *func_name() const override { return "format"; }
827 void print(const THD *thd, String *str,
828 enum_query_type query_type) const override;
829};
830
831class Item_func_char final : public Item_str_func {
832 public:
834 : Item_str_func(pos, list) {
836 null_on_null = false;
837 }
839 : Item_str_func(pos, list) {
841 null_on_null = false;
842 }
843 String *val_str(String *) override;
844 bool resolve_type(THD *thd) override {
845 if (param_type_is_default(thd, 0, -1, MYSQL_TYPE_LONGLONG)) return true;
846 if (reject_vector_args()) return true;
848 return false;
849 }
850 const char *func_name() const override { return "char"; }
851 void add_json_info(Json_object *obj) override {
853 obj->add_alias("charset",
854 create_dom_ptr<Json_string>(collation.collation->csname));
855 }
856};
857
858class Item_func_repeat final : public Item_str_func {
860
861 public:
862 Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
863 : Item_str_func(pos, arg1, arg2) {}
864 String *val_str(String *) override;
865 bool resolve_type(THD *thd) override;
866 const char *func_name() const override { return "repeat"; }
867};
868
869class Item_func_space final : public Item_str_func {
870 public:
871 Item_func_space(const POS &pos, Item *arg1) : Item_str_func(pos, arg1) {}
872 String *val_str(String *) override;
873 bool resolve_type(THD *) override;
874 const char *func_name() const override { return "space"; }
875};
876
877class Item_func_rpad final : public Item_str_func {
879
880 public:
881 Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
882 : Item_str_func(pos, arg1, arg2, arg3) {}
883 String *val_str(String *) override;
884 bool resolve_type(THD *) override;
885 const char *func_name() const override { return "rpad"; }
886};
887
888class Item_func_lpad final : public Item_str_func {
890
891 public:
892 Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
893 : Item_str_func(pos, arg1, arg2, arg3) {}
894 String *val_str(String *) override;
895 bool resolve_type(THD *) override;
896 const char *func_name() const override { return "lpad"; }
897};
898
900 /// Buffer to store the binary result
902
903 public:
904 Item_func_uuid_to_bin(const POS &pos, Item *arg1)
905 : Item_str_func(pos, arg1) {}
906 Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
907 : Item_str_func(pos, arg1, arg2) {}
908 String *val_str(String *) override;
909 bool resolve_type(THD *) override;
910 const char *func_name() const override { return "uuid_to_bin"; }
911};
912
914 /// Buffer to store the text result
916
917 public:
918 Item_func_bin_to_uuid(const POS &pos, Item *arg1)
919 : Item_str_ascii_func(pos, arg1) {}
920 Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
921 : Item_str_ascii_func(pos, arg1, arg2) {}
922 String *val_str_ascii(String *) override;
923 bool resolve_type(THD *thd) override;
924 const char *func_name() const override { return "bin_to_uuid"; }
925};
926
927class Item_func_is_uuid final : public Item_bool_func {
929
930 public:
931 Item_func_is_uuid(const POS &pos, Item *a) : Item_bool_func(pos, a) {}
932 longlong val_int() override;
933 const char *func_name() const override { return "is_uuid"; }
934 bool resolve_type(THD *thd) override {
935 if (reject_vector_args()) return true;
936 bool res = super::resolve_type(thd);
937 set_nullable(true);
938 return res;
939 }
940};
941
942class Item_func_conv final : public Item_str_func {
943 public:
944 // 64 digits plus possible '-'.
945 static constexpr uint32_t CONV_MAX_LENGTH = 64U + 1U;
946 Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
947 : Item_str_func(pos, a, b, c) {}
948 const char *func_name() const override { return "conv"; }
949 String *val_str(String *) override;
950 bool resolve_type(THD *) override;
951};
952
955
956 public:
957 Item_func_hex(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
958 const char *func_name() const override { return "hex"; }
959 String *val_str_ascii(String *) override;
960 bool resolve_type(THD *thd) override;
961};
962
963class Item_func_unhex final : public Item_str_func {
965
966 public:
967 Item_func_unhex(const POS &pos, Item *a) : Item_str_func(pos, a) {
968 /* there can be bad hex strings */
969 set_nullable(true);
970 }
971 const char *func_name() const override { return "unhex"; }
972 String *val_str(String *) override;
973 bool resolve_type(THD *thd) override;
974};
975
976#ifndef NDEBUG
978 protected:
981 const bool is_min;
982
983 public:
984 Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
985 : Item_str_func(pos, a, b), is_min(is_min_arg) {
986 set_nullable(true);
987 }
988 String *val_str(String *) override;
989 bool resolve_type(THD *thd) override {
990 if (param_type_is_default(thd, 0, 1)) return true;
991 if (param_type_is_default(thd, 1, 2, MYSQL_TYPE_LONGLONG)) return true;
992 if (reject_vector_args()) return true;
994 return false;
995 }
996};
997
999 public:
1001 : Item_func_like_range(pos, a, b, true) {}
1002 const char *func_name() const override { return "like_range_min"; }
1003};
1004
1006 public:
1008 : Item_func_like_range(pos, a, b, false) {}
1009 const char *func_name() const override { return "like_range_max"; }
1010};
1011#endif
1012
1013/**
1014 The following types of conversions are considered safe:
1015
1016 Conversion to and from "binary".
1017 Conversion to Unicode.
1018 Other kind of conversions are potentially lossy.
1019*/
1021 protected:
1022 /// If true, conversion is needed so do it, else allow string copy.
1024 /// The character set we are converting to
1026 /// The character set we are converting from
1027 const CHARSET_INFO *m_from_cs{nullptr};
1029 /// Marks whether the underlying Item is constant and may be cached.
1031 /// Length argument value, if any given.
1032 longlong m_cast_length{-1}; // a priori not used
1033 public:
1035
1036 protected:
1037 /**
1038 Helper for CAST and CONVERT type resolution: common logic to compute the
1039 maximum numbers of characters of the type of the conversion.
1040
1041 @returns the maximum numbers of characters possible after the conversion
1042 */
1044
1045 bool resolve_type(THD *thd) override;
1046
1047 void add_json_info(Json_object *obj) override {
1049 obj->add_alias("charset", create_dom_ptr<Json_string>(m_cast_cs->csname));
1050 }
1051
1052 public:
1054 bool cache_if_const)
1055 : Item_str_func(a), m_cast_cs(cs_arg) {
1056 if (cache_if_const && args[0]->may_evaluate_const(thd)) {
1057 uint errors = 0;
1058 String tmp, *str = args[0]->val_str(&tmp);
1059 if (!str || str_value.copy(str->ptr(), str->length(), str->charset(),
1060 m_cast_cs, &errors))
1061 null_value = true;
1062 m_use_cached_value = true;
1064 m_safe = (errors == 0);
1065 } else {
1066 m_use_cached_value = false;
1067 // Marks whether the conversion is safe
1069 cs_arg == &my_charset_bin || (cs_arg->state & MY_CS_UNICODE));
1070 }
1071 }
1072 Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
1073 : Item_str_func(pos, a), m_cast_cs(cs_arg) {}
1074
1075 String *val_str(String *) override;
1076};
1077
1079 protected:
1080 void add_json_info(Json_object *obj) override;
1081
1082 public:
1083 Item_typecast_char(THD *thd, Item *a, longlong length_arg,
1084 const CHARSET_INFO *cs_arg)
1085 : Item_charset_conversion(thd, a, cs_arg, false) {
1086 m_cast_length = length_arg;
1087 }
1088 Item_typecast_char(const POS &pos, Item *a, longlong length_arg,
1089 const CHARSET_INFO *cs_arg)
1090 : Item_charset_conversion(pos, a, cs_arg) {
1091 m_cast_length = length_arg;
1092 }
1093 enum Functype functype() const override { return TYPECAST_FUNC; }
1094 bool eq_specific(const Item *item) const override;
1095 const char *func_name() const override { return "cast_as_char"; }
1096 void print(const THD *thd, String *str,
1097 enum_query_type query_type) const override;
1098};
1099
1100class Item_load_file final : public Item_str_func {
1102
1104
1105 public:
1106 Item_load_file(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1107
1108 bool do_itemize(Parse_context *pc, Item **res) override;
1109 String *val_str(String *) override;
1110 const char *func_name() const override { return "load_file"; }
1112 return INNER_TABLE_BIT;
1113 }
1114 bool resolve_type(THD *thd) override {
1115 if (param_type_is_default(thd, 0, 1)) return true;
1116 if (reject_vector_args()) return true;
1119 set_nullable(true);
1120 return false;
1121 }
1122 bool check_function_as_value_generator(uchar *checker_args) override {
1124 pointer_cast<Check_function_as_value_generator_parameters *>(
1125 checker_args);
1126 func_arg->banned_function_name = func_name();
1127 return true;
1128 }
1129};
1130
1132 public:
1133 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
1134 : Item_str_func(pos, a, b, c) {}
1135 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
1136 : Item_str_func(pos, a, b, c, d) {}
1137 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d,
1138 Item *e)
1139 : Item_str_func(pos, a, b, c, d, e) {}
1140 String *val_str(String *str) override;
1141 bool resolve_type(THD *) override;
1142 const char *func_name() const override { return "export_set"; }
1143};
1144
1147
1148 public:
1149 Item_func_quote(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1150 const char *func_name() const override { return "quote"; }
1151 String *val_str(String *) override;
1152 bool resolve_type(THD *thd) override;
1153};
1154
1156 public:
1158 : Item_charset_conversion(pos, a, cs) {
1159 m_safe = false;
1160 }
1161
1163 bool cache_if_const)
1164 : Item_charset_conversion(thd, a, cs, cache_if_const) {
1165 assert(args[0]->fixed);
1166 }
1167 const char *func_name() const override { return "convert"; }
1168 void print(const THD *thd, String *str,
1169 enum_query_type query_type) const override;
1170 bool eq_specific(const Item *item) const override;
1171};
1172
1175
1177
1178 public:
1180 const LEX_CSTRING &collation_string_arg)
1181 : super(pos, a, nullptr), collation_string(collation_string_arg) {}
1182
1183 bool do_itemize(Parse_context *pc, Item **res) override;
1184 String *val_str(String *) override;
1185 bool resolve_type(THD *) override;
1186 bool eq(const Item *item) const override;
1187 const char *func_name() const override { return "collate"; }
1188 enum Functype functype() const override { return COLLATE_FUNC; }
1189 void print(const THD *thd, String *str,
1190 enum_query_type query_type) const override;
1192 /* this function is transparent for view updating */
1193 return args[0]->field_for_view_update();
1194 }
1195
1196 protected:
1197 void add_json_info(Json_object *obj) override {
1198 obj->add_alias("collation",
1199 create_dom_ptr<Json_string>(collation_string.str,
1201 }
1202};
1203
1204class Item_func_charset final : public Item_str_func {
1205 public:
1206 Item_func_charset(const POS &pos, Item *a) : Item_str_func(pos, a) {
1207 null_on_null = false;
1208 }
1209 String *val_str(String *) override;
1210 const char *func_name() const override { return "charset"; }
1211 bool resolve_type(THD *thd) override {
1213 set_nullable(false);
1214 return Item_str_func::resolve_type(thd);
1215 }
1216};
1217
1219 public:
1220 Item_func_collation(const POS &pos, Item *a) : Item_str_func(pos, a) {
1221 null_on_null = false;
1222 }
1223 String *val_str(String *) override;
1224 const char *func_name() const override { return "collation"; }
1225 bool resolve_type(THD *thd) override {
1226 if (Item_str_func::resolve_type(thd)) return true;
1228 set_nullable(false);
1229 return false;
1230 }
1231};
1232
1235
1237 uint flags;
1238 const uint result_length;
1240 const bool as_binary;
1241
1242 public:
1243 const uint num_codepoints;
1244 Item_func_weight_string(const POS &pos, Item *a, uint result_length_arg,
1245 uint num_codepoints_arg, uint flags_arg,
1246 bool as_binary_arg = false)
1247 : Item_str_func(pos, a),
1248 flags(flags_arg),
1249 result_length(result_length_arg),
1250 as_binary(as_binary_arg),
1251 num_codepoints(num_codepoints_arg) {}
1252
1253 bool do_itemize(Parse_context *pc, Item **res) override;
1254
1255 const char *func_name() const override { return "weight_string"; }
1256 bool eq_specific(const Item *item) const override;
1257 String *val_str(String *) override;
1258 bool resolve_type(THD *) override;
1259 void print(const THD *thd, String *str,
1260 enum_query_type query_type) const override;
1261};
1262
1263class Item_func_crc32 final : public Item_int_func {
1265
1266 public:
1267 Item_func_crc32(const POS &pos, Item *a) : Item_int_func(pos, a) {
1268 unsigned_flag = true;
1269 }
1270 const char *func_name() const override { return "crc32"; }
1271 bool resolve_type(THD *thd) override {
1272 if (param_type_is_default(thd, 0, 1)) return true;
1273 max_length = 10;
1274 return false;
1275 }
1276 longlong val_int() override;
1277};
1278
1281
1282 public:
1284 : Item_int_func(pos, a) {}
1285 const char *func_name() const override { return "uncompressed_length"; }
1286 bool resolve_type(THD *thd) override {
1287 if (param_type_is_default(thd, 0, 1)) return true;
1288 if (reject_vector_args()) return true;
1289 max_length = 10;
1290 return false;
1291 }
1292 longlong val_int() override;
1293};
1294
1295class Item_func_compress final : public Item_str_func {
1297
1298 public:
1299 Item_func_compress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1300 bool resolve_type(THD *thd) override;
1301 const char *func_name() const override { return "compress"; }
1302 String *val_str(String *str) override;
1303};
1304
1307
1308 public:
1309 Item_func_to_vector(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1310 bool resolve_type(THD *thd) override;
1311 const char *func_name() const override { return "to_vector"; }
1312 String *val_str(String *str) override;
1313};
1314
1316 static const uint32 per_value_chars = 16;
1320
1321 public:
1324 : Item_str_ascii_func(pos, a) {}
1325 bool resolve_type(THD *thd) override;
1326 const char *func_name() const override { return "from_vector"; }
1327 String *val_str_ascii(String *str) override;
1328};
1329
1332
1333 public:
1334 Item_func_uncompress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1335 bool resolve_type(THD *thd) override {
1336 if (reject_vector_args()) return true;
1337 if (Item_str_func::resolve_type(thd)) return true;
1338 set_nullable(true);
1340 return false;
1341 }
1342 const char *func_name() const override { return "uncompress"; }
1343 String *val_str(String *str) override;
1344};
1345
1346class Item_func_uuid final : public Item_str_func {
1348
1349 public:
1351 explicit Item_func_uuid(const POS &pos) : Item_str_func(pos) {}
1352
1353 bool do_itemize(Parse_context *pc, Item **res) override;
1355 return RAND_TABLE_BIT;
1356 }
1357 bool resolve_type(THD *) override;
1358 const char *func_name() const override { return "uuid"; }
1359 String *val_str(String *) override;
1360 bool check_function_as_value_generator(uchar *checker_args) override {
1362 pointer_cast<Check_function_as_value_generator_parameters *>(
1363 checker_args);
1364 func_arg->banned_function_name = func_name();
1365 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
1366 (func_arg->source == VGS_CHECK_CONSTRAINT));
1367 }
1368};
1369
1372
1373 public:
1375 explicit Item_func_current_role(const POS &pos)
1376 : super(pos), value_cache_set(false) {}
1377 const char *func_name() const override { return "current_role"; }
1378 void cleanup() override;
1379 String *val_str(String *) override;
1380 bool resolve_type(THD *) override {
1382 return false;
1383 }
1385 return NAME_STRING("current_role()");
1386 }
1387
1388 protected:
1389 void set_current_role(THD *thd);
1390 /** a flag whether @ref value_cache is set or not */
1392 /**
1393 @brief Cache for the result value
1394
1395 Set by init(). And consumed by val_str().
1396 Needed to avoid re-calculation of the current_roles() in the
1397 course of the query.
1398 */
1400};
1401
1404
1405 public:
1407 explicit Item_func_roles_graphml(const POS &pos)
1408 : super(pos), value_cache_set(false) {}
1409 String *val_str(String *) override;
1410 void cleanup() override;
1411
1412 bool resolve_type(THD *) override {
1414 return false;
1415 }
1416
1417 const char *func_name() const override { return "roles_graphml"; }
1418
1420 return NAME_STRING("roles_graphml()");
1421 }
1422
1423 protected:
1424 bool calculate_graphml(THD *thd);
1425 /**
1426 @brief Cache for the result value
1427
1428 Set by init(). And consumed by val_str().
1429 Needed to avoid re-calculation of the current_roles() in the
1430 course of the query.
1431 */
1433
1434 /** Set to true if @ref value_cache is set */
1436};
1437
1439 public:
1441 : Item_str_func(pos, a, b, c) {}
1442
1443 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1444 bool resolve_type(THD *) override {
1445 /*
1446 There are 14 kinds of grants, with a max length
1447 per privileges is 11 chars.
1448 So, setting max approximate to 200.
1449 */
1451 set_nullable(true);
1452 null_on_null = false;
1453
1454 return false;
1455 }
1456
1457 const char *func_name() const override { return "get_dd_column_privileges"; }
1458
1459 String *val_str(String *) override;
1460};
1461
1463 public:
1465 : Item_str_func(pos, a, b, c) {}
1466
1467 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1468 bool resolve_type(THD *) override {
1469 // maximum string length of all options is expected
1470 // to be less than 256 characters.
1472 set_nullable(false);
1473 null_on_null = false;
1474
1475 return false;
1476 }
1477
1478 const char *func_name() const override { return "get_dd_create_options"; }
1479
1480 String *val_str(String *) override;
1481};
1482
1484 public:
1486 : Item_str_func(pos, a) {}
1487
1488 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1489 bool resolve_type(THD *) override {
1490 // maximum string length of all options is expected
1491 // to be less than 256 characters.
1493 set_nullable(false);
1494 null_on_null = false;
1495
1496 return false;
1497 }
1498
1499 const char *func_name() const override { return "get_dd_schema_options"; }
1500
1501 String *val_str(String *) override;
1502};
1503
1505 public:
1507 : Item_str_func(pos, list) {}
1508
1509 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1510 bool resolve_type(THD *) override {
1511 /*
1512 maximum expected string length to be less than 2048 characters,
1513 which is same as size of column holding comments in dictionary,
1514 i.e., the mysql.tables.comment DD column.
1515 */
1517 set_nullable(true);
1518 null_on_null = false;
1519
1520 return false;
1521 }
1522
1523 const char *func_name() const override {
1524 return "internal_get_comment_or_error";
1525 }
1526
1527 String *val_str(String *) override;
1528};
1529
1531 public:
1533 : Item_str_func(pos, a, b) {}
1534
1535 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1536 bool resolve_type(THD *) override {
1537 /* maximum string length of the property value is expected
1538 to be less than 256 characters. */
1540 set_nullable(false);
1541 null_on_null = false;
1542
1543 return false;
1544 }
1545
1546 const char *func_name() const override {
1547 return "get_dd_tablespace_private_data";
1548 }
1549
1550 String *val_str(String *) override;
1551};
1552
1554 public:
1556 : Item_str_func(pos, a, b) {}
1557
1558 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1559 bool resolve_type(THD *) override {
1560 /* maximum string length of the property value is expected
1561 to be less than 256 characters. */
1563 set_nullable(false);
1564 null_on_null = false;
1565
1566 return false;
1567 }
1568
1569 const char *func_name() const override { return "get_dd_index_private_data"; }
1570
1571 String *val_str(String *) override;
1572};
1573
1575 public:
1577 : Item_str_func(pos, a) {}
1578
1579 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1580 bool resolve_type(THD *) override {
1581 // maximum string length of all options is expected
1582 // to be less than 256 characters.
1584 set_nullable(true);
1585 null_on_null = false;
1586
1587 return false;
1588 }
1589
1590 const char *func_name() const override {
1591 return "internal_get_partition_nodegroup";
1592 }
1593
1594 String *val_str(String *) override;
1595};
1596
1598 public:
1600 Item *d)
1601 : Item_str_func(pos, a, b, c, d) {}
1602
1603 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1604 bool resolve_type(THD *) override {
1605 // maximum string length of all options is expected
1606 // to be less than 256 characters.
1608 set_nullable(true);
1609 null_on_null = false;
1610
1611 return false;
1612 }
1613
1614 const char *func_name() const override { return "internal_tablespace_type"; }
1615
1616 String *val_str(String *) override;
1617};
1618
1620 public:
1622 Item *b, Item *c, Item *d)
1623 : Item_str_func(pos, a, b, c, d) {}
1624
1625 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1626 bool resolve_type(THD *) override {
1627 // maximum string length of all options is expected
1628 // to be less than 256 characters.
1630 set_nullable(true);
1631 null_on_null = false;
1632
1633 return false;
1634 }
1635
1636 const char *func_name() const override {
1637 return "internal_tablespace_logfile_group_name";
1638 }
1639
1640 String *val_str(String *) override;
1641};
1642
1644 public:
1646 Item *c, Item *d)
1647 : Item_str_func(pos, a, b, c, d) {}
1648
1649 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1650 bool resolve_type(THD *) override {
1651 // maximum string length of all options is expected
1652 // to be less than 256 characters.
1654 set_nullable(true);
1655 null_on_null = false;
1656
1657 return false;
1658 }
1659
1660 const char *func_name() const override {
1661 return "internal_tablespace_status";
1662 }
1663 String *val_str(String *) override;
1664};
1665
1667 public:
1669 Item *c, Item *d)
1670 : Item_str_func(pos, a, b, c, d) {}
1671
1672 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1673 bool resolve_type(THD *) override {
1674 // maximum string length of all options is expected
1675 // to be less than 256 characters.
1677 set_nullable(true);
1678 null_on_null = false;
1679
1680 return false;
1681 }
1682
1683 const char *func_name() const override {
1684 return "internal_tablespace_row_format";
1685 }
1686
1687 String *val_str(String *) override;
1688};
1689
1691 public:
1693 Item *d)
1694 : Item_str_func(pos, a, b, c, d) {}
1695
1696 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1697 bool resolve_type(THD *) override {
1698 // maximum string length of all options is expected
1699 // to be less than 256 characters.
1701 set_nullable(true);
1702 null_on_null = false;
1703
1704 return false;
1705 }
1706
1707 const char *func_name() const override { return "internal_tablespace_extra"; }
1708
1709 String *val_str(String *) override;
1710};
1711
1713 public:
1715 : Item_str_func(pos, list) {}
1716
1717 bool resolve_type(THD *) override {
1718 set_nullable(false);
1720 return false;
1721 }
1722
1723 const char *func_name() const override { return "convert_cpu_id_mask"; }
1724
1725 String *val_str(String *) override;
1726};
1727
1729 public:
1731 : Item_str_func(pos, a, b) {}
1732
1733 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1734 bool resolve_type(THD *) override {
1736 set_nullable(true);
1737 null_on_null = false;
1738
1739 return false;
1740 }
1741
1742 const char *func_name() const override { return "get_dd_property_key_value"; }
1743
1744 String *val_str(String *) override;
1745};
1746
1748 public:
1750 Item *c, Item *d)
1751 : Item_str_func(pos, a, b, c, d) {}
1752
1753 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1754 bool resolve_type(THD *) override {
1756 set_nullable(true);
1757 null_on_null = false;
1758
1759 return false;
1760 }
1761
1762 const char *func_name() const override {
1763 return "get_jdv_property_key_value";
1764 }
1765
1766 String *val_str(String *) override;
1767};
1768
1770 public:
1772 : Item_str_func(pos, a, b) {}
1773
1774 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1775 bool resolve_type(THD *) override {
1777 set_nullable(true);
1778 null_on_null = false;
1779
1780 return false;
1781 }
1782
1783 const char *func_name() const override { return "remove_dd_property_key"; }
1784
1785 String *val_str(String *) override;
1786};
1787
1789 public:
1791 : Item_str_func(pos, a, b) {}
1792
1793 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1794 bool resolve_type(THD *) override {
1795 // maximum string length of all options is expected
1796 // to be less than 256 characters.
1798 set_nullable(true);
1799 null_on_null = false;
1800
1801 return false;
1802 }
1803
1804 const char *func_name() const override {
1805 return "convert_interval_to_user_interval";
1806 }
1807
1808 String *val_str(String *) override;
1809};
1810
1812 public:
1814 : Item_str_func(pos, list) {}
1815
1816 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1817 bool resolve_type(THD *) override {
1819 set_nullable(true);
1820 null_on_null = false;
1821
1822 return false;
1823 }
1824
1825 const char *func_name() const override { return "internal_get_username"; }
1826
1827 String *val_str(String *) override;
1828};
1829
1831 public:
1833 : Item_str_func(pos, list) {}
1834
1835 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1836 bool resolve_type(THD *) override {
1838 set_nullable(true);
1839 null_on_null = false;
1840
1841 return false;
1842 }
1843
1844 const char *func_name() const override { return "internal_get_hostname"; }
1845
1846 String *val_str(String *) override;
1847};
1848
1850 public:
1852 : Item_str_func(pos) {}
1853
1854 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1855 bool resolve_type(THD *) override {
1857 set_nullable(true);
1858 null_on_null = false;
1859
1860 return false;
1861 }
1862
1863 const char *func_name() const override {
1864 return "internal_get_enabled_role_json";
1865 }
1866
1867 String *val_str(String *) override;
1868};
1869
1871 public:
1873 : Item_str_func(pos) {}
1874
1875 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1876 bool resolve_type(THD *) override {
1878 set_nullable(true);
1879 null_on_null = false;
1880
1881 return false;
1882 }
1883
1884 const char *func_name() const override {
1885 return "internal_get_mandatory_roles_json";
1886 }
1887
1888 String *val_str(String *) override;
1889};
1890
1892 public:
1894 : Item_str_func(pos, list) {}
1895
1896 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1897 bool resolve_type(THD *) override {
1898 // maximum string length of all options is expected
1899 // to be less than 256 characters.
1901 set_nullable(false);
1902 null_on_null = false;
1903
1904 return false;
1905 }
1906
1907 const char *func_name() const override {
1908 return "internal_get_dd_column_extra";
1909 }
1910
1911 String *val_str(String *) override;
1912};
1913
1914inline void tohex(char *to, uint64_t from, uint len) {
1915 to += len;
1916 while (len--) {
1917 *--to = dig_vec_lower[from & 15];
1918 from >>= 4;
1919 }
1920}
1921
1922#endif /* ITEM_STRFUNC_INCLUDED */
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:247
void set(const DTCollation &dt)
Definition: item.h:203
void set_repertoire(uint repertoire_arg)
Definition: item.h:229
const CHARSET_INFO * collation
Definition: item.h:185
Definition: my_temporal.h:395
Definition: my_temporal.h:339
static const uint32 max_dimensions
Definition: field.h:3720
Definition: field.h:570
Definition: item_cmpfunc.h:304
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_cmpfunc.h:338
The following types of conversions are considered safe:
Definition: item_strfunc.h:1020
const CHARSET_INFO * m_cast_cs
The character set we are converting to.
Definition: item_strfunc.h:1025
bool m_safe
Definition: item_strfunc.h:1034
bool m_charset_conversion
If true, conversion is needed so do it, else allow string copy.
Definition: item_strfunc.h:1023
const CHARSET_INFO * m_from_cs
The character set we are converting from.
Definition: item_strfunc.h:1027
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3708
Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1072
bool m_use_cached_value
Marks whether the underlying Item is constant and may be cached.
Definition: item_strfunc.h:1030
String * val_str(String *) override
Definition: item_strfunc.cc:3598
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:1047
longlong m_cast_length
Length argument value, if any given.
Definition: item_strfunc.h:1032
String m_tmp_value
Definition: item_strfunc.h:1028
Item_charset_conversion(THD *thd, Item *a, const CHARSET_INFO *cs_arg, bool cache_if_const)
Definition: item_strfunc.h:1053
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:3677
Definition: item.h:4466
Definition: item_strfunc.h:325
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:341
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:345
String * val_str(String *) override
Definition: item_strfunc.cc:708
void destroy_op_context()
Definition: item_strfunc.cc:692
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:698
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:337
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:333
Item_str_func super
Definition: item_strfunc.h:326
EVP_CIPHER_CTX * ctx
Definition: item_strfunc.h:327
const char * func_name() const override
Definition: item_strfunc.h:362
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e, Item *f)
Definition: item_strfunc.h:350
void create_op_context()
Definition: item_strfunc.cc:684
~Item_func_aes_decrypt() override
Definition: item_strfunc.h:355
EVP_CIPHER_CTX stack_ctx
Definition: item_strfunc.h:329
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:759
Definition: item_strfunc.h:284
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e, Item *f)
Definition: item_strfunc.h:310
void create_op_context()
Definition: item_strfunc.cc:591
String * val_str(String *) override
Definition: item_strfunc.cc:615
const char * func_name() const override
Definition: item_strfunc.h:322
EVP_CIPHER_CTX * ctx
Definition: item_strfunc.h:287
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:297
EVP_CIPHER_CTX stack_ctx
Definition: item_strfunc.h:289
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:293
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:605
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:674
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:301
~Item_func_aes_encrypt() override
Definition: item_strfunc.h:315
String tmp_value
Definition: item_strfunc.h:285
Item_str_func super
Definition: item_strfunc.h:286
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:305
void destroy_op_context()
Definition: item_strfunc.cc:599
Definition: item_strfunc.h:913
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2971
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2981
Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:920
Item_func_bin_to_uuid(const POS &pos, Item *arg1)
Definition: item_strfunc.h:918
const char * func_name() const override
Definition: item_strfunc.h:924
char m_text_buf[mysql::gtid::Uuid::TEXT_LENGTH+1]
Buffer to store the text result.
Definition: item_strfunc.h:915
Definition: item_strfunc.h:831
Item_func_char(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:833
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:851
Item_func_char(const POS &pos, PT_item_list *list, const CHARSET_INFO *cs)
Definition: item_strfunc.h:838
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:844
String * val_str(String *) override
Definition: item_strfunc.cc:2615
const char * func_name() const override
Definition: item_strfunc.h:850
Definition: item_strfunc.h:1204
Item_func_charset(const POS &pos, Item *a)
Definition: item_strfunc.h:1206
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1211
String * val_str(String *) override
Definition: item_strfunc.cc:3275
const char * func_name() const override
Definition: item_strfunc.h:1210
Definition: item_strfunc.h:1218
String * val_str(String *) override
Definition: item_strfunc.cc:3289
const char * func_name() const override
Definition: item_strfunc.h:1224
Item_func_collation(const POS &pos, Item *a)
Definition: item_strfunc.h:1220
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1225
Definition: item_strfunc.h:1295
String buffer
Definition: item_strfunc.h:1296
Item_func_compress(const POS &pos, Item *a)
Definition: item_strfunc.h:1299
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4181
String * val_str(String *str) override
Definition: item_strfunc.cc:4189
const char * func_name() const override
Definition: item_strfunc.h:1301
Definition: item_strfunc.h:398
const char * func_name() const override
Definition: item_strfunc.h:411
Item_func_concat_ws(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:405
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1232
String tmp_value
Definition: item_strfunc.h:399
String * val_str(String *) override
concat with separator.
Definition: item_strfunc.cc:1199
Item_func_concat_ws(mem_root_deque< Item * > *list)
Definition: item_strfunc.h:401
Definition: item_strfunc.h:384
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:1149
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1174
Item_func_concat(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:390
Item_func_concat(Item *a, Item *b)
Definition: item_strfunc.h:389
Item_func_concat(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:387
const char * func_name() const override
Definition: item_strfunc.h:395
String tmp_value
Definition: item_strfunc.h:385
Definition: item_strfunc.h:1155
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3187
Item_func_conv_charset(const POS &pos, Item *a, const CHARSET_INFO *cs)
Definition: item_strfunc.h:1157
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3193
const char * func_name() const override
Definition: item_strfunc.h:1167
Item_func_conv_charset(THD *thd, Item *a, const CHARSET_INFO *cs, bool cache_if_const)
Definition: item_strfunc.h:1162
Definition: item_strfunc.h:942
String * val_str(String *) override
Definition: item_strfunc.cc:3116
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3108
static constexpr uint32_t CONV_MAX_LENGTH
Definition: item_strfunc.h:945
Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:946
const char * func_name() const override
Definition: item_strfunc.h:948
Definition: item_strfunc.h:1712
const char * func_name() const override
Definition: item_strfunc.h:1723
Item_func_convert_cpu_id_mask(const POS &pos, Item *list)
Definition: item_strfunc.h:1714
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1717
String * val_str(String *) override
Definition: item_strfunc.cc:5250
Definition: item_strfunc.h:1788
const char * func_name() const override
Definition: item_strfunc.h:1804
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1794
enum Functype functype() const override
Definition: item_strfunc.h:1793
String * val_str(String *) override
Definition: item_strfunc.cc:5549
Item_func_convert_interval_to_user_interval(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1790
Definition: item_strfunc.h:1263
const char * func_name() const override
Definition: item_strfunc.h:1270
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1271
Item_func_crc32(const POS &pos, Item *a)
Definition: item_strfunc.h:1267
longlong val_int() override
Definition: item_strfunc.cc:4169
String value
Definition: item_strfunc.h:1264
Definition: item_strfunc.h:1370
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1384
void set_current_role(THD *thd)
Definition: item_strfunc.cc:5306
Item_func_current_role()
Definition: item_strfunc.h:1374
const char * func_name() const override
Definition: item_strfunc.h:1377
bool value_cache_set
a flag whether value_cache is set or not
Definition: item_strfunc.h:1391
Item_func_sysconst super
Definition: item_strfunc.h:1371
Item_func_current_role(const POS &pos)
Definition: item_strfunc.h:1375
String * val_str(String *) override
Definition: item_strfunc.cc:5301
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1380
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1399
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5293
Definition: item_strfunc.h:740
Item_func_user super
Definition: item_strfunc.h:741
bool resolve_type(THD *) override
Overridden to copy definer priv_user and priv_host.
Definition: item_strfunc.cc:2107
Item_func_current_user(const POS &pos)
Definition: item_strfunc.h:762
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:766
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:2184
const char * func_name() const override
Definition: item_strfunc.h:765
LEX_CSTRING m_definer_priv_host
Definition: item_strfunc.h:753
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:2101
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:752
String * val_str(String *) override
Definition: item_strfunc.cc:2132
Name_resolution_context * m_name_resolution_ctx
Used to pass a security context to the resolver functions.
Definition: item_strfunc.h:748
Definition: item_strfunc.h:672
Item_func_sysconst super
Definition: item_strfunc.h:673
String * val_str(String *) override
Definition: item_strfunc.cc:2071
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:681
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:687
Item_func_database(const POS &pos)
Definition: item_strfunc.h:676
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:2063
const char * func_name() const override
Definition: item_strfunc.h:686
Definition: item_strfunc.h:784
const char * func_name() const override
Definition: item_strfunc.h:792
longlong val_int() override
Definition: item_strfunc.cc:2514
String * val_str(String *str) override
Definition: item_strfunc.cc:2527
double val_real() override
Definition: item_strfunc.cc:2502
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2483
Item_func_elt(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:786
This class represents the function ETAG which is used to traverse the input arguments and compute a 1...
Definition: item_strfunc.h:418
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:429
String * val_str(String *) override
Definition: item_strfunc.cc:1254
Item_func_etag(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:422
Item_func_etag(Item *a, Item *b)
Definition: item_strfunc.h:424
const char * func_name() const override
Definition: item_strfunc.h:428
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1320
String m_tmp_value
Definition: item_strfunc.h:419
Definition: item_strfunc.h:1131
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1133
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:1137
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1135
String * val_str(String *str) override
Definition: item_strfunc.cc:3834
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3903
const char * func_name() const override
Definition: item_strfunc.h:1142
Definition: item_strfunc.h:813
const char * func_name() const override
Definition: item_strfunc.h:826
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2470
String tmp_str
Definition: item_strfunc.h:814
MY_LOCALE * get_locale(Item *item)
Definition: item_strfunc.cc:2339
MY_LOCALE * locale
Definition: item_strfunc.h:815
Item_func_format(const POS &pos, Item *org, Item *dec)
Definition: item_strfunc.h:818
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2379
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2354
Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
Definition: item_strfunc.h:820
Definition: item_strfunc.h:274
String tmp_value
Definition: item_strfunc.h:275
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:857
const char * func_name() const override
Definition: item_strfunc.h:281
String * val_str(String *) override
Definition: item_strfunc.cc:871
Item_func_from_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:278
Definition: item_strfunc.h:1315
Item_func_from_vector(const POS &pos, Item *a)
Definition: item_strfunc.h:1323
const char * func_name() const override
Definition: item_strfunc.h:1326
String * val_str_ascii(String *str) override
Definition: item_strfunc.cc:4297
String buffer
Definition: item_strfunc.h:1319
static const uint32 per_value_chars
Definition: item_strfunc.h:1316
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4281
static const uint32 max_output_bytes
Definition: item_strfunc.h:1317
Item_func_from_vector(Item *a)
Definition: item_strfunc.h:1322
Definition: item_strfunc.h:1438
Item_func_get_dd_column_privileges(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1440
const char * func_name() const override
Definition: item_strfunc.h:1457
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1444
enum Functype functype() const override
Definition: item_strfunc.h:1443
String * val_str(String *) override
This function prepares string with list of column privileges.
Definition: item_strfunc.cc:4548
Definition: item_strfunc.h:1462
enum Functype functype() const override
Definition: item_strfunc.h:1467
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1468
String * val_str(String *) override
This function prepares string representing create_options for table.
Definition: item_strfunc.cc:4620
Item_func_get_dd_create_options(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1464
const char * func_name() const override
Definition: item_strfunc.h:1478
Definition: item_strfunc.h:1553
const char * func_name() const override
Definition: item_strfunc.h:1569
Item_func_get_dd_index_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1555
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1559
String * val_str(String *) override
This function prepares string representing se_private_data for index.
Definition: item_strfunc.cc:5165
enum Functype functype() const override
Definition: item_strfunc.h:1558
Definition: item_strfunc.h:1728
String * val_str(String *) override
This function prepares string representing value stored at key supplied.
Definition: item_strfunc.cc:5361
enum Functype functype() const override
Definition: item_strfunc.h:1733
Item_func_get_dd_property_key_value(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1730
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1734
const char * func_name() const override
Definition: item_strfunc.h:1742
Definition: item_strfunc.h:1483
String * val_str(String *) override
This function prepares string representing options for a schema.
Definition: item_strfunc.cc:4821
const char * func_name() const override
Definition: item_strfunc.h:1499
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1489
enum Functype functype() const override
Definition: item_strfunc.h:1488
Item_func_get_dd_schema_options(const POS &pos, Item *a)
Definition: item_strfunc.h:1485
Definition: item_strfunc.h:1530
String * val_str(String *) override
This function prepares string representing se_private_data for tablespace.
Definition: item_strfunc.cc:5099
const char * func_name() const override
Definition: item_strfunc.h:1546
enum Functype functype() const override
Definition: item_strfunc.h:1535
Item_func_get_dd_tablespace_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1532
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1536
Definition: item_strfunc.h:1747
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1754
enum Functype functype() const override
Definition: item_strfunc.h:1753
String * val_str(String *) override
This function prepares a string representing the value associated with the logical key that is suppli...
Definition: item_strfunc.cc:5416
const char * func_name() const override
Definition: item_strfunc.h:1762
Item_func_get_jdv_property_key_value(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1749
Definition: item_strfunc.h:1574
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1580
String * val_str(String *) override
Definition: item_strfunc.cc:4946
enum Functype functype() const override
Definition: item_strfunc.h:1579
Item_func_get_partition_nodegroup(const POS &pos, Item *a)
Definition: item_strfunc.h:1576
const char * func_name() const override
Definition: item_strfunc.h:1590
Definition: item_strfunc.h:953
String tmp_value
Definition: item_strfunc.h:954
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3455
Item_func_hex(const POS &pos, Item *a)
Definition: item_strfunc.h:957
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:3467
const char * func_name() const override
Definition: item_strfunc.h:958
Definition: item_strfunc.h:464
String * val_str(String *) override
Definition: item_strfunc.cc:1469
const char * func_name() const override
Definition: item_strfunc.h:475
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1521
String tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:467
Item_func_insert(const POS &pos, Item *org, Item *start, Item *length, Item *new_str)
Definition: item_strfunc.h:470
String tmp_value
Definition: item_strfunc.h:465
Definition: item_strfunc.h:1504
Item_func_internal_get_comment_or_error(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1506
const char * func_name() const override
Definition: item_strfunc.h:1523
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1510
String * val_str(String *) override
Definition: item_strfunc.cc:4869
enum Functype functype() const override
Definition: item_strfunc.h:1509
Definition: item_strfunc.h:1891
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1897
String * val_str(String *) override
This function prepares string representing EXTRA column for I_S.COLUMNS.
Definition: item_strfunc.cc:5726
const char * func_name() const override
Definition: item_strfunc.h:1907
Item_func_internal_get_dd_column_extra(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1893
enum Functype functype() const override
Definition: item_strfunc.h:1896
Definition: item_strfunc.h:1849
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1855
enum Functype functype() const override
Definition: item_strfunc.h:1854
Item_func_internal_get_enabled_role_json(const POS &pos)
Definition: item_strfunc.h:1851
String * val_str(String *) override
Definition: item_strfunc.cc:5645
const char * func_name() const override
Definition: item_strfunc.h:1863
Definition: item_strfunc.h:1830
Item_func_internal_get_hostname(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1832
enum Functype functype() const override
Definition: item_strfunc.h:1835
const char * func_name() const override
Definition: item_strfunc.h:1844
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1836
String * val_str(String *) override
Definition: item_strfunc.cc:5610
Definition: item_strfunc.h:1870
const char * func_name() const override
Definition: item_strfunc.h:1884
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1876
enum Functype functype() const override
Definition: item_strfunc.h:1875
Item_func_internal_get_mandatory_roles_json(const POS &pos)
Definition: item_strfunc.h:1872
String * val_str(String *) override
Definition: item_strfunc.cc:5677
Definition: item_strfunc.h:1811
String * val_str(String *) override
Definition: item_strfunc.cc:5573
Item_func_internal_get_username(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1813
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1817
enum Functype functype() const override
Definition: item_strfunc.h:1816
const char * func_name() const override
Definition: item_strfunc.h:1825
Definition: item_strfunc.h:1690
String * val_str(String *) override
Definition: item_strfunc.cc:5065
const char * func_name() const override
Definition: item_strfunc.h:1707
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1697
enum Functype functype() const override
Definition: item_strfunc.h:1696
Item_func_internal_tablespace_extra(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1692
const char * func_name() const override
Definition: item_strfunc.h:1636
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1626
String * val_str(String *) override
Definition: item_strfunc.cc:5003
Item_func_internal_tablespace_logfile_group_name(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1621
enum Functype functype() const override
Definition: item_strfunc.h:1625
Definition: item_strfunc.h:1666
const char * func_name() const override
Definition: item_strfunc.h:1683
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1673
Item_func_internal_tablespace_row_format(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1668
String * val_str(String *) override
Definition: item_strfunc.cc:5043
enum Functype functype() const override
Definition: item_strfunc.h:1672
Definition: item_strfunc.h:1643
Item_func_internal_tablespace_status(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1645
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1650
String * val_str(String *) override
Definition: item_strfunc.cc:5026
enum Functype functype() const override
Definition: item_strfunc.h:1649
const char * func_name() const override
Definition: item_strfunc.h:1660
Definition: item_strfunc.h:1597
enum Functype functype() const override
Definition: item_strfunc.h:1603
String * val_str(String *) override
Definition: item_strfunc.cc:4986
const char * func_name() const override
Definition: item_strfunc.h:1614
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1604
Item_func_internal_tablespace_type(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1599
Definition: item_strfunc.h:927
const char * func_name() const override
Definition: item_strfunc.h:933
longlong val_int() override
Definition: item_strfunc.cc:3021
Item_func_is_uuid(const POS &pos, Item *a)
Definition: item_strfunc.h:931
Item_bool_func super
Definition: item_strfunc.h:928
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:934
Definition: item_strfunc.h:503
Item_func_left(const POS &pos, Item *a, Item *b)
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:1641
String tmp_value
Definition: item_strfunc.h:504
String * val_str(String *) override
Definition: item_strfunc.cc:1594
const char * func_name() const override
Definition: item_strfunc.h:510
Definition: item_strfunc.h:1005
const char * func_name() const override
Definition: item_strfunc.h:1009
Item_func_like_range_max(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1007
Definition: item_strfunc.h:998
const char * func_name() const override
Definition: item_strfunc.h:1002
Item_func_like_range_min(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1000
Definition: item_strfunc.h:977
String max_str
Definition: item_strfunc.h:980
const bool is_min
Definition: item_strfunc.h:981
Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
Definition: item_strfunc.h:984
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:989
String min_str
Definition: item_strfunc.h:979
String * val_str(String *) override
Definition: item_strfunc.cc:3542
Definition: item_strfunc.h:489
const char * func_name() const override
Definition: item_strfunc.h:492
Item_func_lower(const POS &pos, Item *item)
Definition: item_strfunc.h:491
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1570
Definition: item_strfunc.h:888
String * val_str(String *) override
Definition: item_strfunc.cc:3035
Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:892
String tmp_value
Definition: item_strfunc.h:889
String lpad_str
Definition: item_strfunc.h:889
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2902
const char * func_name() const override
Definition: item_strfunc.h:896
Definition: item_strfunc.h:634
Item_func_ltrim(const POS &pos, Item *a)
Definition: item_strfunc.h:636
Definition: item_strfunc.h:795
String * val_str(String *str) override
Definition: item_strfunc.cc:2567
Item_str_func super
Definition: item_strfunc.h:796
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2604
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2551
String tmp_str
Definition: item_strfunc.h:798
Item_func_make_set(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:801
bool fix_fields(THD *thd, Item **ref) override
Definition: item_strfunc.cc:2547
const char * func_name() const override
Definition: item_strfunc.h:807
Definition: item_strfunc.h:188
const char * func_name() const override
Definition: item_strfunc.h:195
Item_func_md5(const POS &pos, Item *a)
Definition: item_strfunc.cc:241
String tmp_value
Definition: item_strfunc.h:189
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:248
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:198
Definition: item_strfunc.h:1145
String * val_str(String *) override
QUOTE() function returns argument string in single quotes suitable for using in a SQL statement.
Definition: item_strfunc.cc:3964
Item_func_quote(const POS &pos, Item *a)
Definition: item_strfunc.h:1149
String tmp_value
Definition: item_strfunc.h:1146
const char * func_name() const override
Definition: item_strfunc.h:1150
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3923
Definition: item_strfunc.h:365
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:379
static const ulonglong MAX_RANDOM_BYTES_BUFFER
limitation from the SSL library
Definition: item_strfunc.h:369
Item_str_func super
Definition: item_strfunc.h:366
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:767
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:784
Item_func_random_bytes(const POS &pos, Item *a)
Definition: item_strfunc.h:372
String * val_str(String *a) override
Definition: item_strfunc.cc:791
const char * func_name() const override
Definition: item_strfunc.h:378
Definition: item_strfunc.h:1769
Item_func_remove_dd_property_key(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1771
const char * func_name() const override
Definition: item_strfunc.h:1783
String * val_str(String *) override
This function removes a key value from given property string.
Definition: item_strfunc.cc:5503
enum Functype functype() const override
Definition: item_strfunc.h:1774
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1775
Definition: item_strfunc.h:858
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2665
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:2699
String tmp_value
Definition: item_strfunc.h:859
Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:862
const char * func_name() const override
Definition: item_strfunc.h:866
Definition: item_strfunc.h:451
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1447
String * val_str(String *) override
Replace all occurrences of string2 in string1 with string3.
Definition: item_strfunc.cc:1385
const char * func_name() const override
Definition: item_strfunc.h:461
String tmp_value
Definition: item_strfunc.h:452
String tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:454
String tmp_value2
Definition: item_strfunc.h:452
Item_func_replace(const POS &pos, Item *org, Item *find, Item *replace)
Definition: item_strfunc.h:457
Definition: item_strfunc.h:439
Item_func_reverse(Item *a)
Definition: item_strfunc.h:443
String * val_str(String *) override
Definition: item_strfunc.cc:1330
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1372
String tmp_value
Definition: item_strfunc.h:440
Item_func_reverse(const POS &pos, Item *a)
Definition: item_strfunc.h:444
const char * func_name() const override
Definition: item_strfunc.h:448
Definition: item_strfunc.h:513
Item_func_right(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:517
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1673
const char * func_name() const override
Definition: item_strfunc.h:521
String * val_str(String *) override
Definition: item_strfunc.cc:1651
String tmp_value
Definition: item_strfunc.h:514
Definition: item_strfunc.h:1402
Item_func_roles_graphml(const POS &pos)
Definition: item_strfunc.h:1407
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5344
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1432
Item_func_sysconst super
Definition: item_strfunc.h:1403
const char * func_name() const override
Definition: item_strfunc.h:1417
Item_func_roles_graphml()
Definition: item_strfunc.h:1406
bool calculate_graphml(THD *thd)
Constructs and caches the graphml string.
Definition: item_strfunc.cc:5324
String * val_str(String *) override
Definition: item_strfunc.cc:5339
bool value_cache_set
Set to true if value_cache is set.
Definition: item_strfunc.h:1435
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1412
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1419
Definition: item_strfunc.h:877
String tmp_value
Definition: item_strfunc.h:878
Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:881
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2803
String * val_str(String *) override
Definition: item_strfunc.cc:2830
const char * func_name() const override
Definition: item_strfunc.h:885
String rpad_str
Definition: item_strfunc.h:878
Definition: item_strfunc.h:640
Item_func_rtrim(const POS &pos, Item *a)
Definition: item_strfunc.h:642
Definition: item_strfunc.h:1173
bool eq(const Item *item) const override
Compare this item with another item for equality.
Definition: item_strfunc.cc:3251
Item_field * field_for_view_update() override
Definition: item_strfunc.h:1191
LEX_CSTRING collation_string
Definition: item_strfunc.h:1176
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3264
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:1197
const char * func_name() const override
Definition: item_strfunc.h:1187
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3221
enum Functype functype() const override
Definition: item_strfunc.h:1188
String * val_str(String *) override
Definition: item_strfunc.cc:3212
Item_func_set_collation(const POS &pos, Item *a, const LEX_CSTRING &collation_string_arg)
Definition: item_strfunc.h:1179
Item_str_func super
Definition: item_strfunc.h:1174
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3202
Definition: item_strfunc.h:206
const char * func_name() const override
Definition: item_strfunc.h:212
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:299
Item_func_sha2(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:208
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:373
Definition: item_strfunc.h:198
const char * func_name() const override
Definition: item_strfunc.h:203
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:263
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:284
Item_func_sha(const POS &pos, Item *a)
Definition: item_strfunc.cc:256
Definition: item_strfunc.h:773
Item_func_soundex(const POS &pos, Item *a)
Definition: item_strfunc.h:778
String tmp_value
Definition: item_strfunc.h:774
Item_func_soundex(Item *a)
Definition: item_strfunc.h:777
String * val_str(String *) override
Definition: item_strfunc.cc:2237
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2192
const char * func_name() const override
Definition: item_strfunc.h:781
Definition: item_strfunc.h:869
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2743
String * val_str(String *) override
Definition: item_strfunc.cc:2775
const char * func_name() const override
Definition: item_strfunc.h:874
Item_func_space(const POS &pos, Item *arg1)
Definition: item_strfunc.h:871
Definition: item_strfunc.h:248
bool resolve_type(THD *thd) override
The type is always LONGTEXT, just like the digest_text columns in Performance Schema.
Definition: item_strfunc.cc:1109
const char * func_name() const override
Definition: item_strfunc.h:253
uchar * m_token_buffer
Definition: item_strfunc.h:271
Item_func_statement_digest_text(const POS &pos, Item *query_string)
Definition: item_strfunc.h:250
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:261
String * val_str(String *) override
Definition: item_strfunc.cc:1118
Definition: item_strfunc.h:226
uchar * m_token_buffer
Definition: item_strfunc.h:245
Item_func_statement_digest(const POS &pos, Item *query_string)
Definition: item_strfunc.h:228
const char * func_name() const override
Definition: item_strfunc.h:231
String * val_str_ascii(String *) override
Implementation of the STATEMENT_DIGEST() native function.
Definition: item_strfunc.cc:1079
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1063
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:232
Definition: item_strfunc.h:542
String * val_str(String *) override
Definition: item_strfunc.cc:1783
Item_func_substr_index(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:546
String tmp_value
Definition: item_strfunc.h:543
const char * func_name() const override
Definition: item_strfunc.h:550
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1772
Definition: item_strfunc.h:524
const char * func_name() const override
Definition: item_strfunc.h:539
Item_func_substr(Item *a, Item *b)
Definition: item_strfunc.h:530
Item_func_substr(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:533
String tmp_value
Definition: item_strfunc.h:527
Item_func_substr(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:531
Item_str_func super
Definition: item_strfunc.h:525
String * val_str(String *) override
Definition: item_strfunc.cc:1684
Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:534
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1731
Definition: item_strfunc.h:646
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:662
virtual const Name_string fully_qualified_func_name() const =0
Item_func_sysconst(const POS &pos)
Definition: item_strfunc.h:653
Item_str_func super
Definition: item_strfunc.h:647
Item_func_sysconst()
Definition: item_strfunc.h:650
Definition: item_strfunc.h:215
const char * func_name() const override
Definition: item_strfunc.h:223
Item_func_to_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:219
Item_func_to_base64(Item *a)
Definition: item_strfunc.h:220
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:822
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:839
String tmp_value
Definition: item_strfunc.h:216
Definition: item_strfunc.h:1305
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4238
String * val_str(String *str) override
Definition: item_strfunc.cc:4253
String buffer
Definition: item_strfunc.h:1306
const char * func_name() const override
Definition: item_strfunc.h:1311
Item_func_to_vector(const POS &pos, Item *a)
Definition: item_strfunc.h:1309
Definition: item_strfunc.h:553
const bool m_trim_trailing
Definition: item_strfunc.h:574
bool trim_trailing() const
Definition: item_strfunc.h:606
bool trim_leading() const
Definition: item_strfunc.h:601
const char * func_name() const override
Definition: item_strfunc.h:613
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1993
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2033
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:560
@ TRIM_BOTH_DEFAULT
Definition: item_strfunc.h:561
@ TRIM_LTRIM
Definition: item_strfunc.h:565
@ TRIM_RTRIM
Definition: item_strfunc.h:566
@ TRIM_BOTH
Definition: item_strfunc.h:562
@ TRIM_LEADING
Definition: item_strfunc.h:563
@ TRIM_TRAILING
Definition: item_strfunc.h:564
Item_func_trim(Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:589
Item_func_trim(Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:577
Item_func_trim(const POS &pos, Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:595
String tmp_value
Definition: item_strfunc.h:570
const TRIM_MODE m_trim_mode
Definition: item_strfunc.h:572
Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:583
String remove
Definition: item_strfunc.h:571
const bool m_trim_leading
Definition: item_strfunc.h:573
String * val_str(String *) override
Definition: item_strfunc.cc:1898
Definition: item_strfunc.h:1330
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1335
const char * func_name() const override
Definition: item_strfunc.h:1342
String * val_str(String *str) override
Definition: item_strfunc.cc:4329
String buffer
Definition: item_strfunc.h:1331
Item_func_uncompress(const POS &pos, Item *a)
Definition: item_strfunc.h:1334
Definition: item_strfunc.h:1279
const char * func_name() const override
Definition: item_strfunc.h:1285
Item_func_uncompressed_length(const POS &pos, Item *a)
Definition: item_strfunc.h:1283
String value
Definition: item_strfunc.h:1280
longlong val_int() override
Definition: item_strfunc.cc:4140
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1286
Definition: item_strfunc.h:963
Item_func_unhex(const POS &pos, Item *a)
Definition: item_strfunc.h:967
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3497
String * val_str(String *) override
Convert given hex string to a binary string.
Definition: item_strfunc.cc:3510
String tmp_value
Definition: item_strfunc.h:964
const char * func_name() const override
Definition: item_strfunc.h:971
Definition: item_strfunc.h:496
Item_func_upper(const POS &pos, Item *item)
Definition: item_strfunc.h:498
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1582
const char * func_name() const override
Definition: item_strfunc.h:499
Definition: item_strfunc.h:692
Item_func_user(const POS &pos)
Definition: item_strfunc.h:705
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:709
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:733
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:2174
String * val_str(String *) override
Definition: item_strfunc.cc:2092
Item_func_sysconst super
Definition: item_strfunc.h:693
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.h:727
Item_func_user()
Definition: item_strfunc.h:704
const char * func_name() const override
Definition: item_strfunc.h:732
bool evaluate(const char *user, const char *host)
Evaluate user name, must be called once per execution.
Definition: item_strfunc.cc:2151
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:2087
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:723
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:715
bool m_evaluated
True when function value is evaluated, set to false after each execution.
Definition: item_strfunc.h:697
Definition: item_strfunc.h:899
String * val_str(String *) override
Definition: item_strfunc.cc:2939
Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:906
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2930
uchar m_bin_buf[mysql::gtid::Uuid::BYTE_LENGTH]
Buffer to store the binary result.
Definition: item_strfunc.h:901
Item_func_uuid_to_bin(const POS &pos, Item *arg1)
Definition: item_strfunc.h:904
const char * func_name() const override
Definition: item_strfunc.h:910
Definition: item_strfunc.h:1346
Item_func_uuid(const POS &pos)
Definition: item_strfunc.h:1351
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:1360
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:1354
String * val_str(String *) override
Definition: item_strfunc.cc:4529
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:4414
const char * func_name() const override
Definition: item_strfunc.h:1358
Item_func_uuid()
Definition: item_strfunc.h:1350
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4407
Item_str_func super
Definition: item_strfunc.h:1347
Definition: item_strfunc.h:1233
String * val_str(String *) override
Definition: item_strfunc.cc:3367
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3323
const char * func_name() const override
Definition: item_strfunc.h:1255
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3311
const uint num_codepoints
Definition: item_strfunc.h:1243
String tmp_value
Definition: item_strfunc.h:1236
Item_str_func super
Definition: item_strfunc.h:1234
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3300
Item_field * m_field_ref
Definition: item_strfunc.h:1239
const uint result_length
Definition: item_strfunc.h:1238
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3358
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:1244
const bool as_binary
Definition: item_strfunc.h:1240
uint flags
Definition: item_strfunc.h:1237
Definition: item_func.h:101
Item ** args
Array of pointers to arguments.
Definition: item_func.h:108
bool reject_vector_args()
Definition: item_func.cc:1617
Functype
Definition: item_func.h:214
@ COLLATE_FUNC
Definition: item_func.h:261
@ DD_INTERNAL_FUNC
Definition: item_func.h:271
@ TYPECAST_FUNC
Definition: item_func.h:263
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:530
uint arg_count
How many arguments in 'args'.
Definition: item_func.h:131
bool null_on_null
Affects how to determine that NULL argument implies a NULL function return.
Definition: item_func.h:187
Definition: item_func.h:1044
Definition: item_strfunc.h:1100
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3761
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1114
String tmp_value
Definition: item_strfunc.h:1103
Item_str_func super
Definition: item_strfunc.h:1101
String * val_str(String *) override
Definition: item_strfunc.cc:3769
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:1122
Item_load_file(const POS &pos, Item *a)
Definition: item_strfunc.h:1106
const char * func_name() const override
Definition: item_strfunc.h:1110
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:1111
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item.cc:11279
Definition: item_strfunc.h:151
Item_str_ascii_func(Item *a, Item *b)
Definition: item_strfunc.h:166
Item_str_ascii_func(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:177
String * val_str_ascii(String *) override=0
Item_str_ascii_func()
Definition: item_strfunc.h:155
Item_str_ascii_func(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:174
String ascii_buf
Definition: item_strfunc.h:152
Item_str_ascii_func(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:169
Item_str_ascii_func(const POS &pos, Item *a)
Definition: item_strfunc.h:162
Item_str_ascii_func(Item *a)
Definition: item_strfunc.h:159
String * val_str(String *str) override
Definition: item_strfunc.h:182
Definition: item_strfunc.h:478
String * val_str(String *) override
Definition: item_strfunc.cc:1538
Item_str_conv(const POS &pos, Item *item)
Definition: item_strfunc.h:485
String tmp_value
Definition: item_strfunc.h:482
uint multiply
Definition: item_strfunc.h:480
my_charset_conv_case converter
Definition: item_strfunc.h:481
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:155
Item_str_func(Item *a, Item *b)
Definition: item_strfunc.h:90
my_decimal * val_decimal(my_decimal *) override
Definition: item_strfunc.cc:187
String * push_packet_overflow_warning(THD *thd, const char *func)
Calls push_warning_printf for packet overflow.
Definition: item_strfunc.cc:1631
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
bool val_time(Time_val *time) override
Evaluate the item and return result as a time value.
Definition: item_strfunc.h:123
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:143
Item_func super
Definition: item_strfunc.h:79
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:1614
bool val_date(Date_val *date, my_time_flags_t flags) override
Evaluate the item and return result as a date value.
Definition: item_strfunc.h:120
enum Item_result result_type() const override
Definition: item_strfunc.h:127
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:130
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:177
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
bool val_datetime(Datetime_val *dt, my_time_flags_t flags) override
Evaluate the item and return result as a datetime value.
Definition: item_strfunc.h:124
Definition: item_strfunc.h:1078
const char * func_name() const override
Definition: item_strfunc.h:1095
Item_typecast_char(THD *thd, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1083
Item_typecast_char(const POS &pos, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1088
enum Functype functype() const override
Definition: item_strfunc.h:1093
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3579
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.cc:3592
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3572
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:928
String str_value
str_values's main purpose is to cache the value in save_in_field
Definition: item.h:3636
void set_nullable(bool nullable)
Definition: item.h:3748
void set_data_type_blob(enum_field_types type, uint32 max_l)
Set the Item to be of BLOB type.
Definition: item.h:1681
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3643
virtual Item_field * field_for_view_update()
Definition: item.h:3244
bool fixed
True if item has been resolved.
Definition: item.h:3736
bool null_value
True if item is null.
Definition: item.h:3773
bool get_datetime_from_string(Datetime_val *dt, my_time_flags_t flags)
Convert val_str() to datetime.
Definition: item.cc:1555
bool unsigned_flag
Definition: item.h:3774
bool get_date_from_string(Date_val *date, my_time_flags_t flags)
Convert val_str() to date.
Definition: item.cc:1563
longlong val_int_from_string()
Definition: item.cc:516
void set_data_type_string(uint32 max_l)
Set the Item to be variable length string.
Definition: item.h:1598
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:1404
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:3661
double val_real_from_string()
Definition: item.cc:468
bool get_time_from_string(Time_val *time)
Convert val_str() to time.
Definition: item.cc:1701
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:373
bool add_alias(std::string_view key, Json_dom *value)
Insert the value into the object.
Definition: json_dom.h:415
Definition: sql_list.h:494
Definition: sql_locale.h:37
Storage for name strings.
Definition: item.h:296
Wrapper class for an Item list head, used to allocate Item lists in the parser in a context-independe...
Definition: parse_tree_helpers.h:109
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:169
void mem_free()
Definition: sql_string.h:402
void mark_as_const()
Definition: sql_string.h:249
bool copy()
Definition: sql_string.cc:198
void set(String &str, size_t offset, size_t arg_length)
Definition: sql_string.h:304
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Time_val is a temporal type that represents only time.
Definition: my_temporal.h:55
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:97
constexpr std::array< const char, 37 > dig_vec_lower
Definition: dig_vec.h:36
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 int flags[50]
Definition: hp_test1.cc:40
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
#define NAME_STRING(x)
Definition: item.h:356
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:5234
String * mysql_generate_uuid(String *str)
Generate Universal Unique Identifier (UUID).
Definition: item_strfunc.cc:4422
void tohex(char *to, uint64_t from, uint len)
Definition: item_strfunc.h:1914
A better implementation of the UNIX ctype(3) library.
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:499
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
static constexpr uint32_t MY_REPERTOIRE_ASCII
Definition: m_ctype.h:152
MYSQL_PLUGIN_IMPORT CHARSET_INFO * system_charset_info
Definition: mysqld.cc:1574
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:85
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
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:1078
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:2884
type_conversion_status
Status when storing a value in a field or converting from one datatype to another.
Definition: field.h:197
@ VGS_CHECK_CONSTRAINT
Definition: field.h:471
@ VGS_GENERATED_COLUMN
Definition: field.h:469
@ DERIVATION_COERCIBLE
Definition: field.h:177
@ DERIVATION_SYSCONST
Definition: field.h:178
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:486
const char * banned_function_name
the name of the function which is not allowed
Definition: item.h:500
Value_generator_source source
Definition: item.h:498
Definition: mysql_lex_string.h:40
const char * str
Definition: mysql_lex_string.h:41
size_t length
Definition: mysql_lex_string.h:42
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:413
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:422
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