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