MySQL 8.3.0
Source Code Documentation
acl_table::Acl_table_user_reader Class Reference

mysql.user table reader. More...

#include <acl_table_user.h>

Inheritance diagram for acl_table::Acl_table_user_reader:
[legend]

Public Member Functions

 Acl_table_user_reader (THD *thd, TABLE *table)
 mysql.user table reader constructor. More...
 
 ~Acl_table_user_reader () override
 Free resources before we destroy. More...
 
bool driver ()
 Driver function for mysql.user reader. More...
 
bool setup_table (bool &is_old_db_layout)
 Make table ready to read. More...
 
bool read_row (bool &is_old_db_layout, bool &super_users_with_empty_plugin)
 Read a row from mysql.user table and add it to in-memory structure. More...
 
Acl_table_op_status finish_operation (Table_op_error_code &error) override
 Finish mysql.user table read operation. More...
 
void reset_acl_user (ACL_USER &user)
 Scrub ACL_USER. More...
 
void read_account_name (ACL_USER &user)
 Get user and host information for the account. More...
 
bool read_authentication_string (ACL_USER &user)
 Read authentication string for the account. More...
 
void read_privileges (ACL_USER &user)
 Get global privilege information. More...
 
void read_ssl_fields (ACL_USER &user)
 Read SSL restrictions. More...
 
void read_user_resources (ACL_USER &user)
 Read user resource restrictions. More...
 
bool read_plugin_info (ACL_USER &user, bool &super_users_with_empty_plugin, bool &is_old_db_layout)
 Read plugin information. More...
 
bool read_password_expiry (ACL_USER &user, bool &password_expired)
 Read password expiry field. More...
 
void read_password_locked (ACL_USER &user)
 Determine if user account is locked. More...
 
void read_password_last_changed (ACL_USER &user)
 Get password change time. More...
 
void read_password_lifetime (ACL_USER &user)
 Get password expiry policy infomration. More...
 
void read_password_history_fields (ACL_USER &user)
 Get password history restriction. More...
 
void read_password_reuse_time_fields (ACL_USER &user)
 Get password reuse time restriction. More...
 
void read_password_require_current (ACL_USER &user)
 Get information about requiring current password while changing password. More...
 
bool read_user_attributes (ACL_USER &user)
 Read user attributes. More...
 
void add_row_to_acl_users (ACL_USER &user)
 Add a recently read row in acl_users. More...
 
- Public Member Functions inherited from acl_table::Acl_table
 Acl_table (THD *thd, TABLE *table, Acl_table_operation operation)
 
virtual ~Acl_table ()=default
 
 Acl_table (const Acl_table &)=delete
 
const Acl_tableoperator= (const Acl_table &)=delete
 
 Acl_table (const Acl_table &&)=delete
 
const Acl_tableoperator= (const Acl_table &&)=delete
 
Acl_table_operation get_operation_mode ()
 

Private Attributes

User_table_schemam_table_schema = nullptr
 
unique_ptr_destroy_only< RowIteratorm_iterator
 
MEM_ROOT m_mem_root {PSI_NOT_INSTRUMENTED, ACL_ALLOC_BLOCK_SIZE}
 
Restrictionsm_restrictions = nullptr
 
Json_objectm_user_application_user_metadata_json = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from acl_table::Acl_table
Acl_table_op_status convert_table_op_error_code ()
 
- Protected Attributes inherited from acl_table::Acl_table
THDm_thd
 
TABLEm_table
 
Acl_table_operation m_operation
 
Table_op_error_code m_error
 

Detailed Description

mysql.user table reader.

It reads all raws from table and create in-memory cache.

Constructor & Destructor Documentation

◆ Acl_table_user_reader()

acl_table::Acl_table_user_reader::Acl_table_user_reader ( THD thd,
TABLE table 
)

mysql.user table reader constructor.

Parameters
[in]thdHandle to THD object. Must be non-null
[in]tablemysql.user table handle. Must be non-null

◆ ~Acl_table_user_reader()

acl_table::Acl_table_user_reader::~Acl_table_user_reader ( )
override

Free resources before we destroy.

Member Function Documentation

◆ add_row_to_acl_users()

void acl_table::Acl_table_user_reader::add_row_to_acl_users ( ACL_USER user)

Add a recently read row in acl_users.

Parameters
[in]userACL_USER structure

◆ driver()

bool acl_table::Acl_table_user_reader::driver ( )

Driver function for mysql.user reader.

Reads rows from table. If a row is valid, adds corresponding information to in-memory structure.

Returns
status of reading mysql.user table
Return values
falseSuccess
trueError reading the table. Probably corrupt.

◆ finish_operation()

Acl_table_op_status acl_table::Acl_table_user_reader::finish_operation ( Table_op_error_code error)
overridevirtual

Finish mysql.user table read operation.

Parameters
[in]errorTable operation error.
Returns
OK status, always.

Implements acl_table::Acl_table.

◆ read_account_name()

void acl_table::Acl_table_user_reader::read_account_name ( ACL_USER user)

Get user and host information for the account.

Parameters
[out]userACL_USER structure

