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