Class that builds the rewritten query by appending literals in the order they appear in the parse tree.
More...
#include <query_builder.h>
Class that builds the rewritten query by appending literals in the order they appear in the parse tree.
◆ Query_builder()
◆ add_next_literal()
bool Query_builder::add_next_literal |
( |
MYSQL_ITEM |
item | ) |
|
|
private |
Adds a literal, assumed to be the next in the parse tree, from the query's parse tree to this Query_builder.
- Parameters
-
item | Assumed to be a literal. |
- Return values
-
true | The builder is finished. Either it has been detected that the current literal does not match the pattern, or no more literals are needed to build the query. |
◆ get_built_query()
const std::string & Query_builder::get_built_query |
( |
| ) |
|
|
inline |
To be called after visit() has been called for all literals in the parse tree that this Query_builder was visiting.
This function finishes the string to yield a complete query.
◆ matches()
bool Query_builder::matches |
( |
| ) |
const |
|
inline |
Status of the matching of literals that are not parameter markers.
- Return values
-
true | The parse tree matches the pattern and it is safe to continue adding literals. |
false | Some literal has been found to differ between parse tree and pattern. Execution must end immediately. |
◆ visit()
◆ m_built_query
std::string Query_builder::m_built_query |
|
private |
The query under construction.
◆ m_matches_so_far
bool Query_builder::m_matches_so_far |
|
private |
Whether the literals in the parse tree match those of the pattern so far.
◆ m_pattern_literals
std::vector<std::string> Query_builder::m_pattern_literals |
|
private |
All literals in the pattern, in order of appearance in parse tree.
◆ m_pattern_literals_iter
std::vector<std::string>::iterator Query_builder::m_pattern_literals_iter |
|
private |
◆ m_previous_slot
int Query_builder::m_previous_slot |
|
private |
The index of the character in 'm_replacement' after the last slot that we filled.
◆ m_replacement
std::string Query_builder::m_replacement |
|
private |
Query we copy from (replacement string.)
◆ m_slots
std::vector<int> Query_builder::m_slots |
|
private |
The slots in the replacement string.
◆ m_slots_iter
std::vector<int>::iterator Query_builder::m_slots_iter |
|
private |
The documentation for this class was generated from the following file: