MySQL 8.0.39
Source Code Documentation
object_filter.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 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, 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
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef OBJECT_FILTER_INCLUDED
27#define OBJECT_FILTER_INCLUDED
28
29#include <optional>
30#include <string>
31#include <vector>
32
36
37namespace Mysql {
38namespace Tools {
39namespace Dump {
40
43 public:
45
46 void create_options() override;
47
49
50 std::vector<std::pair<std::string, std::string>> m_databases_excluded;
51 std::vector<std::pair<std::string, std::string>> m_databases_included;
52 std::vector<std::pair<std::string, std::string>> m_tables_excluded;
53 std::vector<std::pair<std::string, std::string>> m_tables_included;
54
55 private:
57 const std::string &schema_name, const std::string &object_name,
58 std::vector<std::pair<std::string, std::string>> *include_list,
59 std::vector<std::pair<std::string, std::string>> *exclude_list);
60 void include_databases_callback(char *);
61 void exclude_databases_callback(char *);
62 void include_tables_callback(char *);
63 void exclude_tables_callback(char *);
64 void include_routines_callback(char *);
65 void exclude_routines_callback(char *);
66 void include_triggers_callback(char *);
67 void exclude_triggers_callback(char *);
68 void include_events_callback(char *);
69 void exclude_events_callback(char *);
70 void include_users_callback(char *);
71 void exclude_users_callback(char *);
72
74 const std::string &object_name,
75 std::vector<std::pair<std::string, std::string>> *include_list,
76 std::vector<std::pair<std::string, std::string>> *exclude_list);
77
79 std::vector<std::pair<std::string, std::string>> &list,
80 bool allow_schema = true, bool is_user_object = false);
81
82 std::vector<std::pair<std::string, std::string>> m_routines_excluded;
83 std::vector<std::pair<std::string, std::string>> m_routines_included;
84 std::vector<std::pair<std::string, std::string>> m_triggers_excluded;
85 std::vector<std::pair<std::string, std::string>> m_triggers_included;
86 std::vector<std::pair<std::string, std::string>> m_events_excluded;
87 std::vector<std::pair<std::string, std::string>> m_events_included;
88 std::vector<std::pair<std::string, std::string>> m_users_included;
89 std::vector<std::pair<std::string, std::string>> m_users_excluded;
90
95 std::optional<std::string> m_include_tmp_string;
97};
98
99} // namespace Dump
100} // namespace Tools
101} // namespace Mysql
102
103#endif
Base class for all MySQL client tools.
Definition: abstract_program.h:47
Provider that aggregates options from other providers.
Definition: composite_options_provider.h:41
Base class for all main DB objects.
Definition: abstract_data_object.h:41
Definition: object_filter.h:42
bool is_object_included_in_dump(Abstract_data_object *object)
Definition: object_filter.cc:202
Mysql::Tools::Base::Abstract_program * m_program
Definition: object_filter.h:96
std::vector< std::pair< std::string, std::string > > m_routines_excluded
Definition: object_filter.h:82
void exclude_routines_callback(char *)
Definition: object_filter.cc:128
void include_events_callback(char *)
Definition: object_filter.cc:116
void exclude_users_callback(char *)
Definition: object_filter.cc:156
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:97
bool m_dump_routines
Definition: object_filter.h:91
std::optional< std::string > m_include_tmp_string
Definition: object_filter.h:95
void include_tables_callback(char *)
Definition: object_filter.cc:140
std::vector< std::pair< std::string, std::string > > m_triggers_excluded
Definition: object_filter.h:84
void exclude_events_callback(char *)
Definition: object_filter.cc:112
void include_routines_callback(char *)
Definition: object_filter.cc:132
std::vector< std::pair< std::string, std::string > > m_tables_excluded
Definition: object_filter.h:52
void create_options() override
Creates all options that will be provided.
Definition: object_filter.cc:271
void exclude_tables_callback(char *)
Definition: object_filter.cc:136
std::vector< std::pair< std::string, std::string > > m_events_included
Definition: object_filter.h:87
std::vector< std::pair< std::string, std::string > > m_users_excluded
Definition: object_filter.h:89
void include_triggers_callback(char *)
Definition: object_filter.cc:124
bool m_dump_triggers
Definition: object_filter.h:92
std::vector< std::pair< std::string, std::string > > m_events_excluded
Definition: object_filter.h:86
void exclude_triggers_callback(char *)
Definition: object_filter.cc:120
void include_users_callback(char *)
Definition: object_filter.cc:152
std::vector< std::pair< std::string, std::string > > m_users_included
Definition: object_filter.h:88
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:160
std::vector< std::pair< std::string, std::string > > m_databases_included
Definition: object_filter.h:51
Object_filter(Mysql::Tools::Base::Abstract_program *program)
Definition: object_filter.cc:373
bool m_dump_users
Definition: object_filter.h:94
std::vector< std::pair< std::string, std::string > > m_routines_included
Definition: object_filter.h:83
std::vector< std::pair< std::string, std::string > > m_triggers_included
Definition: object_filter.h:85
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:170
void include_databases_callback(char *)
Definition: object_filter.cc:148
bool m_dump_events
Definition: object_filter.h:93
std::vector< std::pair< std::string, std::string > > m_tables_included
Definition: object_filter.h:53
void exclude_databases_callback(char *)
Definition: object_filter.cc:144
std::vector< std::pair< std::string, std::string > > m_databases_excluded
Definition: object_filter.h:50
Definition: abstract_connection_program.h:38
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2874
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2878