![]()  | 
  
    MySQL 9.5.0
    
   Source Code Documentation 
   | 
 
Internal representation of a rewrite rule. More...
#include <rule.h>
Public Types | |
| enum | Load_status {  OK , PATTERN_PARSE_ERROR , PATTERN_NOT_SUPPORTED_STATEMENT , PATTERN_GOT_NO_DIGEST , REPLACEMENT_PARSE_ERROR , REPLACEMENT_HAS_MORE_MARKERS }  | 
Public Member Functions | |
| const uchar * | digest_buffer () const | 
| The digest buffer.  More... | |
| std::string | normalized_pattern () | 
| The pattern in normalized form.  More... | |
| Load_status | load (MYSQL_THD thd, const Persisted_rule *diskrule) | 
| Loads and parses the rule and replacement.  More... | |
| Rewrite_result | create_new_query (MYSQL_THD thd) | 
| Applies the rule on a query, thereby creating a new one.  More... | |
| bool | matches (MYSQL_THD thd) const | 
| Asks the parser service for the current query in normalized form and compares it to the normalized pattern.  More... | |
| std::string | pattern_parse_error_message () | 
| std::string | replacement_parse_error_message () | 
Private Attributes | |
| Pattern | m_pattern | 
| Replacement | m_replacement | 
Internal representation of a rewrite rule.
A rewrite rule consists of a pattern and a replacement.
| enum Rule::Load_status | 
| Rewrite_result Rule::create_new_query | ( | MYSQL_THD | thd | ) | 
Applies the rule on a query, thereby creating a new one.
This is done by merging the replacement and literals from the query.
| thd | Pointer to the query string. | 
| false | Everything worked, the new query is pointed to by 'query'. | 
| true | The query did not match the pattern, nothing is allocated. | 
      
  | 
  inline | 
The digest buffer.
      
  | 
  inline | 
Loads and parses the rule and replacement.
| bool Rule::matches | ( | MYSQL_THD | thd | ) | const | 
Asks the parser service for the current query in normalized form and compares it to the normalized pattern.
This is the equivalent of comparing the structure of two parse trees.
      
  | 
  inline | 
The pattern in normalized form.
      
  | 
  inline | 
      
  | 
  inline | 
      
  | 
  private | 
      
  | 
  private |