MySQL 8.0.40
Source Code Documentation
Persisted_rule Class Reference

A rule as persisted on disk. More...

#include <persisted_rule.h>

Public Member Functions

 Persisted_rule (rts::Cursor *c)
 Constructs a Persisted_rule object that copies all data into the current heap. More...
 
void set_message (const std::string &message_arg)
 Convenience function, may be called with a const char*. More...
 
void set_pattern_digest (const std::string &s)
 Convenience function, may be called with a const char*. More...
 
void set_normalized_pattern (const std::string &s)
 Convenience function, may be called with a const char*. More...
 
bool write_to (rts::Cursor *c)
 Writes the values in this Persisted_rule to the table at the row pointed to by the cursor. More...
 

Public Attributes

std::optional< std::string > pattern
 The rewrite rule's pattern string. More...
 
std::optional< std::string > pattern_db
 The pattern's current database. More...
 
std::optional< std::string > replacement
 The rewrite rule's replacement string. More...
 
bool is_enabled
 True if the rule is enabled. More...
 
std::optional< std::string > message
 The plugin's message, write-only. More...
 
std::optional< std::string > pattern_digest
 The pattern's digest, write-only. More...
 
std::optional< std::string > normalized_pattern
 The normalized pattern, write-only. More...
 

Private Member Functions

void copy_and_set (std::optional< std::string > *property, rts::Cursor *c, int colno)
 Reads from a Cursor and writes to a property of type std::optional<string> after forcing a copy of the string buffer. More...
 
void set_if_present (rts::Cursor *cursor, rts::Cursor::column_id column, std::optional< std::string > value)
 Writes a string value to the cursor's column if it exists. More...
 

Detailed Description

A rule as persisted on disk.

Constructor & Destructor Documentation

◆ Persisted_rule()

Persisted_rule::Persisted_rule ( rts::Cursor c)
inlineexplicit

Constructs a Persisted_rule object that copies all data into the current heap.

The interface is constructed this way due to on some OS'es (e.g. Windows), every shared library has its own heap.

Member Function Documentation

◆ copy_and_set()

void Persisted_rule::copy_and_set ( std::optional< std::string > *  property,
rts::Cursor c,
int  colno 
)
inlineprivate

Reads from a Cursor and writes to a property of type std::optional<string> after forcing a copy of the string buffer.

The function calls a member function in Cursor that is located in the server's dynamic library.

◆ set_if_present()

void Persisted_rule::set_if_present ( rts::Cursor cursor,
rts::Cursor::column_id  column,
std::optional< std::string >  value 
)
inlineprivate

Writes a string value to the cursor's column if it exists.

◆ set_message()

void Persisted_rule::set_message ( const std::string &  message_arg)
inline

Convenience function, may be called with a const char*.

◆ set_normalized_pattern()

void Persisted_rule::set_normalized_pattern ( const std::string &  s)
inline

Convenience function, may be called with a const char*.

◆ set_pattern_digest()

void Persisted_rule::set_pattern_digest ( const std::string &  s)
inline

Convenience function, may be called with a const char*.

◆ write_to()

bool Persisted_rule::write_to ( rts::Cursor c)
inline

Writes the values in this Persisted_rule to the table at the row pointed to by the cursor.

Values that don't have a corresponding column in the table will be ignored.

Member Data Documentation

◆ is_enabled

bool Persisted_rule::is_enabled

True if the rule is enabled.

◆ message

std::optional<std::string> Persisted_rule::message

The plugin's message, write-only.

◆ normalized_pattern

std::optional<std::string> Persisted_rule::normalized_pattern

The normalized pattern, write-only.

◆ pattern

std::optional<std::string> Persisted_rule::pattern

The rewrite rule's pattern string.

◆ pattern_db

std::optional<std::string> Persisted_rule::pattern_db

The pattern's current database.

◆ pattern_digest

std::optional<std::string> Persisted_rule::pattern_digest

The pattern's digest, write-only.

◆ replacement

std::optional<std::string> Persisted_rule::replacement

The rewrite rule's replacement string.


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