MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
check.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024, 2025, 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, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
19 * the GNU General Public License, version 2.0, 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 Foundation, Inc.,
23 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26#ifndef ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_DATABASE_JSON_MAPPER_VIEW_CHECK_H_
27#define ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_DATABASE_JSON_MAPPER_VIEW_CHECK_H_
28
29#include <map>
30#include <memory>
31#include <set>
32#include <string>
33#include <utility>
34#include <vector>
43
44namespace mrs {
45namespace database {
46namespace dv {
47
49 public:
50 Check(std::shared_ptr<Check> parent, std::shared_ptr<Table> table,
51 const ObjectRowOwnership &row_ownership, bool for_update,
52 std::shared_ptr<std::set<std::string>> invalid_fields = {},
53 bool unnested = false)
54 : Operation(parent, table, row_ownership),
55 invalid_fields_(invalid_fields),
56 unnested_(unnested),
58 if (!invalid_fields_) {
59 invalid_fields_ = std::make_shared<std::set<std::string>>();
60 }
61 }
62
63 Check(std::shared_ptr<Table> table, const ObjectRowOwnership &row_ownership,
64 bool for_update,
65 std::shared_ptr<std::set<std::string>> invalid_fields = {},
66 bool unnested = false)
67 : Check({}, table, row_ownership, for_update, invalid_fields, unnested) {}
68
69 void run(MySQLSession *) override { throw std::logic_error("invalid call"); }
70
71 void process(JSONInputObject input) override;
72
73 void on_value(const Column &column,
75
76 void on_no_value(const Column &column,
77 const JSONInputObject::MemberReference &) override;
78
80 JSONInputArray input) override;
81
83 JSONInputObject input) override;
84
85 private:
86 std::shared_ptr<std::set<std::string>> invalid_fields_;
87 bool unnested_ = false;
88 bool has_unnested_pk_ = false;
90};
91
92} // namespace dv
93} // namespace database
94} // namespace mrs
95
96#endif // ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_DATABASE_JSON_MAPPER_VIEW_CHECK_H_
Definition: object_row_ownership.h:45
Definition: check.h:48
void process(JSONInputObject input) override
Definition: check.cc:36
void on_no_value(const Column &column, const JSONInputObject::MemberReference &) override
Definition: check.cc:76
std::shared_ptr< std::set< std::string > > invalid_fields_
Definition: check.h:86
Check(std::shared_ptr< Table > table, const ObjectRowOwnership &row_ownership, bool for_update, std::shared_ptr< std::set< std::string > > invalid_fields={}, bool unnested=false)
Definition: check.h:63
Check(std::shared_ptr< Check > parent, std::shared_ptr< Table > table, const ObjectRowOwnership &row_ownership, bool for_update, std::shared_ptr< std::set< std::string > > invalid_fields={}, bool unnested=false)
Definition: check.h:50
bool for_update_
Definition: check.h:89
void process_to_one(const ForeignKeyReference &ref, JSONInputObject input) override
Definition: check.cc:144
void process_to_many(const ForeignKeyReference &ref, JSONInputArray input) override
Definition: check.cc:104
bool unnested_
Definition: check.h:87
void run(MySQLSession *) override
Definition: check.h:69
bool has_unnested_pk_
Definition: check.h:88
void on_value(const Column &column, const JSONInputObject::MemberReference &value) override
Definition: check.cc:65
Definition: json_input.h:157
Definition: json_input.h:61
std::shared_ptr< Operation > parent() const
Definition: change.h:82
const std::shared_ptr< Table > & table() const
Definition: change.h:80
Operation(std::shared_ptr< Operation > parent, std::shared_ptr< Table > table, const ObjectRowOwnership &row_ownership)
Definition: change.h:64
Definition: mysql_session.h:157
constexpr value_type for_update
Definition: classic_protocol_constants.h:214
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
entry::ForeignKeyReference ForeignKeyReference
Definition: select.h:54
entry::Column Column
Definition: select.h:53
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
Definition: authorize_manager.h:48