MySQL 9.0.0
Source Code Documentation
item_pfs_func.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef ITEM_PFS_FUNC_INCLUDED
25#define ITEM_PFS_FUNC_INCLUDED
26
27/* Function items used by mysql */
28
29#include "my_inttypes.h"
30#include "sql/item_func.h"
31#include "sql/item_strfunc.h"
32#include "sql/parse_location.h" // POS
33#include "sql_string.h"
34
35class Item;
36class THD;
37struct Parse_context;
38
39/** ps_current_thread_id() */
40
44
45 public:
47 : Item_int_func(pos), m_thread_id(0) {}
48 bool do_itemize(Parse_context *pc, Item **res) override;
49 const char *func_name() const override { return "ps_current_thread_id"; }
50 bool resolve_type(THD *) override;
51 bool fix_fields(THD *thd, Item **ref) override;
52 longlong val_int() override;
53};
54
55/** ps_thread_id() */
56
60
61 public:
63 : Item_int_func(pos, a), m_thread_id(0) {}
64 bool do_itemize(Parse_context *pc, Item **res) override;
65 const char *func_name() const override { return "ps_thread_id"; }
66 bool resolve_type(THD *) override;
67 longlong val_int() override;
68};
69
70/** format_bytes() */
71
76
77 public:
78 Item_func_pfs_format_bytes(const POS &pos, Item *a) : Item_str_func(pos, a) {}
79 const char *func_name() const override { return "format_bytes"; }
80 bool resolve_type(THD *) override;
81 String *val_str(String *str) override;
82};
83
84/** format_pico_time() */
85
90
91 public:
93 : Item_str_func(pos, a) {}
94 const char *func_name() const override { return "format_pico_time"; }
95 bool resolve_type(THD *) override;
96 String *val_str(String *str) override;
97};
98
99#endif /* ITEM_PFS_FUNC_INCLUDED */
ps_current_thread_id()
Definition: item_pfs_func.h:41
Item_int_func super
Definition: item_pfs_func.h:42
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_pfs_func.cc:62
bool do_itemize(Parse_context *pc, Item **res) override
ps_current_thread_id()
Definition: item_pfs_func.cc:54
bool fix_fields(THD *thd, Item **ref) override
Definition: item_pfs_func.cc:68
const char * func_name() const override
Definition: item_pfs_func.h:49
ulonglong m_thread_id
Definition: item_pfs_func.h:43
longlong val_int() override
Definition: item_pfs_func.cc:74
Item_func_pfs_current_thread_id(const POS &pos)
Definition: item_pfs_func.h:46
format_bytes()
Definition: item_pfs_func.h:72
Item_func_pfs_format_bytes(const POS &pos, Item *a)
Definition: item_pfs_func.h:78
String * val_str(String *str) override
Definition: item_pfs_func.cc:166
bool resolve_type(THD *) override
format_bytes()
Definition: item_pfs_func.cc:158
String m_value
Definition: item_pfs_func.h:74
const char * func_name() const override
Definition: item_pfs_func.h:79
Item_str_func super
Definition: item_pfs_func.h:73
char m_value_buffer[20]
Definition: item_pfs_func.h:75
format_pico_time()
Definition: item_pfs_func.h:86
const char * func_name() const override
Definition: item_pfs_func.h:94
char m_value_buffer[20]
Definition: item_pfs_func.h:89
String m_value
Definition: item_pfs_func.h:88
String * val_str(String *str) override
Definition: item_pfs_func.cc:239
Item_str_func super
Definition: item_pfs_func.h:87
Item_func_pfs_format_pico_time(const POS &pos, Item *a)
Definition: item_pfs_func.h:92
bool resolve_type(THD *) override
format_pico_time()
Definition: item_pfs_func.cc:230
ps_thread_id()
Definition: item_pfs_func.h:57
bool resolve_type(THD *) override
Resolve type-related information for this item, such as result field type, maximum size,...
Definition: item_pfs_func.cc:103
bool do_itemize(Parse_context *pc, Item **res) override
ps_thread_id()
Definition: item_pfs_func.cc:96
longlong val_int() override
Definition: item_pfs_func.cc:111
const char * func_name() const override
Definition: item_pfs_func.h:65
Item_func_pfs_thread_id(const POS &pos, Item *a)
Definition: item_pfs_func.h:62
ulonglong m_thread_id
Definition: item_pfs_func.h:59
Item_int_func super
Definition: item_pfs_func.h:58
Definition: item_func.h:1019
Definition: item_strfunc.h:76
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
long long int longlong
Definition: my_inttypes.h:55
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
Our own string classes, used pervasively throughout the executor.
Bison "location" class.
Definition: parse_location.h:43
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:420