1#ifndef QUERY_BUILDER_INCLUDED
2#define QUERY_BUILDER_INCLUDED
127 if (pattern_literal.compare(
"?") ==
139 }
else if (pattern_literal.compare(query_literal) != 0) {
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
The in-memory representation of a pattern.
Definition: rule.h:56
Class that builds the rewritten query by appending literals in the order they appear in the parse tre...
Definition: query_builder.h:43
std::vector< int > m_slots
The slots in the replacement string.
Definition: query_builder.h:94
std::vector< std::string > m_pattern_literals
All literals in the pattern, in order of appearance in parse tree.
Definition: query_builder.h:98
const std::string & get_built_query()
To be called after visit() has been called for all literals in the parse tree that this Query_builder...
Definition: query_builder.h:66
std::vector< int >::iterator m_slots_iter
Definition: query_builder.h:95
std::string m_replacement
Query we copy from (replacement string.)
Definition: query_builder.h:91
bool m_matches_so_far
Whether the literals in the parse tree match those of the pattern so far.
Definition: query_builder.h:108
bool visit(MYSQL_ITEM item) override
Implementation of the visit() function that bridges to add_next_literal().
Definition: query_builder.h:59
int m_previous_slot
The index of the character in 'm_replacement' after the last slot that we filled.
Definition: query_builder.h:88
bool add_next_literal(MYSQL_ITEM item)
Adds a literal, assumed to be the next in the parse tree, from the query's parse tree to this Query_b...
Definition: query_builder.h:123
std::string m_built_query
The query under construction.
Definition: query_builder.h:102
Query_builder(const Pattern *pattern, const Replacement *replacement)
Definition: query_builder.h:45
bool matches() const
Status of the matching of literals that are not parameter markers.
Definition: query_builder.h:81
std::vector< std::string >::iterator m_pattern_literals_iter
Definition: query_builder.h:99
Definition: services.h:76
const char * begin(const char *const c)
Definition: base64.h:44
string print_item(MYSQL_ITEM item)
Prints an Item as an std::string.
Definition: services.cc:132
Conversion layer between the parser service and this plugin.