MySQL 8.3.0
Source Code Documentation
show_warnings_parser.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2023, 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 also distributed 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 included with MySQL.
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 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
25#ifndef ROUTING_SHOW_WARNINGS_PARSER_INCLUDED
26#define ROUTING_SHOW_WARNINGS_PARSER_INCLUDED
27
28#include "sql_parser.h"
29
30#include <limits>
31#include <variant>
32
34
36 public:
37 enum class Verbosity {
38 Warning,
39 Error,
40 };
41
43 uint64_t row_count = std::numeric_limits<uint64_t>().max(),
44 uint64_t offset = 0)
46
47 Verbosity verbosity() const { return verbosity_; }
48 uint64_t row_count() const { return row_count_; }
49 uint64_t offset() const { return offset_; }
50
51 private:
53
54 uint64_t row_count_;
55 uint64_t offset_;
56};
57
59 public:
60 enum class Scope { Local, Session, None };
61
63
66
67 Verbosity verbosity() const { return verbosity_; }
68 Scope scope() const { return scope_; }
69
70 private:
73};
74
75struct Limit {
76 uint64_t row_count{std::numeric_limits<uint64_t>::max()};
77 uint64_t offset{};
78};
79
81 public:
83
85 std::string>
86 parse();
87
88 protected:
90
92};
93
94#endif
Definition: show_warnings_parser.h:58
Scope scope() const
Definition: show_warnings_parser.h:68
Scope
Definition: show_warnings_parser.h:60
Scope scope_
Definition: show_warnings_parser.h:72
Verbosity verbosity_
Definition: show_warnings_parser.h:71
Verbosity verbosity() const
Definition: show_warnings_parser.h:67
ShowWarningCount(Verbosity verbosity, Scope scope)
Definition: show_warnings_parser.h:64
Definition: show_warnings_parser.h:80
stdx::expected< std::variant< std::monostate, ShowWarningCount, ShowWarnings >, std::string > parse()
Definition: show_warnings_parser.cc:33
stdx::expected< Limit, std::string > limit()
Definition: show_warnings_parser.cc:163
stdx::expected< ShowWarnings::Verbosity, std::string > warning_count_ident()
Definition: show_warnings_parser.cc:181
Definition: show_warnings_parser.h:35
uint64_t offset_
Definition: show_warnings_parser.h:55
uint64_t row_count() const
Definition: show_warnings_parser.h:48
Verbosity
Definition: show_warnings_parser.h:37
uint64_t offset() const
Definition: show_warnings_parser.h:49
Verbosity verbosity() const
Definition: show_warnings_parser.h:47
Verbosity verbosity_
Definition: show_warnings_parser.h:52
uint64_t row_count_
Definition: show_warnings_parser.h:54
ShowWarnings(Verbosity verbosity, uint64_t row_count=std::numeric_limits< uint64_t >().max(), uint64_t offset=0)
Definition: show_warnings_parser.h:42
Definition: sql_parser.h:35
SqlParser(SqlLexer::iterator first, SqlLexer::iterator last)
Definition: sql_parser.h:37
Definition: expected.h:943
Definition: show_warnings_parser.h:75
uint64_t row_count
Definition: show_warnings_parser.h:76
uint64_t offset
Definition: show_warnings_parser.h:77