MySQL 9.1.0
Source Code Documentation
show_warnings_parser.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_SHOW_WARNINGS_PARSER_INCLUDED
27#define ROUTING_SHOW_WARNINGS_PARSER_INCLUDED
28
29#include "sql_parser.h"
30
31#include <limits>
32#include <variant>
33
35
37 public:
38 enum class Verbosity {
39 Warning,
40 Error,
41 };
42
44 uint64_t row_count = std::numeric_limits<uint64_t>().max(),
45 uint64_t offset = 0)
47
48 Verbosity verbosity() const { return verbosity_; }
49 uint64_t row_count() const { return row_count_; }
50 uint64_t offset() const { return offset_; }
51
52 private:
54
55 uint64_t row_count_;
56 uint64_t offset_;
57};
58
60 public:
61 enum class Scope { Local, Session, None };
62
64
67
68 Verbosity verbosity() const { return verbosity_; }
69 Scope scope() const { return scope_; }
70
71 private:
74};
75
76struct Limit {
77 uint64_t row_count{std::numeric_limits<uint64_t>::max()};
78 uint64_t offset{};
79};
80
82 public:
84
86 std::string>
87 parse();
88
89 protected:
91
93};
94
95#endif
Definition: show_warnings_parser.h:59
Scope scope() const
Definition: show_warnings_parser.h:69
Scope
Definition: show_warnings_parser.h:61
Scope scope_
Definition: show_warnings_parser.h:73
Verbosity verbosity_
Definition: show_warnings_parser.h:72
Verbosity verbosity() const
Definition: show_warnings_parser.h:68
ShowWarningCount(Verbosity verbosity, Scope scope)
Definition: show_warnings_parser.h:65
Definition: show_warnings_parser.h:81
stdx::expected< std::variant< std::monostate, ShowWarningCount, ShowWarnings >, std::string > parse()
Definition: show_warnings_parser.cc:34
stdx::expected< Limit, std::string > limit()
Definition: show_warnings_parser.cc:172
stdx::expected< ShowWarnings::Verbosity, std::string > warning_count_ident()
Definition: show_warnings_parser.cc:190
Definition: show_warnings_parser.h:36
uint64_t offset_
Definition: show_warnings_parser.h:56
uint64_t row_count() const
Definition: show_warnings_parser.h:49
Verbosity
Definition: show_warnings_parser.h:38
uint64_t offset() const
Definition: show_warnings_parser.h:50
Verbosity verbosity() const
Definition: show_warnings_parser.h:48
Verbosity verbosity_
Definition: show_warnings_parser.h:53
uint64_t row_count_
Definition: show_warnings_parser.h:55
ShowWarnings(Verbosity verbosity, uint64_t row_count=std::numeric_limits< uint64_t >().max(), uint64_t offset=0)
Definition: show_warnings_parser.h:43
Definition: sql_parser.h:36
SqlParser(SqlLexer::iterator first, SqlLexer::iterator last)
Definition: sql_parser.h:38
Definition: expected.h:286
Definition: show_warnings_parser.h:76
uint64_t row_count
Definition: show_warnings_parser.h:77
uint64_t offset
Definition: show_warnings_parser.h:78