1#ifndef SQL_REGEXP_REGEXP_FACADE_H_
2#define SQL_REGEXP_REGEXP_FACADE_H_
111 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:853
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
This class handles.
Definition: regexp_facade.h:62
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:127
int ConvertCodePointToLibPosition(int position) const
Converts a string position in m_current_subject.
Definition: regexp_facade.cc:155
String * Replace(Item *subject_expr, Item *replacement_expr, int start, int occurrence, String *result)
Definition: regexp_facade.cc:193
bool Reset(Item *subject_expr, int start=1)
Resets the compiled regular expression with a new string.
Definition: regexp_facade.cc:144
int ConvertLibPositionToCodePoint(int position) const
Converts a string position in m_current_subject.
Definition: regexp_facade.cc:163
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:170
bool EngineHasWarning() const
Did any operation return a warning? For unit testing.
Definition: regexp_facade.h:130
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:210
void cleanup()
Delete the "engine" data structure after execution.
Definition: regexp_facade.h:127
String * Substr(Item *subject_expr, int start, int occurrence, String *result)
Definition: regexp_facade.cc:234
std::u16string m_current_subject
ICU does not copy the subject string, so we keep the subject buffer here.
Definition: regexp_facade.h:194
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:186
bool SetupEngine(Item *pattern_expr, uint flags)
Actually compiles the regular expression.
Definition: regexp_facade.cc:252
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:183
static int flags[50]
Definition: hp_test1.cc:40
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:177
std::unique_ptr< T, Destroy_only< T > > unique_ptr_destroy_only
std::unique_ptr, but only destroying.
Definition: my_alloc.h:489
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
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
int32_t opt_regexp_stack_limit
Definition: mysqld.cc:1298
int32_t opt_regexp_time_limit
Definition: mysqld.cc:1297
Our own string classes, used pervasively throughout the executor.
unsigned int uint
Definition: uca9-dump.cc:75