MySQL 8.4.2
Source Code Documentation
classic_stmt_prepare_forwarder.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2023, 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_CLASSIC_STMT_PREPARE_FORWARDER_INCLUDED
27#define ROUTING_CLASSIC_STMT_PREPARE_FORWARDER_INCLUDED
28
30
32
34 public:
35 using ForwardingProcessor::ForwardingProcessor;
36
37 enum class Stage {
38 Command,
39
41
45
46 Connect,
48 Forward,
51 Column,
53 Param,
55 Ok,
56 OkDone,
57 Error,
58 Done,
59 };
60
61 static std::string_view prefix() { return "mysql/stmt_prepare"; }
62
64
66 Stage stage() const { return stage_; }
67
68 private:
86
87 bool has_more_messages() const;
88
90
91 size_t columns_left_{0};
92 size_t params_left_{0};
93
94 uint16_t stmt_id_{};
96
100};
101
102#endif
a processor base class with helper functions.
Definition: forwarding_processor.h:38
Definition: classic_stmt_prepare_forwarder.h:33
stdx::expected< Result, std::error_code > prepare_backend()
Definition: classic_stmt_prepare_forwarder.cc:329
stdx::expected< Result, std::error_code > end_of_columns()
Definition: classic_stmt_prepare_forwarder.cc:600
stdx::expected< Result, std::error_code > column()
Definition: classic_stmt_prepare_forwarder.cc:576
stdx::expected< Result, std::error_code > ok()
Definition: classic_stmt_prepare_forwarder.cc:431
stdx::expected< Result, std::error_code > end_of_params()
Definition: classic_stmt_prepare_forwarder.cc:528
stdx::expected< Result, std::error_code > command()
Definition: classic_stmt_prepare_forwarder.cc:101
stdx::expected< Result, std::error_code > error()
Definition: classic_stmt_prepare_forwarder.cc:625
stdx::expected< Result, std::error_code > forward_done()
Definition: classic_stmt_prepare_forwarder.cc:391
Stage
Definition: classic_stmt_prepare_forwarder.h:37
TraceEvent * trace_event_command_
Definition: classic_stmt_prepare_forwarder.h:97
stdx::expected< Result, std::error_code > forbid_command()
Definition: classic_stmt_prepare_forwarder.cc:258
stdx::expected< Result, std::error_code > switch_backend()
Definition: classic_stmt_prepare_forwarder.cc:310
void stage(Stage stage)
Definition: classic_stmt_prepare_forwarder.h:65
static std::string_view prefix()
Definition: classic_stmt_prepare_forwarder.h:61
uint16_t stmt_id_
Definition: classic_stmt_prepare_forwarder.h:94
stdx::expected< Result, std::error_code > pool_backend()
Definition: classic_stmt_prepare_forwarder.cc:285
Stage stage_
Definition: classic_stmt_prepare_forwarder.h:89
stdx::expected< Result, std::error_code > response()
Definition: classic_stmt_prepare_forwarder.cc:401
stdx::expected< Result, std::error_code > connect()
Definition: classic_stmt_prepare_forwarder.cc:342
bool has_more_messages() const
Definition: classic_stmt_prepare_forwarder.cc:481
stdx::expected< Result, std::error_code > process() override
Definition: classic_stmt_prepare_forwarder.cc:57
Stage stage() const
Definition: classic_stmt_prepare_forwarder.h:66
PreparedStatement prep_stmt_
Definition: classic_stmt_prepare_forwarder.h:95
stdx::expected< Result, std::error_code > param()
Definition: classic_stmt_prepare_forwarder.cc:486
stdx::expected< Result, std::error_code > connected()
Definition: classic_stmt_prepare_forwarder.cc:352
TraceEvent * trace_event_forward_command_
Definition: classic_stmt_prepare_forwarder.h:99
size_t params_left_
Definition: classic_stmt_prepare_forwarder.h:92
stdx::expected< Result, std::error_code > ok_done()
Definition: classic_stmt_prepare_forwarder.cc:611
TraceEvent * trace_event_connect_and_forward_command_
Definition: classic_stmt_prepare_forwarder.h:98
size_t columns_left_
Definition: classic_stmt_prepare_forwarder.h:91
stdx::expected< Result, std::error_code > forward()
Definition: classic_stmt_prepare_forwarder.cc:385
Definition: expected.h:284
Definition: classic_prepared_statement.h:33
Definition: trace_span.h:35