1#ifndef SQL_REGEXP_REGEXP_FACADE_H_
2#define SQL_REGEXP_REGEXP_FACADE_H_
110 std::optional<int>
Find(
Item *subject_expr,
int start,
int occurrence,
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
This class handles.
Definition: regexp_facade.h:61
bool SetPattern(Item *pattern_expr, uint32_t flags)
Sets the pattern if called for the first time or the pattern_expr is non-constant.
Definition: regexp_facade.cc:130
int ConvertCodePointToLibPosition(int position) const
Converts a string position in m_current_subject.
Definition: regexp_facade.cc:158
String * Replace(Item *subject_expr, Item *replacement_expr, int start, int occurrence, String *result)
Definition: regexp_facade.cc:196
bool Reset(Item *subject_expr, int start=1)
Resets the compiled regular expression with a new string.
Definition: regexp_facade.cc:147
int ConvertLibPositionToCodePoint(int position) const
Converts a string position in m_current_subject.
Definition: regexp_facade.cc:166
std::optional< bool > Matches(Item *subject_expr, int start, int occurrence)
Tries to match the subject against the compiled regular expression.
Definition: regexp_facade.cc:173
bool EngineHasWarning() const
Did any operation return a warning? For unit testing.
Definition: regexp_facade.h:129
String * AssignResult(const char *str, size_t length, String *result)
Helper function for setting the result from SQL regular expression functions that return a string val...
Definition: regexp_facade.cc:213
void cleanup()
Delete the "engine" data structure after execution.
Definition: regexp_facade.h:126
String * Substr(Item *subject_expr, int start, int occurrence, String *result)
Definition: regexp_facade.cc:237
std::u16string m_current_subject
ICU does not copy the subject string, so we keep the subject buffer here.
Definition: regexp_facade.h:193
unique_ptr_destroy_only< Regexp_engine > m_engine
Used for all the actual regular expression matching, search-and-replace, and positional and string in...
Definition: regexp_facade.h:185
bool SetupEngine(Item *pattern_expr, uint flags)
Actually compiles the regular expression.
Definition: regexp_facade.cc:255
std::optional< int > Find(Item *subject_expr, int start, int occurrence, bool after_match)
Searches the subject for a match of the compiled regular expression and returns a position.
Definition: regexp_facade.cc:186
static int flags[50]
Definition: hp_test1.cc:40
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
std::unique_ptr< T, Destroy_only< T > > unique_ptr_destroy_only
std::unique_ptr, but only destroying.
Definition: my_alloc.h:477
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
CHARSET_INFO * regexp_lib_charset
Definition: regexp_facade.cc:40
Our own string classes, used pervasively throughout the executor.
Definition: m_ctype.h:423