MySQL 8.0.39
Source Code Documentation
Pattern Class Reference

The in-memory representation of a pattern. More...

#include <rule.h>

Public Types

enum  Load_status { OK , PARSE_ERROR , NOT_SUPPORTED_STATEMENT , NO_DIGEST }
 

Public Member Functions

Load_status load (MYSQL_THD thd, const Persisted_rule *diskrule)
 Loads the pattern. More...
 
std::string parse_error_message ()
 If any errors were raised during parsing, the first one is available here. More...
 

Public Attributes

int number_parameters
 
std::string normalized_pattern
 The pattern in normalized form. More...
 
services::Digest digest
 The digest obtained from the pattern. More...
 
std::vector< std::string > literals
 

Private Attributes

std::string m_parse_error_message
 

Detailed Description

The in-memory representation of a pattern.

Member Enumeration Documentation

◆ Load_status

Enumerator
OK 
PARSE_ERROR 
NOT_SUPPORTED_STATEMENT 
NO_DIGEST 

Member Function Documentation

◆ load()

Pattern::Load_status Pattern::load ( MYSQL_THD  thd,
const Persisted_rule diskrule 
)

Loads the pattern.

The pattern string is copied in deep-copy way. This is not done in the CTOR because of the memory allocation.

This function does the following:

  • Parse the pattern string.
  • Print a normalized version.
  • Extract the position of the parameter markers.
  • Compute the digest
Return values
falseSuccess.
trueEither parse error, the pattern is not a select statement or out of memory.

◆ parse_error_message()

std::string Pattern::parse_error_message ( )
inline

If any errors were raised during parsing, the first one is available here.

Member Data Documentation

◆ digest

services::Digest Pattern::digest

The digest obtained from the pattern.

◆ literals

std::vector<std::string> Pattern::literals

◆ m_parse_error_message

std::string Pattern::m_parse_error_message
private

◆ normalized_pattern

std::string Pattern::normalized_pattern

The pattern in normalized form.

◆ number_parameters

int Pattern::number_parameters

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