MySQL 8.0.39
Source Code Documentation
Rewriter_show_create_user Class Referencefinal

Rewrites the SHOW CREATE USER statement. More...

#include <sql_rewrite.h>

Inheritance diagram for Rewriter_show_create_user:
[legend]

Public Member Functions

 Rewriter_show_create_user (THD *thd, Consumer_type type, const Rewrite_params *params)
 
bool rewrite (String &rlb) const override
 Rewrite the query for the SHOW CREATE USER statement. More...
 
void rewrite_user_application_user_metadata (const LEX *lex, String *str) const override
 Overrides implementation of the the rewriter for user application user metadata. More...
 
- Public Member Functions inherited from I_rewriter
 I_rewriter (THD *thd, Consumer_type type)
 
virtual ~I_rewriter ()
 
 I_rewriter (const I_rewriter &)=delete
 
const I_rewriteroperator= (const I_rewriter &)=delete
 
 I_rewriter (const I_rewriter &&)=delete
 
const I_rewriteroperator= (const I_rewriter &&)=delete
 
void set_consumer_type (Consumer_type type)
 Reset the previous consumer type. More...
 
Consumer_type consumer_type ()
 Return the current consumer type set in the object. More...
 

Protected Member Functions

void append_auth_str (LEX_USER *lex, String *str) const override
 A special rewriter override to make SHOW CREATE USER convert the string to hex if print_identified_with_as hex is on. More...
 
- Protected Member Functions inherited from Rewriter_user
 Rewriter_user (THD *thd, Consumer_type target_type)
 
void rewrite_users (LEX *lex, String *str) const
 Fetch the users from user_list in LEX struct and append them to the String. More...
 
void append_literal_secret (String *str) const
 Append the literal <secret> in place of password to the output string. More...
 
void append_plugin_name (const LEX_USER *user, String *str) const
 Append the authentication plugin name for the user. More...
 
void append_mfa_plugin_name (const LEX_MFA *user, String *str) const
 Append the authentication plugin name from LEX_MFA for the user. More...
 
void append_mfa_auth_str (const LEX_MFA *user, String *str) const
 Append the authentication string from LEX_MFA for the user. More...
 
void rewrite_in_memory_user_application_user_metadata (const LEX *user, String *str) const
 Use the LEX for reconstructing the ATTRIBUTE or COMMENT clause. More...
 

Private Types

using parent = Rewriter_user
 

Private Member Functions

void append_user_auth_info (LEX_USER *user, bool comma, String *str) const override
 Append the authID, plugin name and suth str user to output string. More...
 
void rewrite_password_history (const LEX *lex, String *str) const override
 Append the PASSWORD HISTORY clause for users. More...
 
void rewrite_password_reuse (const LEX *lex, String *str) const override
 Append the PASSWORD REUSE clause for users. More...
 

Private Attributes

const Show_user_paramsshow_params_
 

Additional Inherited Members

- Protected Attributes inherited from I_rewriter
THD *const m_thd
 
Consumer_type m_consumer_type
 

Detailed Description

Rewrites the SHOW CREATE USER statement.

Member Typedef Documentation

◆ parent

Constructor & Destructor Documentation

◆ Rewriter_show_create_user()

Rewriter_show_create_user::Rewriter_show_create_user ( THD thd,
Consumer_type  type,
const Rewrite_params params 
)

Member Function Documentation

◆ append_auth_str()

void Rewriter_show_create_user::append_auth_str ( LEX_USER user,
String str 
) const
overrideprotectedvirtual

A special rewriter override to make SHOW CREATE USER convert the string to hex if print_identified_with_as hex is on.

Parameters
[in]userLEX_USER to fetch the auth string of it.
[in,out]strThe string in which hash value is suffixed
See also
Rewriter_user::append_auth_str

Reimplemented from Rewriter_user.

◆ append_user_auth_info()

void Rewriter_show_create_user::append_user_auth_info ( LEX_USER user,
bool  comma,
String str 
) const
overrideprivatevirtual

Append the authID, plugin name and suth str user to output string.

Parameters
[in]userLex user to fetch the info
[in]commaseparator to be prefixed while appending user info
[in,out]strString to which user auth info is suffixed.

Implements Rewriter_user.

◆ rewrite()

bool Rewriter_show_create_user::rewrite ( String rlb) const
overridevirtual

Rewrite the query for the SHOW CREATE USER statement.

This method takes an additional parameter from the Show_user_params to reconstruct the ATTRIBUTE clause. These parameters must be read form disk which is done in mysql_show_create_user()

See also
mysql_show_create_user()
Parameters
[in,out]rlbBuffer to return the rewritten query in.
Return values
trueThe query was rewritten.

Reimplemented from Rewriter_user.

◆ rewrite_password_history()

void Rewriter_show_create_user::rewrite_password_history ( const LEX lex,
String str 
) const
overrideprivatevirtual

Append the PASSWORD HISTORY clause for users.

Parameters
[in]lexLEX struct to check if clause is specified
[in,out]strThe string in which clause is suffixed

Implements Rewriter_user.

◆ rewrite_password_reuse()

void Rewriter_show_create_user::rewrite_password_reuse ( const LEX lex,
String str 
) const
overrideprivatevirtual

Append the PASSWORD REUSE clause for users.

Parameters
[in]lexLEX struct to check if clause is specified
[in,out]strThe string in which clause is suffixed

Implements Rewriter_user.

◆ rewrite_user_application_user_metadata()

void Rewriter_show_create_user::rewrite_user_application_user_metadata ( const LEX lex,
String str 
) const
overridevirtual

Overrides implementation of the the rewriter for user application user metadata.

This is needed because we have to read the ATTRIBUTE data from disk.

Parameters
[in]lexLEX struct to know if the clause was specified
[in,out]strThe string in which the clause is suffixed

Implements Rewriter_user.

Member Data Documentation

◆ show_params_

const Show_user_params* Rewriter_show_create_user::show_params_
private

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