MySQL 8.0.40
Source Code Documentation
Rewriter_create_user Class Referencefinal

Rewrites the CREATE USER statement. More...

#include <sql_rewrite.h>

Inheritance diagram for Rewriter_create_user:
[legend]

Public Member Functions

 Rewriter_create_user (THD *thd, Consumer_type type)
 
bool rewrite (String &rlb) const override
 Rewrite the query for the CREATE USER statement. More...
 
void rewrite_user_application_user_metadata (const LEX *lex, String *str) const override
 Default implementation of the the rewriter for user applicatiton 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...
 

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 and auth str of the user to output string : More...
 
void rewrite_password_history (const LEX *lex, String *str) const override
 Append the PASSWORD HISTORY clause for users iff it is specified. More...
 
void rewrite_password_reuse (const LEX *lex, String *str) const override
 Append the PASSWORD REUSE clause for users iff it is specified. More...
 

Additional Inherited Members

- 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...
 
virtual void append_auth_str (LEX_USER *lex, String *str) const
 Append the password hash 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...
 
- Protected Attributes inherited from I_rewriter
THD *const m_thd
 
Consumer_type m_consumer_type
 

Detailed Description

Rewrites the CREATE USER statement.

Member Typedef Documentation

◆ parent

Constructor & Destructor Documentation

◆ Rewriter_create_user()

Rewriter_create_user::Rewriter_create_user ( THD thd,
Consumer_type  type 
)

Member Function Documentation

◆ append_user_auth_info()

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

Append the authID, plugin and auth str of the user to output string :

  • If the corresponding clause is specified.
  • Always add the plugin info for the target type BINLOG
  • Add the literal <secret> in place of plain text password for the target type LOG
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_create_user::rewrite ( String rlb) const
overridevirtual

Rewrite the query for the CREATE USER statement.

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_create_user::rewrite_password_history ( const LEX lex,
String str 
) const
overrideprivatevirtual

Append the PASSWORD HISTORY clause for users iff it is specified.

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_create_user::rewrite_password_reuse ( const LEX lex,
String str 
) const
overrideprivatevirtual

Append the PASSWORD REUSE clause for users iff it is specified.

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_create_user::rewrite_user_application_user_metadata ( const LEX lex,
String str 
) const
overridevirtual

Default implementation of the the rewriter for user applicatiton user metadata.

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

Implements Rewriter_user.


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