MySQL 8.0.39
Source Code Documentation
acl_change_notification.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#ifndef ACL_CHANGE_NOTIFICATION_INCLUDED
26#define ACL_CHANGE_NOTIFICATION_INCLUDED
27
28#include "my_sqlcommand.h" // enum_sql_command
29#include "sql/sql_rewrite.h" // User_params
30#include "sql/table.h" // LEX_USER, LEX_CSTRING, List
31
33 public:
34 struct Priv : public std::string {
35 Priv(const LEX_CSTRING &lex_priv)
36 : std::string{lex_priv.str, lex_priv.length} {}
37 };
38 struct User {
39 std::string name;
40 std::string host;
41 User(const LEX_USER &lex_user)
42 : name(lex_user.user.str, lex_user.user.length),
43 host(lex_user.host.str, lex_user.host.length) {}
44 };
46 const List<LEX_USER> *users,
47 std::set<LEX_USER *> *rewrite_params,
49
50 private:
51 const std::string db;
58
59 public:
61 const std::string &get_db() const { return db; }
62 auto &get_user_list() const { return users; }
63 auto &get_dynamic_privilege_list() const { return dynamic_privs; }
65 if (rewrite_user_params.users == nullptr) return nullptr;
66 return &rewrite_user_params;
67 }
68};
69
70#endif
Definition: acl_change_notification.h:32
const std::string db
Definition: acl_change_notification.h:51
const User_params * get_rewrite_params() const
Definition: acl_change_notification.h:64
Acl_change_notification(THD *thd, enum_sql_command op, const List< LEX_USER > *users, std::set< LEX_USER * > *rewrite_params, const List< LEX_CSTRING > *dynamic_privs)
Notify handlerton(s) that privileges have changed.
Definition: sql_user_table.cc:576
const List< LEX_USER > & users
Definition: acl_change_notification.h:54
auto & get_user_list() const
Definition: acl_change_notification.h:62
const std::string & get_db() const
Definition: acl_change_notification.h:61
auto & get_dynamic_privilege_list() const
Definition: acl_change_notification.h:63
const List< LEX_USER > empty_users
Definition: acl_change_notification.h:53
const enum_sql_command operation
Definition: acl_change_notification.h:52
enum_sql_command get_operation() const
Definition: acl_change_notification.h:60
const List< LEX_CSTRING > empty_dynamic_privs
Definition: acl_change_notification.h:56
const List< LEX_CSTRING > & dynamic_privs
Definition: acl_change_notification.h:57
const User_params rewrite_user_params
Definition: acl_change_notification.h:55
Definition: sql_list.h:434
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Wrapper object for user related parameters required by: SET PASSWORD|CREATE USER|ALTER USER statement...
Definition: sql_rewrite.h:61
std::set< LEX_USER * > * users
Definition: sql_rewrite.h:65
enum_sql_command
Definition: my_sqlcommand.h:46
char * user
Definition: mysqladmin.cc:60
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Definition: gcs_xcom_synode.h:64
Definition: acl_change_notification.h:34
Priv(const LEX_CSTRING &lex_priv)
Definition: acl_change_notification.h:35
Definition: acl_change_notification.h:38
std::string name
Definition: acl_change_notification.h:39
std::string host
Definition: acl_change_notification.h:40
User(const LEX_USER &lex_user)
Definition: acl_change_notification.h:41
Definition: table.h:2658
Definition: mysql_lex_string.h:40