MySQL 8.3.0
Source Code Documentation
acl_change_notification.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22*/
23
24#ifndef ACL_CHANGE_NOTIFICATION_INCLUDED
25#define ACL_CHANGE_NOTIFICATION_INCLUDED
26
27#include "my_sqlcommand.h" // enum_sql_command
28#include "sql/sql_rewrite.h" // User_params
29#include "sql/table.h" // LEX_USER, LEX_CSTRING, List
30
32 public:
33 struct Priv : public std::string {
34 Priv(const LEX_CSTRING &lex_priv)
35 : std::string{lex_priv.str, lex_priv.length} {}
36 };
37 struct User {
38 std::string name;
39 std::string host;
40 User(const LEX_USER &lex_user)
41 : name(lex_user.user.str, lex_user.user.length),
42 host(lex_user.host.str, lex_user.host.length) {}
43 };
45 const List<LEX_USER> *users,
46 std::set<LEX_USER *> *rewrite_params,
48
49 private:
50 const std::string db;
57
58 public:
60 const std::string &get_db() const { return db; }
61 auto &get_user_list() const { return users; }
62 auto &get_dynamic_privilege_list() const { return dynamic_privs; }
64 if (rewrite_user_params.users == nullptr) return nullptr;
65 return &rewrite_user_params;
66 }
67};
68
69#endif
Definition: acl_change_notification.h:31
const std::string db
Definition: acl_change_notification.h:50
const User_params * get_rewrite_params() const
Definition: acl_change_notification.h:63
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:577
const List< LEX_USER > & users
Definition: acl_change_notification.h:53
auto & get_user_list() const
Definition: acl_change_notification.h:61
const std::string & get_db() const
Definition: acl_change_notification.h:60
auto & get_dynamic_privilege_list() const
Definition: acl_change_notification.h:62
const List< LEX_USER > empty_users
Definition: acl_change_notification.h:52
const enum_sql_command operation
Definition: acl_change_notification.h:51
enum_sql_command get_operation() const
Definition: acl_change_notification.h:59
const List< LEX_CSTRING > empty_dynamic_privs
Definition: acl_change_notification.h:55
const List< LEX_CSTRING > & dynamic_privs
Definition: acl_change_notification.h:56
const User_params rewrite_user_params
Definition: acl_change_notification.h:54
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:35
Wrapper object for user related parameters required by: SET PASSWORD|CREATE USER|ALTER USER statement...
Definition: sql_rewrite.h:60
std::set< LEX_USER * > * users
Definition: sql_rewrite.h:64
enum_sql_command
Definition: my_sqlcommand.h:45
char * user
Definition: mysqladmin.cc:64
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1065
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:75
Definition: varlen_sort.h:174
Definition: acl_change_notification.h:33
Priv(const LEX_CSTRING &lex_priv)
Definition: acl_change_notification.h:34
Definition: acl_change_notification.h:37
std::string name
Definition: acl_change_notification.h:38
std::string host
Definition: acl_change_notification.h:39
User(const LEX_USER &lex_user)
Definition: acl_change_notification.h:40
Definition: table.h:2720
Definition: mysql_lex_string.h:39