MySQL 8.0.40
Source Code Documentation
classic_query_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_QUERY_FORWARDER_INCLUDED
27#define ROUTING_CLASSIC_QUERY_FORWARDER_INCLUDED
28
29#include <system_error>
30
33#include "stmt_classifier.h"
34
36 public:
37 using ForwardingProcessor::ForwardingProcessor;
38
39 enum class Stage {
40 Command,
41
42 Connect,
44
47 Column,
50 Row,
51 RowEnd,
52
54 Data,
55
56 Ok,
57 Error,
58
59 Done,
60 };
61
63
65 [[nodiscard]] Stage stage() const { return stage_; }
66
67 private:
74
81
84
86 net::const_buffer session_trackers,
88
90
92
93 uint64_t columns_left_{0};
94};
95
96#endif
a processor base class with helper functions.
Definition: forwarding_processor.h:34
Definition: classic_query_forwarder.h:35
stdx::expected< Result, std::error_code > response()
Definition: classic_query_forwarder.cc:732
stdx::expected< Result, std::error_code > row()
Definition: classic_query_forwarder.cc:927
void stage(Stage stage)
Definition: classic_query_forwarder.h:64
Stage
Definition: classic_query_forwarder.h:39
stdx::expected< Result, std::error_code > process() override
Definition: classic_query_forwarder.cc:51
stdx::expected< Result, std::error_code > row_end()
Definition: classic_query_forwarder.cc:936
stdx::expected< Result, std::error_code > connected()
Definition: classic_query_forwarder.cc:702
stdx::expected< Result, std::error_code > load_data()
Definition: classic_query_forwarder.cc:767
stdx::expected< Result, std::error_code > command()
Definition: classic_query_forwarder.cc:566
stdx::flags< StmtClassifier > stmt_classified_
Definition: classic_query_forwarder.h:89
stdx::expected< Result, std::error_code > column_end()
Definition: classic_query_forwarder.cc:831
stdx::expected< Result, std::error_code > error()
Definition: classic_query_forwarder.cc:1032
stdx::expected< Result, std::error_code > column_count()
Definition: classic_query_forwarder.cc:797
Stage stage_
Definition: classic_query_forwarder.h:91
stdx::expected< void, std::error_code > track_session_changes(net::const_buffer session_trackers, classic_protocol::capabilities::value_type caps)
stdx::expected< Result, std::error_code > connect()
Definition: classic_query_forwarder.cc:693
stdx::expected< Result, std::error_code > column()
Definition: classic_query_forwarder.cc:818
stdx::expected< Result, std::error_code > data()
Definition: classic_query_forwarder.cc:776
uint64_t columns_left_
Definition: classic_query_forwarder.h:93
Stage stage() const
Definition: classic_query_forwarder.h:65
stdx::expected< Result, std::error_code > row_or_end()
Definition: classic_query_forwarder.cc:890
stdx::expected< Result, std::error_code > ok()
Definition: classic_query_forwarder.cc:983
Definition: buffer.h:135
Definition: expected.h:944
a type-safe flags type.
Definition: flags.h:115
std::bitset< 32 > value_type
Definition: classic_protocol_constants.h:73