MySQL 9.6.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
189 public:
190 Item_func_sha2(const POS &pos, Item *a, Item *b)
191 : Item_str_ascii_func(pos, a, b) {}
192 String *val_str_ascii(String *) override;
193 bool resolve_type(THD *thd) override;
194 const char *func_name() const override { return "sha2"; }
195};
196
199
200 public:
201 Item_func_to_base64(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
203 String *val_str_ascii(String *) override;
204 bool resolve_type(THD *) override;
205 const char *func_name() const override { return "to_base64"; }
206};
207
209 public:
210 Item_func_statement_digest(const POS &pos, Item *query_string)
211 : Item_str_ascii_func(pos, query_string) {}
212
213 const char *func_name() const override { return "statement_digest"; }
214 bool check_function_as_value_generator(uchar *checker_args) override {
216 pointer_cast<Check_function_as_value_generator_parameters *>(
217 checker_args);
218 func_arg->banned_function_name = func_name();
219 return (func_arg->source == VGS_GENERATED_COLUMN);
220 }
221
222 bool resolve_type(THD *thd) override;
223
224 String *val_str_ascii(String *) override;
225
226 private:
228};
229
231 public:
232 Item_func_statement_digest_text(const POS &pos, Item *query_string)
233 : Item_str_func(pos, query_string) {}
234
235 const char *func_name() const override { return "statement_digest_text"; }
236
237 /**
238 The type is always LONGTEXT, just like the digest_text columns in
239 Performance Schema
240 */
241 bool resolve_type(THD *thd) override;
242
243 bool check_function_as_value_generator(uchar *checker_args) override {
245 pointer_cast<Check_function_as_value_generator_parameters *>(
246 checker_args);
247 func_arg->banned_function_name = func_name();
248 return (func_arg->source == VGS_GENERATED_COLUMN);
249 }
250 String *val_str(String *) override;
251
252 private:
254};
255
258
259 public:
260 Item_func_from_base64(const POS &pos, Item *a) : Item_str_func(pos, a) {}
261 String *val_str(String *) override;
262 bool resolve_type(THD *thd) override;
263 const char *func_name() const override { return "from_base64"; }
264};
265
269 EVP_CIPHER_CTX *ctx{nullptr};
270#if OPENSSL_VERSION_NUMBER < 0x10100000L
271 EVP_CIPHER_CTX stack_ctx;
272#endif
273
274 public:
275 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b)
276 : Item_str_func(pos, a, b) {
278 }
279 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c)
280 : Item_str_func(pos, a, b, c) {
282 }
283 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
284 : Item_str_func(pos, a, b, c, d) {
286 }
287 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
288 Item *e)
289 : Item_str_func(pos, a, b, c, d, e) {
291 }
292 Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
293 Item *e, Item *f)
294 : Item_str_func(pos, a, b, c, d, e, f) {
296 }
298
299 void create_op_context();
300 void destroy_op_context();
301 bool do_itemize(Parse_context *pc, Item **res) override;
302 String *val_str(String *) override;
303 bool resolve_type(THD *) override;
304 const char *func_name() const override { return "aes_encrypt"; }
305};
306
309 EVP_CIPHER_CTX *ctx{nullptr};
310#if OPENSSL_VERSION_NUMBER < 0x10100000L
311 EVP_CIPHER_CTX stack_ctx;
312#endif
313
314 public:
315 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b)
316 : Item_str_func(pos, a, b) {
318 }
319 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c)
320 : Item_str_func(pos, a, b, c) {
322 }
323 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
324 : Item_str_func(pos, a, b, c, d) {
326 }
327 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
328 Item *e)
329 : Item_str_func(pos, a, b, c, d, e) {
331 }
332 Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d,
333 Item *e, Item *f)
334 : Item_str_func(pos, a, b, c, d, e, f) {
336 }
338
339 void create_op_context();
340 void destroy_op_context();
341 bool do_itemize(Parse_context *pc, Item **res) override;
342 String *val_str(String *) override;
343 bool resolve_type(THD *thd) override;
344 const char *func_name() const override { return "aes_decrypt"; }
345};
346
349
350 /** limitation from the SSL library */
352
353 public:
354 Item_func_random_bytes(const POS &pos, Item *a) : Item_str_func(pos, a) {}
355
356 bool do_itemize(Parse_context *pc, Item **res) override;
357 bool resolve_type(THD *thd) override;
358 String *val_str(String *a) override;
359
360 const char *func_name() const override { return "random_bytes"; }
362 return RAND_TABLE_BIT;
363 }
364};
365
367 String tmp_value{"", 0, collation.collation}; // Initialize to empty
368 public:
369 Item_func_concat(const POS &pos, PT_item_list *opt_list)
370 : Item_str_func(pos, opt_list) {}
372 Item_func_concat(const POS &pos, Item *a, Item *b)
373 : Item_str_func(pos, a, b) {}
374
375 String *val_str(String *) override;
376 bool resolve_type(THD *thd) override;
377 const char *func_name() const override { return "concat"; }
378};
379
381 String tmp_value{"", 0, collation.collation}; // Initialize to empty
382 public:
385 null_on_null = false;
386 }
387 Item_func_concat_ws(const POS &pos, PT_item_list *opt_list)
388 : Item_str_func(pos, opt_list) {
389 null_on_null = false;
390 }
391 String *val_str(String *) override;
392 bool resolve_type(THD *thd) override;
393 const char *func_name() const override { return "concat_ws"; }
394};
395
396/**
397 This class represents the function ETAG which is used to traverse the input
398 arguments and compute a 128 bits hash value.
399 */
402
403 public:
404 Item_func_etag(const POS &pos, PT_item_list *opt_list)
405 : Item_str_func(pos, opt_list) {}
407
408 String *val_str(String *) override;
409 bool resolve_type(THD *thd) override;
410 const char *func_name() const override { return "etag"; }
411 bool check_function_as_value_generator(uchar *checker_args) override {
413 pointer_cast<Check_function_as_value_generator_parameters *>(
414 checker_args);
415 func_arg->banned_function_name = func_name();
416 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
417 (func_arg->source == VGS_CHECK_CONSTRAINT));
418 }
419};
420
423
424 public:
426 Item_func_reverse(const POS &pos, Item *a) : Item_str_func(pos, a) {}
427
428 String *val_str(String *) override;
429 bool resolve_type(THD *thd) override;
430 const char *func_name() const override { return "reverse"; }
431};
432
435 /// Holds result in case we need to allocate our own result buffer.
437
438 public:
440 : Item_str_func(pos, org, find, replace) {}
441 String *val_str(String *) override;
442 bool resolve_type(THD *thd) override;
443 const char *func_name() const override { return "replace"; }
444};
445
448 /// Holds result in case we need to allocate our own result buffer.
450
451 public:
453 Item *new_str)
454 : Item_str_func(pos, org, start, length, new_str) {}
455 String *val_str(String *) override;
456 bool resolve_type(THD *thd) override;
457 const char *func_name() const override { return "insert"; }
458};
459
461 protected:
465
466 public:
467 Item_str_conv(const POS &pos, Item *item) : Item_str_func(pos, item) {}
468 String *val_str(String *) override;
469};
470
472 public:
473 Item_func_lower(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
474 const char *func_name() const override { return "lower"; }
475 bool resolve_type(THD *) override;
476};
477
479 public:
480 Item_func_upper(const POS &pos, Item *item) : Item_str_conv(pos, item) {}
481 const char *func_name() const override { return "upper"; }
482 bool resolve_type(THD *) override;
483};
484
487
488 public:
489 Item_func_left(const POS &pos, Item *a, Item *b) : Item_str_func(pos, a, b) {}
490 String *val_str(String *) override;
491 bool resolve_type(THD *thd) override;
492 const char *func_name() const override { return "left"; }
493};
494
497
498 public:
499 Item_func_right(const POS &pos, Item *a, Item *b)
500 : Item_str_func(pos, a, b) {}
501 String *val_str(String *) override;
502 bool resolve_type(THD *thd) override;
503 const char *func_name() const override { return "right"; }
504};
505
508
510
511 public:
513 Item_func_substr(const POS &pos, Item *a, Item *b) : super(pos, a, b) {}
514
515 Item_func_substr(Item *a, Item *b, Item *c) : Item_str_func(a, b, c) {}
516 Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
517 : super(pos, a, b, c) {}
518
519 String *val_str(String *) override;
520 bool resolve_type(THD *thd) override;
521 const char *func_name() const override { return "substr"; }
522};
523
526
527 public:
528 Item_func_substr_index(const POS &pos, Item *a, Item *b, Item *c)
529 : Item_str_func(pos, a, b, c) {}
530 String *val_str(String *) override;
531 bool resolve_type(THD *) override;
532 const char *func_name() const override { return "substring_index"; }
533};
534
536 public:
537 /**
538 Why all the trim modes in this enum?
539 We need to maintain parsing information, so that our print() function
540 can reproduce correct messages and view definitions.
541 */
549 };
550
551 private:
555 const bool m_trim_leading;
556 const bool m_trim_trailing;
557
558 public:
560 : Item_str_func(a, b),
561 m_trim_mode(tm),
564
565 Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
566 : Item_str_func(pos, a, b),
567 m_trim_mode(tm),
570
572 : Item_str_func(a),
573 m_trim_mode(tm),
576
577 Item_func_trim(const POS &pos, Item *a, TRIM_MODE tm)
578 : Item_str_func(pos, a),
579 m_trim_mode(tm),
582
583 bool trim_leading() const {
586 }
587
588 bool trim_trailing() const {
591 }
592
593 String *val_str(String *) override;
594 bool resolve_type(THD *) override;
595 const char *func_name() const override {
596 switch (m_trim_mode) {
598 return "trim";
599 case TRIM_BOTH:
600 return "trim";
601 case TRIM_LEADING:
602 return "ltrim";
603 case TRIM_TRAILING:
604 return "rtrim";
605 case TRIM_LTRIM:
606 return "ltrim";
607 case TRIM_RTRIM:
608 return "rtrim";
609 }
610 return nullptr;
611 }
612 void print(const THD *thd, String *str,
613 enum_query_type query_type) const override;
614};
615
616class Item_func_ltrim final : public Item_func_trim {
617 public:
618 Item_func_ltrim(const POS &pos, Item *a)
619 : Item_func_trim(pos, a, TRIM_LTRIM) {}
620};
621
622class Item_func_rtrim final : public Item_func_trim {
623 public:
624 Item_func_rtrim(const POS &pos, Item *a)
625 : Item_func_trim(pos, a, TRIM_RTRIM) {}
626};
627
630
631 public:
634 }
635 explicit Item_func_sysconst(const POS &pos) : super(pos) {
637 }
638 /*
639 Used to create correct Item name in new converted item in
640 safe_charset_converter, return string representation of this function
641 call
642 */
643 virtual const Name_string fully_qualified_func_name() const = 0;
644 bool check_function_as_value_generator(uchar *checker_args) override {
646 pointer_cast<Check_function_as_value_generator_parameters *>(
647 checker_args);
648 func_arg->banned_function_name = func_name();
649 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
650 (func_arg->source == VGS_CHECK_CONSTRAINT));
651 }
652};
653
656
657 public:
658 explicit Item_func_database(const POS &pos) : Item_func_sysconst(pos) {}
659
660 bool do_itemize(Parse_context *pc, Item **res) override;
661
662 String *val_str(String *) override;
663 bool resolve_type(THD *) override {
665 set_nullable(true);
666 return false;
667 }
668 const char *func_name() const override { return "database"; }
669 const Name_string fully_qualified_func_name() const override {
670 return NAME_STRING("database()");
671 }
672};
673
676
677 protected:
678 /// True when function value is evaluated, set to false after each execution
679 bool m_evaluated = false;
680
681 /// Evaluate user name, must be called once per execution
682 bool evaluate(const char *user, const char *host);
683 type_conversion_status save_in_field_inner(Field *field, bool) override;
684
685 public:
687 explicit Item_func_user(const POS &pos) : super(pos) {
689 }
690
692 return INNER_TABLE_BIT;
693 }
694
695 bool do_itemize(Parse_context *pc, Item **res) override;
696
697 bool check_function_as_value_generator(uchar *checker_args) override {
699 pointer_cast<Check_function_as_value_generator_parameters *>(
700 checker_args);
701 func_arg->banned_function_name = func_name();
702 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
703 (func_arg->source == VGS_CHECK_CONSTRAINT));
704 }
705 bool resolve_type(THD *) override {
707 return false;
708 }
709 void cleanup() override {
710 m_evaluated = false;
713 }
714 const char *func_name() const override { return "user"; }
715 const Name_string fully_qualified_func_name() const override {
716 return NAME_STRING("user()");
717 }
718
719 String *val_str(String *) override;
720};
721
724 /**
725 Used to pass a security context to the resolver functions.
726 Only used for definer views. In all other contexts, the security context
727 passed here is nullptr and is instead looked up dynamically at run time
728 from the current THD.
729 */
731
732 /// Copied from m_name_resolution_ctx in fix_fields if the definer
733 /// Security_context is set in Name_resolution_context
736
737 protected:
738 type_conversion_status save_in_field_inner(Field *field, bool) override;
739
740 /// Overridden to copy definer priv_user and priv_host
741 bool resolve_type(THD *) override;
742
743 public:
744 explicit Item_func_current_user(const POS &pos) : super(pos) {}
745
746 bool do_itemize(Parse_context *pc, Item **res) override;
747 const char *func_name() const override { return "current_user"; }
748 const Name_string fully_qualified_func_name() const override {
749 return NAME_STRING("current_user()");
750 }
751
752 String *val_str(String *) override;
753};
754
757
758 public:
760 Item_func_soundex(const POS &pos, Item *a) : Item_str_func(pos, a) {}
761 String *val_str(String *) override;
762 bool resolve_type(THD *thd) override;
763 const char *func_name() const override { return "soundex"; }
764};
765
766class Item_func_elt final : public Item_str_func {
767 public:
768 Item_func_elt(const POS &pos, PT_item_list *opt_list)
769 : Item_str_func(pos, opt_list) {}
770 double val_real() override;
771 longlong val_int() override;
772 String *val_str(String *str) override;
773 bool resolve_type(THD *thd) override;
774 const char *func_name() const override { return "elt"; }
775};
776
777class Item_func_make_set final : public Item_str_func {
779
781
782 public:
783 Item_func_make_set(const POS &pos, PT_item_list *opt_list)
784 : Item_str_func(pos, opt_list) {}
785
786 String *val_str(String *str) override;
787 bool fix_fields(THD *thd, Item **ref) override;
788 bool resolve_type(THD *) override;
789 const char *func_name() const override { return "make_set"; }
790
791 void print(const THD *thd, String *str,
792 enum_query_type query_type) const override;
793};
794
798
799 public:
800 Item_func_format(const POS &pos, Item *org, Item *dec)
801 : Item_str_ascii_func(pos, org, dec) {}
802 Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
803 : Item_str_ascii_func(pos, org, dec, lang) {}
804
805 MY_LOCALE *get_locale(Item *item);
806 String *val_str_ascii(String *) override;
807 bool resolve_type(THD *thd) override;
808 const char *func_name() const override { return "format"; }
809 void print(const THD *thd, String *str,
810 enum_query_type query_type) const override;
811};
812
813class Item_func_char final : public Item_str_func {
814 public:
816 : Item_str_func(pos, list) {
818 null_on_null = false;
819 }
821 : Item_str_func(pos, list) {
823 null_on_null = false;
824 }
825 String *val_str(String *) override;
826 bool resolve_type(THD *thd) override {
827 if (param_type_is_default(thd, 0, -1, MYSQL_TYPE_LONGLONG)) return true;
828 if (reject_vector_args()) return true;
830 return false;
831 }
832 const char *func_name() const override { return "char"; }
833 void add_json_info(Json_object *obj) override {
835 obj->add_alias("charset",
836 create_dom_ptr<Json_string>(collation.collation->csname));
837 }
838};
839
840class Item_func_repeat final : public Item_str_func {
842
843 public:
844 Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
845 : Item_str_func(pos, arg1, arg2) {}
846 String *val_str(String *) override;
847 bool resolve_type(THD *thd) override;
848 const char *func_name() const override { return "repeat"; }
849};
850
851class Item_func_space final : public Item_str_func {
852 public:
853 Item_func_space(const POS &pos, Item *arg1) : Item_str_func(pos, arg1) {}
854 String *val_str(String *) override;
855 bool resolve_type(THD *) override;
856 const char *func_name() const override { return "space"; }
857};
858
859class Item_func_rpad final : public Item_str_func {
861
862 public:
863 Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
864 : Item_str_func(pos, arg1, arg2, arg3) {}
865 String *val_str(String *) override;
866 bool resolve_type(THD *) override;
867 const char *func_name() const override { return "rpad"; }
868};
869
870class Item_func_lpad final : public Item_str_func {
872
873 public:
874 Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
875 : Item_str_func(pos, arg1, arg2, arg3) {}
876 String *val_str(String *) override;
877 bool resolve_type(THD *) override;
878 const char *func_name() const override { return "lpad"; }
879};
880
882 /// Buffer to store the binary result
884
885 public:
886 Item_func_uuid_to_bin(const POS &pos, Item *arg1)
887 : Item_str_func(pos, arg1) {}
888 Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
889 : Item_str_func(pos, arg1, arg2) {}
890 String *val_str(String *) override;
891 bool resolve_type(THD *) override;
892 const char *func_name() const override { return "uuid_to_bin"; }
893};
894
896 /// Buffer to store the text result
898
899 public:
900 Item_func_bin_to_uuid(const POS &pos, Item *arg1)
901 : Item_str_ascii_func(pos, arg1) {}
902 Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
903 : Item_str_ascii_func(pos, arg1, arg2) {}
904 String *val_str_ascii(String *) override;
905 bool resolve_type(THD *thd) override;
906 const char *func_name() const override { return "bin_to_uuid"; }
907};
908
909class Item_func_is_uuid final : public Item_bool_func {
911
912 public:
913 Item_func_is_uuid(const POS &pos, Item *a) : Item_bool_func(pos, a) {}
914 longlong val_int() override;
915 const char *func_name() const override { return "is_uuid"; }
916 bool resolve_type(THD *thd) override {
917 if (reject_vector_args()) return true;
918 bool res = super::resolve_type(thd);
919 set_nullable(true);
920 return res;
921 }
922};
923
924class Item_func_conv final : public Item_str_func {
925 public:
926 // 64 digits plus possible '-'.
927 static constexpr uint32_t CONV_MAX_LENGTH = 64U + 1U;
928 Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
929 : Item_str_func(pos, a, b, c) {}
930 const char *func_name() const override { return "conv"; }
931 String *val_str(String *) override;
932 bool resolve_type(THD *) override;
933};
934
937
938 public:
939 Item_func_hex(const POS &pos, Item *a) : Item_str_ascii_func(pos, a) {}
940 const char *func_name() const override { return "hex"; }
941 String *val_str_ascii(String *) override;
942 bool resolve_type(THD *thd) override;
943};
944
945class Item_func_unhex final : public Item_str_func {
947
948 public:
949 Item_func_unhex(const POS &pos, Item *a) : Item_str_func(pos, a) {
950 /* there can be bad hex strings */
951 set_nullable(true);
952 }
953 const char *func_name() const override { return "unhex"; }
954 String *val_str(String *) override;
955 bool resolve_type(THD *thd) override;
956};
957
958#ifndef NDEBUG
960 protected:
963 const bool is_min;
964
965 public:
966 Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
967 : Item_str_func(pos, a, b), is_min(is_min_arg) {
968 set_nullable(true);
969 }
970 String *val_str(String *) override;
971 bool resolve_type(THD *thd) override {
972 if (param_type_is_default(thd, 0, 1)) return true;
973 if (param_type_is_default(thd, 1, 2, MYSQL_TYPE_LONGLONG)) return true;
974 if (reject_vector_args()) return true;
976 return false;
977 }
978};
979
981 public:
983 : Item_func_like_range(pos, a, b, true) {}
984 const char *func_name() const override { return "like_range_min"; }
985};
986
988 public:
990 : Item_func_like_range(pos, a, b, false) {}
991 const char *func_name() const override { return "like_range_max"; }
992};
993#endif
994
995/**
996 The following types of conversions are considered safe:
997
998 Conversion to and from "binary".
999 Conversion to Unicode.
1000 Other kind of conversions are potentially lossy.
1001*/
1003 protected:
1004 /// If true, conversion is needed so do it, else allow string copy.
1006 /// The character set we are converting to
1008 /// The character set we are converting from
1009 const CHARSET_INFO *m_from_cs{nullptr};
1011 /// Marks whether the underlying Item is constant and may be cached.
1013 /// Length argument value, if any given.
1014 longlong m_cast_length{-1}; // a priori not used
1015 public:
1017
1018 protected:
1019 /**
1020 Helper for CAST and CONVERT type resolution: common logic to compute the
1021 maximum numbers of characters of the type of the conversion.
1022
1023 @returns the maximum numbers of characters possible after the conversion
1024 */
1026
1027 bool resolve_type(THD *thd) override;
1028
1029 void add_json_info(Json_object *obj) override {
1031 obj->add_alias("charset", create_dom_ptr<Json_string>(m_cast_cs->csname));
1032 }
1033
1034 public:
1036 bool cache_if_const)
1037 : Item_str_func(a), m_cast_cs(cs_arg) {
1038 if (cache_if_const && args[0]->may_evaluate_const(thd)) {
1039 uint errors = 0;
1040 String tmp, *str = args[0]->val_str(&tmp);
1041 if (!str || str_value.copy(str->ptr(), str->length(), str->charset(),
1042 m_cast_cs, &errors))
1043 null_value = true;
1044 m_use_cached_value = true;
1046 m_safe = (errors == 0);
1047 } else {
1048 m_use_cached_value = false;
1049 // Marks whether the conversion is safe
1051 cs_arg == &my_charset_bin || (cs_arg->state & MY_CS_UNICODE));
1052 }
1053 }
1054 Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
1055 : Item_str_func(pos, a), m_cast_cs(cs_arg) {}
1056
1057 String *val_str(String *) override;
1058};
1059
1061 protected:
1062 void add_json_info(Json_object *obj) override;
1063
1064 public:
1065 Item_typecast_char(THD *thd, Item *a, longlong length_arg,
1066 const CHARSET_INFO *cs_arg)
1067 : Item_charset_conversion(thd, a, cs_arg, false) {
1068 m_cast_length = length_arg;
1069 }
1070 Item_typecast_char(const POS &pos, Item *a, longlong length_arg,
1071 const CHARSET_INFO *cs_arg)
1072 : Item_charset_conversion(pos, a, cs_arg) {
1073 m_cast_length = length_arg;
1074 }
1075 enum Functype functype() const override { return TYPECAST_FUNC; }
1076 bool eq_specific(const Item *item) const override;
1077 const char *func_name() const override { return "cast_as_char"; }
1078 void print(const THD *thd, String *str,
1079 enum_query_type query_type) const override;
1080};
1081
1082class Item_load_file final : public Item_str_func {
1084
1086
1087 public:
1088 Item_load_file(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1089
1090 bool do_itemize(Parse_context *pc, Item **res) override;
1091 String *val_str(String *) override;
1092 const char *func_name() const override { return "load_file"; }
1094 return INNER_TABLE_BIT;
1095 }
1096 bool resolve_type(THD *thd) override {
1097 if (param_type_is_default(thd, 0, 1)) return true;
1098 if (reject_vector_args()) return true;
1101 set_nullable(true);
1102 return false;
1103 }
1104 bool check_function_as_value_generator(uchar *checker_args) override {
1106 pointer_cast<Check_function_as_value_generator_parameters *>(
1107 checker_args);
1108 func_arg->banned_function_name = func_name();
1109 return true;
1110 }
1111};
1112
1114 public:
1115 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
1116 : Item_str_func(pos, a, b, c) {}
1117 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
1118 : Item_str_func(pos, a, b, c, d) {}
1119 Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d,
1120 Item *e)
1121 : Item_str_func(pos, a, b, c, d, e) {}
1122 String *val_str(String *str) override;
1123 bool resolve_type(THD *) override;
1124 const char *func_name() const override { return "export_set"; }
1125};
1126
1129
1130 public:
1131 Item_func_quote(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1132 const char *func_name() const override { return "quote"; }
1133 String *val_str(String *) override;
1134 bool resolve_type(THD *thd) override;
1135};
1136
1138 public:
1140 : Item_charset_conversion(pos, a, cs) {
1141 m_safe = false;
1142 }
1143
1145 bool cache_if_const)
1146 : Item_charset_conversion(thd, a, cs, cache_if_const) {
1147 assert(args[0]->fixed);
1148 }
1149 const char *func_name() const override { return "convert"; }
1150 void print(const THD *thd, String *str,
1151 enum_query_type query_type) const override;
1152 bool eq_specific(const Item *item) const override;
1153};
1154
1157
1159
1160 public:
1162 const LEX_CSTRING &collation_string_arg)
1163 : super(pos, a, nullptr), collation_string(collation_string_arg) {}
1164
1165 bool do_itemize(Parse_context *pc, Item **res) override;
1166 String *val_str(String *) override;
1167 bool resolve_type(THD *) override;
1168 bool eq(const Item *item) const override;
1169 const char *func_name() const override { return "collate"; }
1170 enum Functype functype() const override { return COLLATE_FUNC; }
1171 void print(const THD *thd, String *str,
1172 enum_query_type query_type) const override;
1174 /* this function is transparent for view updating */
1175 return args[0]->field_for_view_update();
1176 }
1177
1178 protected:
1179 void add_json_info(Json_object *obj) override {
1180 obj->add_alias("collation",
1181 create_dom_ptr<Json_string>(collation_string.str,
1183 }
1184};
1185
1186class Item_func_charset final : public Item_str_func {
1187 public:
1188 Item_func_charset(const POS &pos, Item *a) : Item_str_func(pos, a) {
1189 null_on_null = false;
1190 }
1191 String *val_str(String *) override;
1192 const char *func_name() const override { return "charset"; }
1193 bool resolve_type(THD *thd) override {
1195 set_nullable(false);
1196 return Item_str_func::resolve_type(thd);
1197 }
1198};
1199
1201 public:
1202 Item_func_collation(const POS &pos, Item *a) : Item_str_func(pos, a) {
1203 null_on_null = false;
1204 }
1205 String *val_str(String *) override;
1206 const char *func_name() const override { return "collation"; }
1207 bool resolve_type(THD *thd) override {
1208 if (Item_str_func::resolve_type(thd)) return true;
1210 set_nullable(false);
1211 return false;
1212 }
1213};
1214
1217
1219 uint flags;
1220 const uint result_length;
1222 const bool as_binary;
1223
1224 public:
1225 const uint num_codepoints;
1226 Item_func_weight_string(const POS &pos, Item *a, uint result_length_arg,
1227 uint num_codepoints_arg, uint flags_arg,
1228 bool as_binary_arg = false)
1229 : Item_str_func(pos, a),
1230 flags(flags_arg),
1231 result_length(result_length_arg),
1232 as_binary(as_binary_arg),
1233 num_codepoints(num_codepoints_arg) {}
1234
1235 bool do_itemize(Parse_context *pc, Item **res) override;
1236
1237 const char *func_name() const override { return "weight_string"; }
1238 bool eq_specific(const Item *item) const override;
1239 String *val_str(String *) override;
1240 bool resolve_type(THD *) override;
1241 void print(const THD *thd, String *str,
1242 enum_query_type query_type) const override;
1243};
1244
1245class Item_func_crc32 final : public Item_int_func {
1247
1248 public:
1249 Item_func_crc32(const POS &pos, Item *a) : Item_int_func(pos, a) {
1250 unsigned_flag = true;
1251 }
1252 const char *func_name() const override { return "crc32"; }
1253 bool resolve_type(THD *thd) override {
1254 if (param_type_is_default(thd, 0, 1)) return true;
1255 max_length = 10;
1256 return false;
1257 }
1258 longlong val_int() override;
1259};
1260
1263
1264 public:
1266 : Item_int_func(pos, a) {}
1267 const char *func_name() const override { return "uncompressed_length"; }
1268 bool resolve_type(THD *thd) override {
1269 if (param_type_is_default(thd, 0, 1)) return true;
1270 if (reject_vector_args()) return true;
1271 max_length = 10;
1272 return false;
1273 }
1274 longlong val_int() override;
1275};
1276
1277class Item_func_compress final : public Item_str_func {
1279
1280 public:
1281 Item_func_compress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1282 bool resolve_type(THD *thd) override;
1283 const char *func_name() const override { return "compress"; }
1284 String *val_str(String *str) override;
1285};
1286
1289
1290 public:
1291 Item_func_to_vector(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1292 bool resolve_type(THD *thd) override;
1293 const char *func_name() const override { return "to_vector"; }
1294 String *val_str(String *str) override;
1295};
1296
1298 static const uint32 per_value_chars = 16;
1302
1303 public:
1306 : Item_str_ascii_func(pos, a) {}
1307 bool resolve_type(THD *thd) override;
1308 const char *func_name() const override { return "from_vector"; }
1309 String *val_str_ascii(String *str) override;
1310};
1311
1314
1315 public:
1316 Item_func_uncompress(const POS &pos, Item *a) : Item_str_func(pos, a) {}
1317 bool resolve_type(THD *thd) override {
1318 if (reject_vector_args()) return true;
1319 if (Item_str_func::resolve_type(thd)) return true;
1320 set_nullable(true);
1322 return false;
1323 }
1324 const char *func_name() const override { return "uncompress"; }
1325 String *val_str(String *str) override;
1326};
1327
1328class Item_func_uuid final : public Item_str_func {
1330
1331 public:
1333 explicit Item_func_uuid(const POS &pos) : Item_str_func(pos) {}
1334
1335 bool do_itemize(Parse_context *pc, Item **res) override;
1337 return RAND_TABLE_BIT;
1338 }
1339 bool resolve_type(THD *) override;
1340 const char *func_name() const override { return "uuid"; }
1341 String *val_str(String *) override;
1342 bool check_function_as_value_generator(uchar *checker_args) override {
1344 pointer_cast<Check_function_as_value_generator_parameters *>(
1345 checker_args);
1346 func_arg->banned_function_name = func_name();
1347 return ((func_arg->source == VGS_GENERATED_COLUMN) ||
1348 (func_arg->source == VGS_CHECK_CONSTRAINT));
1349 }
1350};
1351
1354
1355 public:
1357 explicit Item_func_current_role(const POS &pos)
1358 : super(pos), value_cache_set(false) {}
1359 const char *func_name() const override { return "current_role"; }
1360 void cleanup() override;
1361 String *val_str(String *) override;
1362 bool resolve_type(THD *) override {
1364 return false;
1365 }
1367 return NAME_STRING("current_role()");
1368 }
1369
1370 protected:
1371 void set_current_role(THD *thd);
1372 /** a flag whether @ref value_cache is set or not */
1374 /**
1375 @brief Cache for the result value
1376
1377 Set by init(). And consumed by val_str().
1378 Needed to avoid re-calculation of the current_roles() in the
1379 course of the query.
1380 */
1382};
1383
1386
1387 public:
1389 explicit Item_func_roles_graphml(const POS &pos)
1390 : super(pos), value_cache_set(false) {}
1391 String *val_str(String *) override;
1392 void cleanup() override;
1393
1394 bool resolve_type(THD *) override {
1396 return false;
1397 }
1398
1399 const char *func_name() const override { return "roles_graphml"; }
1400
1402 return NAME_STRING("roles_graphml()");
1403 }
1404
1405 protected:
1406 bool calculate_graphml(THD *thd);
1407 /**
1408 @brief Cache for the result value
1409
1410 Set by init(). And consumed by val_str().
1411 Needed to avoid re-calculation of the current_roles() in the
1412 course of the query.
1413 */
1415
1416 /** Set to true if @ref value_cache is set */
1418};
1419
1421 public:
1423 : Item_str_func(pos, a, b, c) {}
1424
1425 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1426 bool resolve_type(THD *) override {
1427 /*
1428 There are 14 kinds of grants, with a max length
1429 per privileges is 11 chars.
1430 So, setting max approximate to 200.
1431 */
1433 set_nullable(true);
1434 null_on_null = false;
1435
1436 return false;
1437 }
1438
1439 const char *func_name() const override { return "get_dd_column_privileges"; }
1440
1441 String *val_str(String *) override;
1442};
1443
1445 public:
1447 : Item_str_func(pos, a, b, c) {}
1448
1449 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1450 bool resolve_type(THD *) override {
1451 // maximum string length of all options is expected
1452 // to be less than 256 characters.
1454 set_nullable(false);
1455 null_on_null = false;
1456
1457 return false;
1458 }
1459
1460 const char *func_name() const override { return "get_dd_create_options"; }
1461
1462 String *val_str(String *) override;
1463};
1464
1466 public:
1468 : Item_str_func(pos, a) {}
1469
1470 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1471 bool resolve_type(THD *) override {
1472 // maximum string length of all options is expected
1473 // to be less than 256 characters.
1475 set_nullable(false);
1476 null_on_null = false;
1477
1478 return false;
1479 }
1480
1481 const char *func_name() const override { return "get_dd_schema_options"; }
1482
1483 String *val_str(String *) override;
1484};
1485
1487 public:
1489 : Item_str_func(pos, list) {}
1490
1491 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1492 bool resolve_type(THD *) override {
1493 /*
1494 maximum expected string length to be less than 2048 characters,
1495 which is same as size of column holding comments in dictionary,
1496 i.e., the mysql.tables.comment DD column.
1497 */
1499 set_nullable(true);
1500 null_on_null = false;
1501
1502 return false;
1503 }
1504
1505 const char *func_name() const override {
1506 return "internal_get_comment_or_error";
1507 }
1508
1509 String *val_str(String *) override;
1510};
1511
1513 public:
1515 : Item_str_func(pos, a, b) {}
1516
1517 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1518 bool resolve_type(THD *) override {
1519 /* maximum string length of the property value is expected
1520 to be less than 256 characters. */
1522 set_nullable(false);
1523 null_on_null = false;
1524
1525 return false;
1526 }
1527
1528 const char *func_name() const override {
1529 return "get_dd_tablespace_private_data";
1530 }
1531
1532 String *val_str(String *) override;
1533};
1534
1536 public:
1538 : Item_str_func(pos, a, b) {}
1539
1540 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1541 bool resolve_type(THD *) override {
1542 /* maximum string length of the property value is expected
1543 to be less than 256 characters. */
1545 set_nullable(false);
1546 null_on_null = false;
1547
1548 return false;
1549 }
1550
1551 const char *func_name() const override { return "get_dd_index_private_data"; }
1552
1553 String *val_str(String *) override;
1554};
1555
1557 public:
1559 : Item_str_func(pos, a) {}
1560
1561 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1562 bool resolve_type(THD *) override {
1563 // maximum string length of all options is expected
1564 // to be less than 256 characters.
1566 set_nullable(true);
1567 null_on_null = false;
1568
1569 return false;
1570 }
1571
1572 const char *func_name() const override {
1573 return "internal_get_partition_nodegroup";
1574 }
1575
1576 String *val_str(String *) override;
1577};
1578
1580 public:
1582 Item *d)
1583 : Item_str_func(pos, a, b, c, d) {}
1584
1585 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1586 bool resolve_type(THD *) override {
1587 // maximum string length of all options is expected
1588 // to be less than 256 characters.
1590 set_nullable(true);
1591 null_on_null = false;
1592
1593 return false;
1594 }
1595
1596 const char *func_name() const override { return "internal_tablespace_type"; }
1597
1598 String *val_str(String *) override;
1599};
1600
1602 public:
1604 Item *b, Item *c, Item *d)
1605 : Item_str_func(pos, a, b, c, d) {}
1606
1607 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1608 bool resolve_type(THD *) override {
1609 // maximum string length of all options is expected
1610 // to be less than 256 characters.
1612 set_nullable(true);
1613 null_on_null = false;
1614
1615 return false;
1616 }
1617
1618 const char *func_name() const override {
1619 return "internal_tablespace_logfile_group_name";
1620 }
1621
1622 String *val_str(String *) override;
1623};
1624
1626 public:
1628 Item *c, Item *d)
1629 : Item_str_func(pos, a, b, c, d) {}
1630
1631 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1632 bool resolve_type(THD *) override {
1633 // maximum string length of all options is expected
1634 // to be less than 256 characters.
1636 set_nullable(true);
1637 null_on_null = false;
1638
1639 return false;
1640 }
1641
1642 const char *func_name() const override {
1643 return "internal_tablespace_status";
1644 }
1645 String *val_str(String *) override;
1646};
1647
1649 public:
1651 Item *c, Item *d)
1652 : Item_str_func(pos, a, b, c, d) {}
1653
1654 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1655 bool resolve_type(THD *) override {
1656 // maximum string length of all options is expected
1657 // to be less than 256 characters.
1659 set_nullable(true);
1660 null_on_null = false;
1661
1662 return false;
1663 }
1664
1665 const char *func_name() const override {
1666 return "internal_tablespace_row_format";
1667 }
1668
1669 String *val_str(String *) override;
1670};
1671
1673 public:
1675 Item *d)
1676 : Item_str_func(pos, a, b, c, d) {}
1677
1678 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1679 bool resolve_type(THD *) override {
1680 // maximum string length of all options is expected
1681 // to be less than 256 characters.
1683 set_nullable(true);
1684 null_on_null = false;
1685
1686 return false;
1687 }
1688
1689 const char *func_name() const override { return "internal_tablespace_extra"; }
1690
1691 String *val_str(String *) override;
1692};
1693
1695 public:
1697 : Item_str_func(pos, list) {}
1698
1699 bool resolve_type(THD *) override {
1700 set_nullable(false);
1702 return false;
1703 }
1704
1705 const char *func_name() const override { return "convert_cpu_id_mask"; }
1706
1707 String *val_str(String *) override;
1708};
1709
1711 public:
1713 : Item_str_func(pos, a, b) {}
1714
1715 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1716 bool resolve_type(THD *) override {
1718 set_nullable(true);
1719 null_on_null = false;
1720
1721 return false;
1722 }
1723
1724 const char *func_name() const override { return "get_dd_property_key_value"; }
1725
1726 String *val_str(String *) override;
1727};
1728
1730 public:
1732 Item *c, Item *d)
1733 : Item_str_func(pos, a, b, c, d) {}
1734
1735 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1736 bool resolve_type(THD *) override {
1738 set_nullable(true);
1739 null_on_null = false;
1740
1741 return false;
1742 }
1743
1744 const char *func_name() const override {
1745 return "get_jdv_property_key_value";
1746 }
1747
1748 String *val_str(String *) override;
1749};
1750
1752 public:
1754 : Item_str_func(pos, a, b) {}
1755
1756 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1757 bool resolve_type(THD *) override {
1759 set_nullable(true);
1760 null_on_null = false;
1761
1762 return false;
1763 }
1764
1765 const char *func_name() const override { return "remove_dd_property_key"; }
1766
1767 String *val_str(String *) override;
1768};
1769
1771 public:
1773 : Item_str_func(pos, a, b) {}
1774
1775 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1776 bool resolve_type(THD *) override {
1777 // maximum string length of all options is expected
1778 // to be less than 256 characters.
1780 set_nullable(true);
1781 null_on_null = false;
1782
1783 return false;
1784 }
1785
1786 const char *func_name() const override {
1787 return "convert_interval_to_user_interval";
1788 }
1789
1790 String *val_str(String *) override;
1791};
1792
1794 public:
1796 : Item_str_func(pos, list) {}
1797
1798 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1799 bool resolve_type(THD *) override {
1801 set_nullable(true);
1802 null_on_null = false;
1803
1804 return false;
1805 }
1806
1807 const char *func_name() const override { return "internal_get_username"; }
1808
1809 String *val_str(String *) override;
1810};
1811
1813 public:
1815 : Item_str_func(pos, list) {}
1816
1817 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1818 bool resolve_type(THD *) override {
1820 set_nullable(true);
1821 null_on_null = false;
1822
1823 return false;
1824 }
1825
1826 const char *func_name() const override { return "internal_get_hostname"; }
1827
1828 String *val_str(String *) override;
1829};
1830
1832 public:
1834 : Item_str_func(pos) {}
1835
1836 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1837 bool resolve_type(THD *) override {
1839 set_nullable(true);
1840 null_on_null = false;
1841
1842 return false;
1843 }
1844
1845 const char *func_name() const override {
1846 return "internal_get_enabled_role_json";
1847 }
1848
1849 String *val_str(String *) override;
1850};
1851
1853 public:
1855 : Item_str_func(pos) {}
1856
1857 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1858 bool resolve_type(THD *) override {
1860 set_nullable(true);
1861 null_on_null = false;
1862
1863 return false;
1864 }
1865
1866 const char *func_name() const override {
1867 return "internal_get_mandatory_roles_json";
1868 }
1869
1870 String *val_str(String *) override;
1871};
1872
1874 public:
1876 : Item_str_func(pos, list) {}
1877
1878 enum Functype functype() const override { return DD_INTERNAL_FUNC; }
1879 bool resolve_type(THD *) override {
1880 // maximum string length of all options is expected
1881 // to be less than 256 characters.
1883 set_nullable(false);
1884 null_on_null = false;
1885
1886 return false;
1887 }
1888
1889 const char *func_name() const override {
1890 return "internal_get_dd_column_extra";
1891 }
1892
1893 String *val_str(String *) override;
1894};
1895
1896inline void tohex(char *to, uint64_t from, uint len) {
1897 to += len;
1898 while (len--) {
1899 *--to = dig_vec_lower[from & 15];
1900 from >>= 4;
1901 }
1902}
1903
1904#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:1002
const CHARSET_INFO * m_cast_cs
The character set we are converting to.
Definition: item_strfunc.h:1007
bool m_safe
Definition: item_strfunc.h:1016
bool m_charset_conversion
If true, conversion is needed so do it, else allow string copy.
Definition: item_strfunc.h:1005
const CHARSET_INFO * m_from_cs
The character set we are converting from.
Definition: item_strfunc.h:1009
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3634
Item_charset_conversion(const POS &pos, Item *a, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1054
bool m_use_cached_value
Marks whether the underlying Item is constant and may be cached.
Definition: item_strfunc.h:1012
String * val_str(String *) override
Definition: item_strfunc.cc:3524
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:1029
longlong m_cast_length
Length argument value, if any given.
Definition: item_strfunc.h:1014
String m_tmp_value
Definition: item_strfunc.h:1010
Item_charset_conversion(THD *thd, Item *a, const CHARSET_INFO *cs_arg, bool cache_if_const)
Definition: item_strfunc.h:1035
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:3603
Definition: item.h:4467
Definition: item_strfunc.h:307
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:323
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:327
String * val_str(String *) override
Definition: item_strfunc.cc:634
void destroy_op_context()
Definition: item_strfunc.cc:618
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:624
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:319
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:315
Item_str_func super
Definition: item_strfunc.h:308
EVP_CIPHER_CTX * ctx
Definition: item_strfunc.h:309
const char * func_name() const override
Definition: item_strfunc.h:344
Item_func_aes_decrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e, Item *f)
Definition: item_strfunc.h:332
void create_op_context()
Definition: item_strfunc.cc:610
~Item_func_aes_decrypt() override
Definition: item_strfunc.h:337
EVP_CIPHER_CTX stack_ctx
Definition: item_strfunc.h:311
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:685
Definition: item_strfunc.h:266
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e, Item *f)
Definition: item_strfunc.h:292
void create_op_context()
Definition: item_strfunc.cc:517
String * val_str(String *) override
Definition: item_strfunc.cc:541
const char * func_name() const override
Definition: item_strfunc.h:304
EVP_CIPHER_CTX * ctx
Definition: item_strfunc.h:269
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:279
EVP_CIPHER_CTX stack_ctx
Definition: item_strfunc.h:271
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:275
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:531
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:600
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:283
~Item_func_aes_encrypt() override
Definition: item_strfunc.h:297
String tmp_value
Definition: item_strfunc.h:267
Item_str_func super
Definition: item_strfunc.h:268
Item_func_aes_encrypt(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:287
void destroy_op_context()
Definition: item_strfunc.cc:525
Definition: item_strfunc.h:895
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2897
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2907
Item_func_bin_to_uuid(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:902
Item_func_bin_to_uuid(const POS &pos, Item *arg1)
Definition: item_strfunc.h:900
const char * func_name() const override
Definition: item_strfunc.h:906
char m_text_buf[mysql::gtid::Uuid::TEXT_LENGTH+1]
Buffer to store the text result.
Definition: item_strfunc.h:897
Definition: item_strfunc.h:813
Item_func_char(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:815
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:833
Item_func_char(const POS &pos, PT_item_list *list, const CHARSET_INFO *cs)
Definition: item_strfunc.h:820
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:826
String * val_str(String *) override
Definition: item_strfunc.cc:2541
const char * func_name() const override
Definition: item_strfunc.h:832
Definition: item_strfunc.h:1186
Item_func_charset(const POS &pos, Item *a)
Definition: item_strfunc.h:1188
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1193
String * val_str(String *) override
Definition: item_strfunc.cc:3201
const char * func_name() const override
Definition: item_strfunc.h:1192
Definition: item_strfunc.h:1200
String * val_str(String *) override
Definition: item_strfunc.cc:3215
const char * func_name() const override
Definition: item_strfunc.h:1206
Item_func_collation(const POS &pos, Item *a)
Definition: item_strfunc.h:1202
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1207
Definition: item_strfunc.h:1277
String buffer
Definition: item_strfunc.h:1278
Item_func_compress(const POS &pos, Item *a)
Definition: item_strfunc.h:1281
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4107
String * val_str(String *str) override
Definition: item_strfunc.cc:4115
const char * func_name() const override
Definition: item_strfunc.h:1283
Definition: item_strfunc.h:380
const char * func_name() const override
Definition: item_strfunc.h:393
Item_func_concat_ws(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:387
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1158
String tmp_value
Definition: item_strfunc.h:381
String * val_str(String *) override
concat with separator.
Definition: item_strfunc.cc:1125
Item_func_concat_ws(mem_root_deque< Item * > *list)
Definition: item_strfunc.h:383
Definition: item_strfunc.h:366
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:1075
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1100
Item_func_concat(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:372
Item_func_concat(Item *a, Item *b)
Definition: item_strfunc.h:371
Item_func_concat(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:369
const char * func_name() const override
Definition: item_strfunc.h:377
String tmp_value
Definition: item_strfunc.h:367
Definition: item_strfunc.h:1137
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3113
Item_func_conv_charset(const POS &pos, Item *a, const CHARSET_INFO *cs)
Definition: item_strfunc.h:1139
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3119
const char * func_name() const override
Definition: item_strfunc.h:1149
Item_func_conv_charset(THD *thd, Item *a, const CHARSET_INFO *cs, bool cache_if_const)
Definition: item_strfunc.h:1144
Definition: item_strfunc.h:924
String * val_str(String *) override
Definition: item_strfunc.cc:3042
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3034
static constexpr uint32_t CONV_MAX_LENGTH
Definition: item_strfunc.h:927
Item_func_conv(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:928
const char * func_name() const override
Definition: item_strfunc.h:930
Definition: item_strfunc.h:1694
const char * func_name() const override
Definition: item_strfunc.h:1705
Item_func_convert_cpu_id_mask(const POS &pos, Item *list)
Definition: item_strfunc.h:1696
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1699
String * val_str(String *) override
Definition: item_strfunc.cc:5176
Definition: item_strfunc.h:1770
const char * func_name() const override
Definition: item_strfunc.h:1786
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1776
enum Functype functype() const override
Definition: item_strfunc.h:1775
String * val_str(String *) override
Definition: item_strfunc.cc:5475
Item_func_convert_interval_to_user_interval(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1772
Definition: item_strfunc.h:1245
const char * func_name() const override
Definition: item_strfunc.h:1252
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1253
Item_func_crc32(const POS &pos, Item *a)
Definition: item_strfunc.h:1249
longlong val_int() override
Definition: item_strfunc.cc:4095
String value
Definition: item_strfunc.h:1246
Definition: item_strfunc.h:1352
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1366
void set_current_role(THD *thd)
Definition: item_strfunc.cc:5232
Item_func_current_role()
Definition: item_strfunc.h:1356
const char * func_name() const override
Definition: item_strfunc.h:1359
bool value_cache_set
a flag whether value_cache is set or not
Definition: item_strfunc.h:1373
Item_func_sysconst super
Definition: item_strfunc.h:1353
Item_func_current_role(const POS &pos)
Definition: item_strfunc.h:1357
String * val_str(String *) override
Definition: item_strfunc.cc:5227
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1362
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1381
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5219
Definition: item_strfunc.h:722
Item_func_user super
Definition: item_strfunc.h:723
bool resolve_type(THD *) override
Overridden to copy definer priv_user and priv_host.
Definition: item_strfunc.cc:2033
Item_func_current_user(const POS &pos)
Definition: item_strfunc.h:744
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:748
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:2110
const char * func_name() const override
Definition: item_strfunc.h:747
LEX_CSTRING m_definer_priv_host
Definition: item_strfunc.h:735
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:2027
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:734
String * val_str(String *) override
Definition: item_strfunc.cc:2058
Name_resolution_context * m_name_resolution_ctx
Used to pass a security context to the resolver functions.
Definition: item_strfunc.h:730
Definition: item_strfunc.h:654
Item_func_sysconst super
Definition: item_strfunc.h:655
String * val_str(String *) override
Definition: item_strfunc.cc:1997
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:663
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:669
Item_func_database(const POS &pos)
Definition: item_strfunc.h:658
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:1989
const char * func_name() const override
Definition: item_strfunc.h:668
Definition: item_strfunc.h:766
const char * func_name() const override
Definition: item_strfunc.h:774
longlong val_int() override
Definition: item_strfunc.cc:2440
String * val_str(String *str) override
Definition: item_strfunc.cc:2453
double val_real() override
Definition: item_strfunc.cc:2428
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2409
Item_func_elt(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:768
This class represents the function ETAG which is used to traverse the input arguments and compute a 1...
Definition: item_strfunc.h:400
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:411
String * val_str(String *) override
Definition: item_strfunc.cc:1180
Item_func_etag(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:404
Item_func_etag(Item *a, Item *b)
Definition: item_strfunc.h:406
const char * func_name() const override
Definition: item_strfunc.h:410
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1246
String m_tmp_value
Definition: item_strfunc.h:401
Definition: item_strfunc.h:1113
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1115
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d, Item *e)
Definition: item_strfunc.h:1119
Item_func_export_set(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1117
String * val_str(String *str) override
Definition: item_strfunc.cc:3760
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3829
const char * func_name() const override
Definition: item_strfunc.h:1124
Definition: item_strfunc.h:795
const char * func_name() const override
Definition: item_strfunc.h:808
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2396
String tmp_str
Definition: item_strfunc.h:796
MY_LOCALE * get_locale(Item *item)
Definition: item_strfunc.cc:2265
MY_LOCALE * locale
Definition: item_strfunc.h:797
Item_func_format(const POS &pos, Item *org, Item *dec)
Definition: item_strfunc.h:800
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:2305
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2280
Item_func_format(const POS &pos, Item *org, Item *dec, Item *lang)
Definition: item_strfunc.h:802
Definition: item_strfunc.h:256
String tmp_value
Definition: item_strfunc.h:257
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:783
const char * func_name() const override
Definition: item_strfunc.h:263
String * val_str(String *) override
Definition: item_strfunc.cc:797
Item_func_from_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:260
Definition: item_strfunc.h:1297
Item_func_from_vector(const POS &pos, Item *a)
Definition: item_strfunc.h:1305
const char * func_name() const override
Definition: item_strfunc.h:1308
String * val_str_ascii(String *str) override
Definition: item_strfunc.cc:4223
String buffer
Definition: item_strfunc.h:1301
static const uint32 per_value_chars
Definition: item_strfunc.h:1298
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4207
static const uint32 max_output_bytes
Definition: item_strfunc.h:1299
Item_func_from_vector(Item *a)
Definition: item_strfunc.h:1304
Definition: item_strfunc.h:1420
Item_func_get_dd_column_privileges(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1422
const char * func_name() const override
Definition: item_strfunc.h:1439
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1426
enum Functype functype() const override
Definition: item_strfunc.h:1425
String * val_str(String *) override
This function prepares string with list of column privileges.
Definition: item_strfunc.cc:4474
Definition: item_strfunc.h:1444
enum Functype functype() const override
Definition: item_strfunc.h:1449
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1450
String * val_str(String *) override
This function prepares string representing create_options for table.
Definition: item_strfunc.cc:4546
Item_func_get_dd_create_options(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:1446
const char * func_name() const override
Definition: item_strfunc.h:1460
Definition: item_strfunc.h:1535
const char * func_name() const override
Definition: item_strfunc.h:1551
Item_func_get_dd_index_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1537
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1541
String * val_str(String *) override
This function prepares string representing se_private_data for index.
Definition: item_strfunc.cc:5091
enum Functype functype() const override
Definition: item_strfunc.h:1540
Definition: item_strfunc.h:1710
String * val_str(String *) override
This function prepares string representing value stored at key supplied.
Definition: item_strfunc.cc:5287
enum Functype functype() const override
Definition: item_strfunc.h:1715
Item_func_get_dd_property_key_value(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1712
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1716
const char * func_name() const override
Definition: item_strfunc.h:1724
Definition: item_strfunc.h:1465
String * val_str(String *) override
This function prepares string representing options for a schema.
Definition: item_strfunc.cc:4747
const char * func_name() const override
Definition: item_strfunc.h:1481
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1471
enum Functype functype() const override
Definition: item_strfunc.h:1470
Item_func_get_dd_schema_options(const POS &pos, Item *a)
Definition: item_strfunc.h:1467
Definition: item_strfunc.h:1512
String * val_str(String *) override
This function prepares string representing se_private_data for tablespace.
Definition: item_strfunc.cc:5025
const char * func_name() const override
Definition: item_strfunc.h:1528
enum Functype functype() const override
Definition: item_strfunc.h:1517
Item_func_get_dd_tablespace_private_data(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1514
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1518
Definition: item_strfunc.h:1729
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1736
enum Functype functype() const override
Definition: item_strfunc.h:1735
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:5342
const char * func_name() const override
Definition: item_strfunc.h:1744
Item_func_get_jdv_property_key_value(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1731
Definition: item_strfunc.h:1556
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1562
String * val_str(String *) override
Definition: item_strfunc.cc:4872
enum Functype functype() const override
Definition: item_strfunc.h:1561
Item_func_get_partition_nodegroup(const POS &pos, Item *a)
Definition: item_strfunc.h:1558
const char * func_name() const override
Definition: item_strfunc.h:1572
Definition: item_strfunc.h:935
String tmp_value
Definition: item_strfunc.h:936
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3381
Item_func_hex(const POS &pos, Item *a)
Definition: item_strfunc.h:939
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:3393
const char * func_name() const override
Definition: item_strfunc.h:940
Definition: item_strfunc.h:446
String * val_str(String *) override
Definition: item_strfunc.cc:1395
const char * func_name() const override
Definition: item_strfunc.h:457
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 tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:449
Item_func_insert(const POS &pos, Item *org, Item *start, Item *length, Item *new_str)
Definition: item_strfunc.h:452
String tmp_value
Definition: item_strfunc.h:447
Definition: item_strfunc.h:1486
Item_func_internal_get_comment_or_error(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1488
const char * func_name() const override
Definition: item_strfunc.h:1505
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1492
String * val_str(String *) override
Definition: item_strfunc.cc:4795
enum Functype functype() const override
Definition: item_strfunc.h:1491
Definition: item_strfunc.h:1873
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1879
String * val_str(String *) override
This function prepares string representing EXTRA column for I_S.COLUMNS.
Definition: item_strfunc.cc:5652
const char * func_name() const override
Definition: item_strfunc.h:1889
Item_func_internal_get_dd_column_extra(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1875
enum Functype functype() const override
Definition: item_strfunc.h:1878
Definition: item_strfunc.h:1831
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1837
enum Functype functype() const override
Definition: item_strfunc.h:1836
Item_func_internal_get_enabled_role_json(const POS &pos)
Definition: item_strfunc.h:1833
String * val_str(String *) override
Definition: item_strfunc.cc:5571
const char * func_name() const override
Definition: item_strfunc.h:1845
Definition: item_strfunc.h:1812
Item_func_internal_get_hostname(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1814
enum Functype functype() const override
Definition: item_strfunc.h:1817
const char * func_name() const override
Definition: item_strfunc.h:1826
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1818
String * val_str(String *) override
Definition: item_strfunc.cc:5536
Definition: item_strfunc.h:1852
const char * func_name() const override
Definition: item_strfunc.h:1866
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1858
enum Functype functype() const override
Definition: item_strfunc.h:1857
Item_func_internal_get_mandatory_roles_json(const POS &pos)
Definition: item_strfunc.h:1854
String * val_str(String *) override
Definition: item_strfunc.cc:5603
Definition: item_strfunc.h:1793
String * val_str(String *) override
Definition: item_strfunc.cc:5499
Item_func_internal_get_username(const POS &pos, PT_item_list *list)
Definition: item_strfunc.h:1795
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1799
enum Functype functype() const override
Definition: item_strfunc.h:1798
const char * func_name() const override
Definition: item_strfunc.h:1807
Definition: item_strfunc.h:1672
String * val_str(String *) override
Definition: item_strfunc.cc:4991
const char * func_name() const override
Definition: item_strfunc.h:1689
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1679
enum Functype functype() const override
Definition: item_strfunc.h:1678
Item_func_internal_tablespace_extra(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1674
const char * func_name() const override
Definition: item_strfunc.h:1618
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1608
String * val_str(String *) override
Definition: item_strfunc.cc:4929
Item_func_internal_tablespace_logfile_group_name(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1603
enum Functype functype() const override
Definition: item_strfunc.h:1607
Definition: item_strfunc.h:1648
const char * func_name() const override
Definition: item_strfunc.h:1665
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1655
Item_func_internal_tablespace_row_format(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1650
String * val_str(String *) override
Definition: item_strfunc.cc:4969
enum Functype functype() const override
Definition: item_strfunc.h:1654
Definition: item_strfunc.h:1625
Item_func_internal_tablespace_status(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1627
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1632
String * val_str(String *) override
Definition: item_strfunc.cc:4952
enum Functype functype() const override
Definition: item_strfunc.h:1631
const char * func_name() const override
Definition: item_strfunc.h:1642
Definition: item_strfunc.h:1579
enum Functype functype() const override
Definition: item_strfunc.h:1585
String * val_str(String *) override
Definition: item_strfunc.cc:4912
const char * func_name() const override
Definition: item_strfunc.h:1596
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1586
Item_func_internal_tablespace_type(const POS &pos, Item *a, Item *b, Item *c, Item *d)
Definition: item_strfunc.h:1581
Definition: item_strfunc.h:909
const char * func_name() const override
Definition: item_strfunc.h:915
longlong val_int() override
Definition: item_strfunc.cc:2947
Item_func_is_uuid(const POS &pos, Item *a)
Definition: item_strfunc.h:913
Item_bool_func super
Definition: item_strfunc.h:910
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:916
Definition: item_strfunc.h:485
Item_func_left(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:489
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1567
String tmp_value
Definition: item_strfunc.h:486
String * val_str(String *) override
Definition: item_strfunc.cc:1520
const char * func_name() const override
Definition: item_strfunc.h:492
Definition: item_strfunc.h:987
const char * func_name() const override
Definition: item_strfunc.h:991
Item_func_like_range_max(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:989
Definition: item_strfunc.h:980
const char * func_name() const override
Definition: item_strfunc.h:984
Item_func_like_range_min(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:982
Definition: item_strfunc.h:959
String max_str
Definition: item_strfunc.h:962
const bool is_min
Definition: item_strfunc.h:963
Item_func_like_range(const POS &pos, Item *a, Item *b, bool is_min_arg)
Definition: item_strfunc.h:966
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:971
String min_str
Definition: item_strfunc.h:961
String * val_str(String *) override
Definition: item_strfunc.cc:3468
Definition: item_strfunc.h:471
const char * func_name() const override
Definition: item_strfunc.h:474
Item_func_lower(const POS &pos, Item *item)
Definition: item_strfunc.h:473
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1496
Definition: item_strfunc.h:870
String * val_str(String *) override
Definition: item_strfunc.cc:2961
Item_func_lpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:874
String tmp_value
Definition: item_strfunc.h:871
String lpad_str
Definition: item_strfunc.h:871
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2828
const char * func_name() const override
Definition: item_strfunc.h:878
Definition: item_strfunc.h:616
Item_func_ltrim(const POS &pos, Item *a)
Definition: item_strfunc.h:618
Definition: item_strfunc.h:777
String * val_str(String *str) override
Definition: item_strfunc.cc:2493
Item_str_func super
Definition: item_strfunc.h:778
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:2530
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2477
String tmp_str
Definition: item_strfunc.h:780
Item_func_make_set(const POS &pos, PT_item_list *opt_list)
Definition: item_strfunc.h:783
bool fix_fields(THD *thd, Item **ref) override
Definition: item_strfunc.cc:2473
const char * func_name() const override
Definition: item_strfunc.h:789
Definition: item_strfunc.h:1127
String * val_str(String *) override
QUOTE() function returns argument string in single quotes suitable for using in a SQL statement.
Definition: item_strfunc.cc:3890
Item_func_quote(const POS &pos, Item *a)
Definition: item_strfunc.h:1131
String tmp_value
Definition: item_strfunc.h:1128
const char * func_name() const override
Definition: item_strfunc.h:1132
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3849
Definition: item_strfunc.h:347
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:361
static const ulonglong MAX_RANDOM_BYTES_BUFFER
limitation from the SSL library
Definition: item_strfunc.h:351
Item_str_func super
Definition: item_strfunc.h:348
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:693
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:710
Item_func_random_bytes(const POS &pos, Item *a)
Definition: item_strfunc.h:354
String * val_str(String *a) override
Definition: item_strfunc.cc:717
const char * func_name() const override
Definition: item_strfunc.h:360
Definition: item_strfunc.h:1751
Item_func_remove_dd_property_key(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:1753
const char * func_name() const override
Definition: item_strfunc.h:1765
String * val_str(String *) override
This function removes a key value from given property string.
Definition: item_strfunc.cc:5429
enum Functype functype() const override
Definition: item_strfunc.h:1756
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1757
Definition: item_strfunc.h:840
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2591
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:2625
String tmp_value
Definition: item_strfunc.h:841
Item_func_repeat(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:844
const char * func_name() const override
Definition: item_strfunc.h:848
Definition: item_strfunc.h:433
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1373
String * val_str(String *) override
Replace all occurrences of string2 in string1 with string3.
Definition: item_strfunc.cc:1311
const char * func_name() const override
Definition: item_strfunc.h:443
String tmp_value
Definition: item_strfunc.h:434
String tmp_value_res
Holds result in case we need to allocate our own result buffer.
Definition: item_strfunc.h:436
String tmp_value2
Definition: item_strfunc.h:434
Item_func_replace(const POS &pos, Item *org, Item *find, Item *replace)
Definition: item_strfunc.h:439
Definition: item_strfunc.h:421
Item_func_reverse(Item *a)
Definition: item_strfunc.h:425
String * val_str(String *) override
Definition: item_strfunc.cc:1256
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1298
String tmp_value
Definition: item_strfunc.h:422
Item_func_reverse(const POS &pos, Item *a)
Definition: item_strfunc.h:426
const char * func_name() const override
Definition: item_strfunc.h:430
Definition: item_strfunc.h:495
Item_func_right(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:499
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1599
const char * func_name() const override
Definition: item_strfunc.h:503
String * val_str(String *) override
Definition: item_strfunc.cc:1577
String tmp_value
Definition: item_strfunc.h:496
Definition: item_strfunc.h:1384
Item_func_roles_graphml(const POS &pos)
Definition: item_strfunc.h:1389
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.cc:5270
String value_cache
Cache for the result value.
Definition: item_strfunc.h:1414
Item_func_sysconst super
Definition: item_strfunc.h:1385
const char * func_name() const override
Definition: item_strfunc.h:1399
Item_func_roles_graphml()
Definition: item_strfunc.h:1388
bool calculate_graphml(THD *thd)
Constructs and caches the graphml string.
Definition: item_strfunc.cc:5250
String * val_str(String *) override
Definition: item_strfunc.cc:5265
bool value_cache_set
Set to true if value_cache is set.
Definition: item_strfunc.h:1417
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1394
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:1401
Definition: item_strfunc.h:859
String tmp_value
Definition: item_strfunc.h:860
Item_func_rpad(const POS &pos, Item *arg1, Item *arg2, Item *arg3)
Definition: item_strfunc.h:863
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2729
String * val_str(String *) override
Definition: item_strfunc.cc:2756
const char * func_name() const override
Definition: item_strfunc.h:867
String rpad_str
Definition: item_strfunc.h:860
Definition: item_strfunc.h:622
Item_func_rtrim(const POS &pos, Item *a)
Definition: item_strfunc.h:624
Definition: item_strfunc.h:1155
bool eq(const Item *item) const override
Compare this item with another item for equality.
Definition: item_strfunc.cc:3177
Item_field * field_for_view_update() override
Definition: item_strfunc.h:1173
LEX_CSTRING collation_string
Definition: item_strfunc.h:1158
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3190
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.h:1179
const char * func_name() const override
Definition: item_strfunc.h:1169
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3147
enum Functype functype() const override
Definition: item_strfunc.h:1170
String * val_str(String *) override
Definition: item_strfunc.cc:3138
Item_func_set_collation(const POS &pos, Item *a, const LEX_CSTRING &collation_string_arg)
Definition: item_strfunc.h:1161
Item_str_func super
Definition: item_strfunc.h:1156
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3128
Definition: item_strfunc.h:188
const char * func_name() const override
Definition: item_strfunc.h:194
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:216
Item_func_sha2(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:190
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:299
Definition: item_strfunc.h:755
Item_func_soundex(const POS &pos, Item *a)
Definition: item_strfunc.h:760
String tmp_value
Definition: item_strfunc.h:756
Item_func_soundex(Item *a)
Definition: item_strfunc.h:759
String * val_str(String *) override
Definition: item_strfunc.cc:2163
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2118
const char * func_name() const override
Definition: item_strfunc.h:763
Definition: item_strfunc.h:851
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2669
String * val_str(String *) override
Definition: item_strfunc.cc:2701
const char * func_name() const override
Definition: item_strfunc.h:856
Item_func_space(const POS &pos, Item *arg1)
Definition: item_strfunc.h:853
Definition: item_strfunc.h:230
bool resolve_type(THD *thd) override
The type is always LONGTEXT, just like the digest_text columns in Performance Schema.
Definition: item_strfunc.cc:1035
const char * func_name() const override
Definition: item_strfunc.h:235
uchar * m_token_buffer
Definition: item_strfunc.h:253
Item_func_statement_digest_text(const POS &pos, Item *query_string)
Definition: item_strfunc.h:232
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:243
String * val_str(String *) override
Definition: item_strfunc.cc:1044
Definition: item_strfunc.h:208
uchar * m_token_buffer
Definition: item_strfunc.h:227
Item_func_statement_digest(const POS &pos, Item *query_string)
Definition: item_strfunc.h:210
const char * func_name() const override
Definition: item_strfunc.h:213
String * val_str_ascii(String *) override
Implementation of the STATEMENT_DIGEST() native function.
Definition: item_strfunc.cc:1005
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:989
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:214
Definition: item_strfunc.h:524
String * val_str(String *) override
Definition: item_strfunc.cc:1709
Item_func_substr_index(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:528
String tmp_value
Definition: item_strfunc.h:525
const char * func_name() const override
Definition: item_strfunc.h:532
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1698
Definition: item_strfunc.h:506
const char * func_name() const override
Definition: item_strfunc.h:521
Item_func_substr(Item *a, Item *b)
Definition: item_strfunc.h:512
Item_func_substr(Item *a, Item *b, Item *c)
Definition: item_strfunc.h:515
String tmp_value
Definition: item_strfunc.h:509
Item_func_substr(const POS &pos, Item *a, Item *b)
Definition: item_strfunc.h:513
Item_str_func super
Definition: item_strfunc.h:507
String * val_str(String *) override
Definition: item_strfunc.cc:1610
Item_func_substr(const POS &pos, Item *a, Item *b, Item *c)
Definition: item_strfunc.h:516
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1657
Definition: item_strfunc.h:628
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:644
virtual const Name_string fully_qualified_func_name() const =0
Item_func_sysconst(const POS &pos)
Definition: item_strfunc.h:635
Item_str_func super
Definition: item_strfunc.h:629
Item_func_sysconst()
Definition: item_strfunc.h:632
Definition: item_strfunc.h:197
const char * func_name() const override
Definition: item_strfunc.h:205
Item_func_to_base64(const POS &pos, Item *a)
Definition: item_strfunc.h:201
Item_func_to_base64(Item *a)
Definition: item_strfunc.h:202
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:748
String * val_str_ascii(String *) override
Definition: item_strfunc.cc:765
String tmp_value
Definition: item_strfunc.h:198
Definition: item_strfunc.h:1287
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4164
String * val_str(String *str) override
Definition: item_strfunc.cc:4179
String buffer
Definition: item_strfunc.h:1288
const char * func_name() const override
Definition: item_strfunc.h:1293
Item_func_to_vector(const POS &pos, Item *a)
Definition: item_strfunc.h:1291
Definition: item_strfunc.h:535
const bool m_trim_trailing
Definition: item_strfunc.h:556
bool trim_trailing() const
Definition: item_strfunc.h:588
bool trim_leading() const
Definition: item_strfunc.h:583
const char * func_name() const override
Definition: item_strfunc.h:595
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1919
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:1959
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:542
@ TRIM_BOTH_DEFAULT
Definition: item_strfunc.h:543
@ TRIM_LTRIM
Definition: item_strfunc.h:547
@ TRIM_RTRIM
Definition: item_strfunc.h:548
@ TRIM_BOTH
Definition: item_strfunc.h:544
@ TRIM_LEADING
Definition: item_strfunc.h:545
@ TRIM_TRAILING
Definition: item_strfunc.h:546
Item_func_trim(Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:571
Item_func_trim(Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:559
Item_func_trim(const POS &pos, Item *a, TRIM_MODE tm)
Definition: item_strfunc.h:577
String tmp_value
Definition: item_strfunc.h:552
const TRIM_MODE m_trim_mode
Definition: item_strfunc.h:554
Item_func_trim(const POS &pos, Item *a, Item *b, TRIM_MODE tm)
Definition: item_strfunc.h:565
String remove
Definition: item_strfunc.h:553
const bool m_trim_leading
Definition: item_strfunc.h:555
String * val_str(String *) override
Definition: item_strfunc.cc:1824
Definition: item_strfunc.h:1312
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1317
const char * func_name() const override
Definition: item_strfunc.h:1324
String * val_str(String *str) override
Definition: item_strfunc.cc:4255
String buffer
Definition: item_strfunc.h:1313
Item_func_uncompress(const POS &pos, Item *a)
Definition: item_strfunc.h:1316
Definition: item_strfunc.h:1261
const char * func_name() const override
Definition: item_strfunc.h:1267
Item_func_uncompressed_length(const POS &pos, Item *a)
Definition: item_strfunc.h:1265
String value
Definition: item_strfunc.h:1262
longlong val_int() override
Definition: item_strfunc.cc:4066
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1268
Definition: item_strfunc.h:945
Item_func_unhex(const POS &pos, Item *a)
Definition: item_strfunc.h:949
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3423
String * val_str(String *) override
Convert given hex string to a binary string.
Definition: item_strfunc.cc:3436
String tmp_value
Definition: item_strfunc.h:946
const char * func_name() const override
Definition: item_strfunc.h:953
Definition: item_strfunc.h:478
Item_func_upper(const POS &pos, Item *item)
Definition: item_strfunc.h:480
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:1508
const char * func_name() const override
Definition: item_strfunc.h:481
Definition: item_strfunc.h:674
Item_func_user(const POS &pos)
Definition: item_strfunc.h:687
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:691
const Name_string fully_qualified_func_name() const override
Definition: item_strfunc.h:715
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:2100
String * val_str(String *) override
Definition: item_strfunc.cc:2018
Item_func_sysconst super
Definition: item_strfunc.h:675
void cleanup() override
Called for every Item after use (preparation and execution).
Definition: item_strfunc.h:709
Item_func_user()
Definition: item_strfunc.h:686
const char * func_name() const override
Definition: item_strfunc.h:714
bool evaluate(const char *user, const char *host)
Evaluate user name, must be called once per execution.
Definition: item_strfunc.cc:2077
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:2013
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:705
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:697
bool m_evaluated
True when function value is evaluated, set to false after each execution.
Definition: item_strfunc.h:679
Definition: item_strfunc.h:881
String * val_str(String *) override
Definition: item_strfunc.cc:2865
Item_func_uuid_to_bin(const POS &pos, Item *arg1, Item *arg2)
Definition: item_strfunc.h:888
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:2856
uchar m_bin_buf[mysql::gtid::Uuid::BYTE_LENGTH]
Buffer to store the binary result.
Definition: item_strfunc.h:883
Item_func_uuid_to_bin(const POS &pos, Item *arg1)
Definition: item_strfunc.h:886
const char * func_name() const override
Definition: item_strfunc.h:892
Definition: item_strfunc.h:1328
Item_func_uuid(const POS &pos)
Definition: item_strfunc.h:1333
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:1342
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:1336
String * val_str(String *) override
Definition: item_strfunc.cc:4455
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:4340
const char * func_name() const override
Definition: item_strfunc.h:1340
Item_func_uuid()
Definition: item_strfunc.h:1332
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:4333
Item_str_func super
Definition: item_strfunc.h:1329
Definition: item_strfunc.h:1215
String * val_str(String *) override
Definition: item_strfunc.cc:3293
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.cc:3249
const char * func_name() const override
Definition: item_strfunc.h:1237
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3237
const uint num_codepoints
Definition: item_strfunc.h:1225
String tmp_value
Definition: item_strfunc.h:1218
Item_str_func super
Definition: item_strfunc.h:1216
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3226
Item_field * m_field_ref
Definition: item_strfunc.h:1221
const uint result_length
Definition: item_strfunc.h:1220
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3284
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:1226
const bool as_binary
Definition: item_strfunc.h:1222
uint flags
Definition: item_strfunc.h:1219
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:1632
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:1046
Definition: item_strfunc.h:1082
bool do_itemize(Parse_context *pc, Item **res) override
The core function that does the actual itemization.
Definition: item_strfunc.cc:3687
bool resolve_type(THD *thd) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_strfunc.h:1096
String tmp_value
Definition: item_strfunc.h:1085
Item_str_func super
Definition: item_strfunc.h:1083
String * val_str(String *) override
Definition: item_strfunc.cc:3695
bool check_function_as_value_generator(uchar *checker_args) override
Check if this item is allowed for a virtual column or inside a default expression.
Definition: item_strfunc.h:1104
Item_load_file(const POS &pos, Item *a)
Definition: item_strfunc.h:1088
const char * func_name() const override
Definition: item_strfunc.h:1092
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:1093
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:460
String * val_str(String *) override
Definition: item_strfunc.cc:1464
Item_str_conv(const POS &pos, Item *item)
Definition: item_strfunc.h:467
String tmp_value
Definition: item_strfunc.h:464
uint multiply
Definition: item_strfunc.h:462
my_charset_conv_case converter
Definition: item_strfunc.h:463
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:152
Item_str_func(Item *a, Item *b)
Definition: item_strfunc.h:90
my_decimal * val_decimal(my_decimal *) override
Definition: item_strfunc.cc:184
String * push_packet_overflow_warning(THD *thd, const char *func)
Calls push_warning_printf for packet overflow.
Definition: item_strfunc.cc:1557
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:1540
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:174
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:1060
const char * func_name() const override
Definition: item_strfunc.h:1077
Item_typecast_char(THD *thd, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1065
Item_typecast_char(const POS &pos, Item *a, longlong length_arg, const CHARSET_INFO *cs_arg)
Definition: item_strfunc.h:1070
enum Functype functype() const override
Definition: item_strfunc.h:1075
void print(const THD *thd, String *str, enum_query_type query_type) const override
This method is used for to:
Definition: item_strfunc.cc:3505
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: item_strfunc.cc:3518
bool eq_specific(const Item *item) const override
Provide a more specific equality check for a function.
Definition: item_strfunc.cc:3498
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:3637
void set_nullable(bool nullable)
Definition: item.h:3749
void set_data_type_blob(enum_field_types type, uint32 max_l)
Set the Item to be of BLOB type.
Definition: item.h:1682
DTCollation collation
Character set and collation properties assigned for this Item.
Definition: item.h:3644
virtual Item_field * field_for_view_update()
Definition: item.h:3245
bool fixed
True if item has been resolved.
Definition: item.h:3737
bool null_value
True if item is null.
Definition: item.h:3774
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:3775
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:1599
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:3662
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:5160
String * mysql_generate_uuid(String *str)
Generate Universal Unique Identifier (UUID).
Definition: item_strfunc.cc:4348
void tohex(char *to, uint64_t from, uint len)
Definition: item_strfunc.h:1896
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:1577
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:1077
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