MySQL 9.0.0
Source Code Documentation
I_rewriter Class Referenceabstract

An abstract base class to enable the implementation of various query rewriters. More...

#include <sql_rewrite.h>

Inheritance diagram for I_rewriter:
[legend]

Public Member Functions

 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...
 
virtual bool rewrite (String &rlb) const =0
 

Protected Attributes

THD *const m_thd
 
Consumer_type m_consumer_type
 

Detailed Description

An abstract base class to enable the implementation of various query rewriters.

It accepts a THD pointer and the intended target type where the query will to be written. It either sets the thd->rewritten_query with a rewritten query, or clears it if no rewriting took place. Concrete classes must implement the rewrite() method to rewrite the query. Despite concrete classes may accept additional parameters, it is recommended not to create their objects directly.

Constructor & Destructor Documentation

◆ I_rewriter() [1/3]

I_rewriter::I_rewriter ( THD thd,
Consumer_type  type 
)

◆ ~I_rewriter()

I_rewriter::~I_rewriter ( )
virtualdefault

◆ I_rewriter() [2/3]

I_rewriter::I_rewriter ( const I_rewriter )
delete

◆ I_rewriter() [3/3]

I_rewriter::I_rewriter ( const I_rewriter &&  )
delete

Member Function Documentation

◆ consumer_type()

Consumer_type I_rewriter::consumer_type ( )

Return the current consumer type set in the object.

Return values
Consumertype set currently.

◆ operator=() [1/2]

const I_rewriter & I_rewriter::operator= ( const I_rewriter &&  )
delete

◆ operator=() [2/2]

const I_rewriter & I_rewriter::operator= ( const I_rewriter )
delete

◆ rewrite()

◆ set_consumer_type()

void I_rewriter::set_consumer_type ( Consumer_type  type)

Reset the previous consumer type.

Parameters
[in]typenew consumer type for which query is to be rewritten

Member Data Documentation

◆ m_consumer_type

Consumer_type I_rewriter::m_consumer_type
protected

◆ m_thd

THD* const I_rewriter::m_thd
protected

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