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