◆ read_authentication_string()

bool acl_table::Acl_table_user_reader::read_authentication_string ( ACL_USER user)

Read authentication string for the account.

We do verification later.

Parameters
[out]userACL_USER structure
Returns
Status of reading authentication data.
Return values
falseSuccess
trueError reading the field. Skip user.

◆ read_password_expiry()

bool acl_table::Acl_table_user_reader::read_password_expiry ( ACL_USER user,
bool &  password_expired 
)

Read password expiry field.

Parameters
[out]userACL_USER structure
[out]password_expiredWhether password is expired or not
Returns
Status of reading password expiry value
Return values
falseSuccess
truePassword expiry was set to TRUE for a plugin that does not support password expiration. Skip user.

◆ read_password_history_fields()

void acl_table::Acl_table_user_reader::read_password_history_fields ( ACL_USER user)

Get password history restriction.

Parameters
[out]userACL_USER structure

◆ read_password_last_changed()

void acl_table::Acl_table_user_reader::read_password_last_changed ( ACL_USER user)

Get password change time.

Parameters
[out]userACL_USER structure

◆ read_password_lifetime()

void acl_table::Acl_table_user_reader::read_password_lifetime ( ACL_USER user)

Get password expiry policy infomration.

Parameters
[out]userACL_USER structure

◆ read_password_locked()

void acl_table::Acl_table_user_reader::read_password_locked ( ACL_USER user)

Determine if user account is locked.

Parameters
[out]userACL_USER structure

◆ read_password_require_current()

void acl_table::Acl_table_user_reader::read_password_require_current ( ACL_USER user)

Get information about requiring current password while changing password.

Parameters
[out]userACL_USER structure

◆ read_password_reuse_time_fields()

void acl_table::Acl_table_user_reader::read_password_reuse_time_fields ( ACL_USER user)

Get password reuse time restriction.

Parameters
[out]userACL_USER structure

◆ read_plugin_info()

bool acl_table::Acl_table_user_reader::read_plugin_info ( ACL_USER user,
bool &  super_users_with_empty_plugin,
bool &  is_old_db_layout 
)

Read plugin information.

If it is old layout read accordingly. Also, validate authentication string against expected format for the plugin.

Parameters
[out]userACL_USER structure
[out]super_users_with_empty_pluginUser has SUPER privilege or not
[in]is_old_db_layoutWe are reading from old table
Returns
status of reading plugin information
Return values
falseSuccess
trueError. Skip user.

◆ read_privileges()

void acl_table::Acl_table_user_reader::read_privileges ( ACL_USER user)

Get global privilege information.

Parameters
[out]userACL_USER structure

◆ read_row()

bool acl_table::Acl_table_user_reader::read_row ( bool &  is_old_db_layout,
bool &  super_users_with_empty_plugin 
)

Read a row from mysql.user table and add it to in-memory structure.

Parameters
[in]is_old_db_layoutmysql.user table is in old format
[in]super_users_with_empty_pluginUser has SUPER privilege
Returns
Status of reading a row
Return values
falseSuccess
trueError reading the row. Unless critical, keep reading further.

◆ read_ssl_fields()

void acl_table::Acl_table_user_reader::read_ssl_fields ( ACL_USER user)

Read SSL restrictions.

Parameters
[out]userACL_USER structure

◆ read_user_attributes()

bool acl_table::Acl_table_user_reader::read_user_attributes ( ACL_USER user)

Read user attributes.

Parameters
[out]userACL_USER structure
Returns
status of reading user_attributes column
Return values
falseSuccess
trueError reading user_attributes column

◆ read_user_resources()

void acl_table::Acl_table_user_reader::read_user_resources ( ACL_USER user)

Read user resource restrictions.

Parameters
[out]userACL_USER structure

◆ reset_acl_user()

void acl_table::Acl_table_user_reader::reset_acl_user ( ACL_USER user)

Scrub ACL_USER.

Parameters
[out]userACL_USER to be updated

◆ setup_table()

bool acl_table::Acl_table_user_reader::setup_table ( bool &  is_old_db_layout)

Make table ready to read.

Parameters
[out]is_old_db_layoutTo see if this is a case of running new binary with old data directory without running mysql_upgrade.
Returns
status of initialization
Return values
falseSuccess
trueError initializing table

Member Data Documentation

◆ m_iterator

unique_ptr_destroy_only<RowIterator> acl_table::Acl_table_user_reader::m_iterator
private

◆ m_mem_root

MEM_ROOT acl_table::Acl_table_user_reader::m_mem_root {PSI_NOT_INSTRUMENTED, ACL_ALLOC_BLOCK_SIZE}
private

◆ m_restrictions

Restrictions* acl_table::Acl_table_user_reader::m_restrictions = nullptr
private

◆ m_table_schema

User_table_schema* acl_table::Acl_table_user_reader::m_table_schema = nullptr
private

◆ m_user_application_user_metadata_json

Json_object* acl_table::Acl_table_user_reader::m_user_application_user_metadata_json = nullptr
private

The documentation for this class was generated from the following files: