MySQL 8.4.2
Source Code Documentation
statement_runnable.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef STATEMENT_RUNNABLE_H
25#define STATEMENT_RUNNABLE_H
26
27#include "lex_string.h"
28
29class THD;
30
31/*******************************************************************
32 * Server_runnable
33 *******************************************************************/
34
35/**
36 Execute a fragment of server code in an isolated context, so that
37 it doesn't leave any effect on THD. THD must have no open tables.
38 The code must not leave any open tables around.
39 The result of execution (if any) is stored in Ed_result.
40*/
41
43 public:
44 virtual bool execute_server_code(THD *thd) = 0;
46};
47
48/**
49 Execute one SQL statement in an isolated context.
50
51 Allows to execute a SQL statement from within another statement.
52 Supports even executing a SQL statement from within stored program.
53*/
54
56 public:
58 bool execute_server_code(THD *thd) override;
59
60 private:
62};
63
64#endif
Execute a fragment of server code in an isolated context, so that it doesn't leave any effect on THD.
Definition: statement_runnable.h:42
virtual bool execute_server_code(THD *thd)=0
virtual ~Server_runnable()
Execute one SQL statement in an isolated context.
Definition: statement_runnable.h:55
LEX_STRING m_sql_text
Definition: statement_runnable.h:61
bool execute_server_code(THD *thd) override
Parse and execute a statement.
Definition: statement_runnable.cc:50
Statement_runnable(LEX_STRING sql_text)
Definition: statement_runnable.cc:37
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: mysql_lex_string.h:35