MySQL 8.0.40
Source Code Documentation
item_regexp_func.cc File Reference

Implementation of the regular expression function object. More...

#include "sql/item_regexp_func.h"
#include <optional>
#include "my_dbug.h"
#include "mysql_com.h"
#include "sql/item_func.h"
#include "sql/sql_class.h"
#include "sql/sql_lex.h"

Functions

static bool ParseRegexpOptions (const std::string &options_string, bool case_sensitive_is_default, uint32_t *flags)
 Transforms a textual option string from the user to a bitmask of ICU flags. More...
 
static bool is_binary_string (Item *item)
 
static bool is_binary_compatible (Item *item)
 

Detailed Description

Implementation of the regular expression function object.

This file deals only with the function objects and their place in the Item hierarchy. All interactions with the regular expression library are done through a facade object, which is instantiated in fix_fields() and deleted in cleanup().

Function Documentation

◆ is_binary_compatible()

static bool is_binary_compatible ( Item item)
static

◆ is_binary_string()

static bool is_binary_string ( Item item)
static

◆ ParseRegexpOptions()

static bool ParseRegexpOptions ( const std::string &  options_string,
bool  case_sensitive_is_default,
uint32_t *  flags 
)
static

Transforms a textual option string from the user to a bitmask of ICU flags.

The match_parameter is a string of characters where each character controls some characteristic of the regular expression matching:

  • ‘'c’means case-sensitive matching. -'i'means case-insensitive matching. -'m'activates multi-line matching. -'n'lets the period match the newline character. -'u'` means that only UNIX line endings are recognized as line endings.
Parameters
options_stringThe options to parse.
case_sensitive_is_defaultWhether case-sensitive matching is the default.
[out]flagsThese flags will be updated (overridden) with the values of flags in options_string.
Return values
falseString parsed successfully and *flags is updated accordingly.
trueString could not be parsed, *flags is untouched.