MySQL 8.3.0
Source Code Documentation
item_pfs_func.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#ifndef ITEM_PFS_FUNC_INCLUDED
24#define ITEM_PFS_FUNC_INCLUDED
25
26/* Function items used by mysql */
27
28#include "my_inttypes.h"
29#include "sql/item_func.h"
30#include "sql/item_strfunc.h"
31#include "sql/parse_location.h" // POS
32#include "sql_string.h"
33
34class Item;
35class THD;
36struct Parse_context;
37
38/** ps_current_thread_id() */
39
43
44 public:
46 : Item_int_func(pos), m_thread_id(0) {}
47 bool do_itemize(Parse_context *pc, Item **res) override;
48 const char *func_name() const override { return "ps_current_thread_id"; }
49 bool resolve_type(THD *) override;
50 bool fix_fields(THD *thd, Item **ref) override;
51 longlong val_int() override;
52};
53
54/** ps_thread_id() */
55
59
60 public:
62 : Item_int_func(pos, a), m_thread_id(0) {}
63 bool do_itemize(Parse_context *pc, Item **res) override;
64 const char *func_name() const override { return "ps_thread_id"; }
65 bool resolve_type(THD *) override;
66 longlong val_int() override;
67};
68
69/** format_bytes() */
70
75
76 public:
77 Item_func_pfs_format_bytes(const POS &pos, Item *a) : Item_str_func(pos, a) {}
78 const char *func_name() const override { return "format_bytes"; }
79 bool resolve_type(THD *) override;
80 String *val_str(String *str) override;
81};
82
83/** format_pico_time() */
84
89
90 public:
92 : Item_str_func(pos, a) {}
93 const char *func_name() const override { return "format_pico_time"; }
94 bool resolve_type(THD *) override;
95 String *val_str(String *str) override;
96};
97
98#endif /* ITEM_PFS_FUNC_INCLUDED */
ps_current_thread_id()
Definition: item_pfs_func.h:40
Item_int_func super
Definition: item_pfs_func.h:41
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_pfs_func.cc:61
bool do_itemize(Parse_context *pc, Item **res) override
ps_current_thread_id()
Definition: item_pfs_func.cc:53
bool fix_fields(THD *thd, Item **ref) override
Definition: item_pfs_func.cc:67
const char * func_name() const override
Definition: item_pfs_func.h:48
ulonglong m_thread_id
Definition: item_pfs_func.h:42
longlong val_int() override
Definition: item_pfs_func.cc:73
Item_func_pfs_current_thread_id(const POS &pos)
Definition: item_pfs_func.h:45
format_bytes()
Definition: item_pfs_func.h:71
Item_func_pfs_format_bytes(const POS &pos, Item *a)
Definition: item_pfs_func.h:77
String * val_str(String *str) override
Definition: item_pfs_func.cc:165
bool resolve_type(THD *) override
format_bytes()
Definition: item_pfs_func.cc:157
String m_value
Definition: item_pfs_func.h:73
const char * func_name() const override
Definition: item_pfs_func.h:78
Item_str_func super
Definition: item_pfs_func.h:72
char m_value_buffer[20]
Definition: item_pfs_func.h:74
format_pico_time()
Definition: item_pfs_func.h:85
const char * func_name() const override
Definition: item_pfs_func.h:93
char m_value_buffer[20]
Definition: item_pfs_func.h:88
String m_value
Definition: item_pfs_func.h:87
String * val_str(String *str) override
Definition: item_pfs_func.cc:238
Item_str_func super
Definition: item_pfs_func.h:86
Item_func_pfs_format_pico_time(const POS &pos, Item *a)
Definition: item_pfs_func.h:91
bool resolve_type(THD *) override
format_pico_time()
Definition: item_pfs_func.cc:229
ps_thread_id()
Definition: item_pfs_func.h:56
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_pfs_func.cc:102
bool do_itemize(Parse_context *pc, Item **res) override
ps_thread_id()
Definition: item_pfs_func.cc:95
longlong val_int() override
Definition: item_pfs_func.cc:110
const char * func_name() const override
Definition: item_pfs_func.h:64
Item_func_pfs_thread_id(const POS &pos, Item *a)
Definition: item_pfs_func.h:61
ulonglong m_thread_id
Definition: item_pfs_func.h:58
Item_int_func super
Definition: item_pfs_func.h:57
Definition: item_func.h:977
Definition: item_strfunc.h:75
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:933
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
long long int longlong
Definition: my_inttypes.h:54
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1065
PT & ref(PT *tp)
Definition: tablespace_impl.cc:358
Our own string classes, used pervasively throughout the executor.
Bison "location" class.
Definition: parse_location.h:42
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:419