MySQL 8.0.40
Source Code Documentation
sql_lexer_thd.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2022, 2024, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef ROUTING_SQL_LEXER_THD_INCLUDED
27#define ROUTING_SQL_LEXER_THD_INCLUDED
28
29#include "m_ctype.h" // CHARSET_INFO
30#include "my_alloc.h" // MEM_ROOT
31#include "my_sys.h" // strmake_root
33
34class THD {
35 public:
37
38 MEM_ROOT *mem_root{nullptr}; // Pointer to current memroot
39
41 bool convert_string(LEX_STRING * /* to */, const CHARSET_INFO * /* to_cs */,
42 const char * /* from */, size_t /* from_length */,
43 const CHARSET_INFO * /* from_cs */,
44 bool /* report_error */ = false) {
45 return true;
46 }
47
48 void *alloc(size_t size) { return mem_root->Alloc(size); }
49
50 char *strmake(const char *str, size_t size) const {
51 return strmake_root(mem_root, str, size);
52 }
53
54 public:
60 };
61
63
65};
66
67#endif
Internal state of the parser.
Definition: sql_lexer_parser_state.h:44
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
void * alloc(size_t size)
Definition: sql_lexer_thd.h:48
Parser_state * m_parser_state
Internal parser state.
Definition: sql_lexer_thd.h:64
System_variables variables
Definition: sql_lexer_thd.h:62
bool convert_string(LEX_STRING *, const CHARSET_INFO *, const char *, size_t, const CHARSET_INFO *, bool=false)
Definition: sql_lexer_thd.h:41
const CHARSET_INFO * charset() const
Definition: sql_lexer_thd.h:40
char * strmake(const char *str, size_t size) const
Definition: sql_lexer_thd.h:50
MEM_ROOT * mem_root
Definition: sql_lexer_thd.h:38
ulonglong sql_mode_t
Definition: sql_lexer_thd.h:36
char * strmake_root(MEM_ROOT *root, const char *str, size_t len)
Definition: my_alloc.cc:286
A better implementation of the UNIX ctype(3) library.
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_0900_ai_ci
Definition: ctype-uca.cc:9564
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1
Definition: ctype-latin1.cc:368
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Common header for many mysys elements.
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
Definition: m_ctype.h:385
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:145
Definition: mysql_lex_string.h:35
Definition: sql_lexer_thd.h:55
sql_mode_t sql_mode
Definition: sql_lexer_thd.h:56
const CHARSET_INFO * character_set_client
Definition: sql_lexer_thd.h:57
const CHARSET_INFO * default_collation_for_utf8mb4
Definition: sql_lexer_thd.h:58