MySQL 8.4.0
Source Code Documentation
sql_call.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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 SQL_CALL_INCLUDED
25#define SQL_CALL_INCLUDED
26
27#include "my_sqlcommand.h"
28#include "sql/sql_cmd_dml.h" // Sql_cmd_dml
29
30class Item;
31class THD;
32class sp_name;
33template <class T>
34class mem_root_deque;
35
36class Sql_cmd_call final : public Sql_cmd_dml {
37 public:
38 explicit Sql_cmd_call(sp_name *proc_name_arg,
39 mem_root_deque<Item *> *prog_args_arg)
40 : Sql_cmd_dml(), proc_name(proc_name_arg), proc_args(prog_args_arg) {}
41
42 enum_sql_command sql_command_code() const override { return SQLCOM_CALL; }
43
44 bool is_data_change_stmt() const override { return false; }
45
46 protected:
47 bool precheck(THD *thd) override;
48 bool check_privileges(THD *thd) override;
49
50 bool prepare_inner(THD *thd) override;
51
52 bool execute_inner(THD *thd) override;
53
54 private:
57};
58
59#endif /* SQL_CALL_INCLUDED */
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:934
Definition: sql_call.h:36
mem_root_deque< Item * > * proc_args
Definition: sql_call.h:56
bool prepare_inner(THD *thd) override
Perform the command-specific parts of DML command preparation, to be called from prepare()
Definition: sql_call.cc:116
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_call.h:42
Sql_cmd_call(sp_name *proc_name_arg, mem_root_deque< Item * > *prog_args_arg)
Definition: sql_call.h:38
bool execute_inner(THD *thd) override
The inner parts of query optimization and execution.
Definition: sql_call.cc:185
bool check_privileges(THD *thd) override
Check privileges on a prepared statement, called at start of execution of the statement.
Definition: sql_call.cc:72
bool precheck(THD *thd) override
Perform a precheck of table privileges for the specific operation.
Definition: sql_call.cc:59
sp_name * proc_name
Definition: sql_call.h:55
bool is_data_change_stmt() const override
Definition: sql_call.h:44
Definition: sql_cmd_dml.h:35
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
Definition: sp_head.h:123
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_CALL
Definition: my_sqlcommand.h:138