MySQL 8.3.0
Source Code Documentation
object_filter.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 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, version 2.0, 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 OBJECT_FILTER_INCLUDED
26#define OBJECT_FILTER_INCLUDED
27
28#include <optional>
29#include <string>
30#include <vector>
31
35
36namespace Mysql {
37namespace Tools {
38namespace Dump {
39
42 public:
44
45 void create_options() override;
46
48
49 std::vector<std::pair<std::string, std::string>> m_databases_excluded;
50 std::vector<std::pair<std::string, std::string>> m_databases_included;
51 std::vector<std::pair<std::string, std::string>> m_tables_excluded;
52 std::vector<std::pair<std::string, std::string>> m_tables_included;
53
54 private:
56 const std::string &schema_name, const std::string &object_name,
57 std::vector<std::pair<std::string, std::string>> *include_list,
58 std::vector<std::pair<std::string, std::string>> *exclude_list);
59 void include_databases_callback(char *);
60 void exclude_databases_callback(char *);
61 void include_tables_callback(char *);
62 void exclude_tables_callback(char *);
63 void include_routines_callback(char *);
64 void exclude_routines_callback(char *);
65 void include_triggers_callback(char *);
66 void exclude_triggers_callback(char *);
67 void include_events_callback(char *);
68 void exclude_events_callback(char *);
69 void include_users_callback(char *);
70 void exclude_users_callback(char *);
71
73 const std::string &object_name,
74 std::vector<std::pair<std::string, std::string>> *include_list,
75 std::vector<std::pair<std::string, std::string>> *exclude_list);
76
78 std::vector<std::pair<std::string, std::string>> &list,
79 bool allow_schema = true, bool is_user_object = false);
80
81 std::vector<std::pair<std::string, std::string>> m_routines_excluded;
82 std::vector<std::pair<std::string, std::string>> m_routines_included;
83 std::vector<std::pair<std::string, std::string>> m_triggers_excluded;
84 std::vector<std::pair<std::string, std::string>> m_triggers_included;
85 std::vector<std::pair<std::string, std::string>> m_events_excluded;
86 std::vector<std::pair<std::string, std::string>> m_events_included;
87 std::vector<std::pair<std::string, std::string>> m_users_included;
88 std::vector<std::pair<std::string, std::string>> m_users_excluded;
89
94 std::optional<std::string> m_include_tmp_string;
96};
97
98} // namespace Dump
99} // namespace Tools
100} // namespace Mysql
101
102#endif
Base class for all MySQL client tools.
Definition: abstract_program.h:46
Provider that aggregates options from other providers.
Definition: composite_options_provider.h:40
Base class for all main DB objects.
Definition: abstract_data_object.h:40
Definition: object_filter.h:41
bool is_object_included_in_dump(Abstract_data_object *object)
Definition: object_filter.cc:201
Mysql::Tools::Base::Abstract_program * m_program
Definition: object_filter.h:95
std::vector< std::pair< std::string, std::string > > m_routines_excluded
Definition: object_filter.h:81
void exclude_routines_callback(char *)
Definition: object_filter.cc:127
void include_events_callback(char *)
Definition: object_filter.cc:115
void exclude_users_callback(char *)
Definition: object_filter.cc:155
void process_object_inclusion_string(std::vector< std::pair< std::string, std::string > > &list, bool allow_schema=true, bool is_user_object=false)
Definition: object_filter.cc:96
bool m_dump_routines
Definition: object_filter.h:90
std::optional< std::string > m_include_tmp_string
Definition: object_filter.h:94
void include_tables_callback(char *)
Definition: object_filter.cc:139
std::vector< std::pair< std::string, std::string > > m_triggers_excluded
Definition: object_filter.h:83
void exclude_events_callback(char *)
Definition: object_filter.cc:111
void include_routines_callback(char *)
Definition: object_filter.cc:131
std::vector< std::pair< std::string, std::string > > m_tables_excluded
Definition: object_filter.h:51
void create_options() override
Creates all options that will be provided.
Definition: object_filter.cc:270
void exclude_tables_callback(char *)
Definition: object_filter.cc:135
std::vector< std::pair< std::string, std::string > > m_events_included
Definition: object_filter.h:86
std::vector< std::pair< std::string, std::string > > m_users_excluded
Definition: object_filter.h:88
void include_triggers_callback(char *)
Definition: object_filter.cc:123
bool m_dump_triggers
Definition: object_filter.h:91
std::vector< std::pair< std::string, std::string > > m_events_excluded
Definition: object_filter.h:85
void exclude_triggers_callback(char *)
Definition: object_filter.cc:119
void include_users_callback(char *)
Definition: object_filter.cc:151
std::vector< std::pair< std::string, std::string > > m_users_included
Definition: object_filter.h:87
bool is_user_included_by_lists(const std::string &object_name, std::vector< std::pair< std::string, std::string > > *include_list, std::vector< std::pair< std::string, std::string > > *exclude_list)
Definition: object_filter.cc:159
std::vector< std::pair< std::string, std::string > > m_databases_included
Definition: object_filter.h:50
Object_filter(Mysql::Tools::Base::Abstract_program *program)
Definition: object_filter.cc:372
bool m_dump_users
Definition: object_filter.h:93
std::vector< std::pair< std::string, std::string > > m_routines_included
Definition: object_filter.h:82
std::vector< std::pair< std::string, std::string > > m_triggers_included
Definition: object_filter.h:84
bool is_object_included_by_lists(const std::string &schema_name, const std::string &object_name, std::vector< std::pair< std::string, std::string > > *include_list, std::vector< std::pair< std::string, std::string > > *exclude_list)
Definition: object_filter.cc:169
void include_databases_callback(char *)
Definition: object_filter.cc:147
bool m_dump_events
Definition: object_filter.h:92
std::vector< std::pair< std::string, std::string > > m_tables_included
Definition: object_filter.h:52
void exclude_databases_callback(char *)
Definition: object_filter.cc:143
std::vector< std::pair< std::string, std::string > > m_databases_excluded
Definition: object_filter.h:49
Definition: abstract_connection_program.h:39
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2873
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2877