summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-09-26 18:02:17 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-09-26 18:02:17 +0400
commit285e7aa179a6081531be3274772b89e8989fd107 (patch)
tree71836ea6e49f48fff6e957bcef38628e7b979001 /sql/item_strfunc.h
parent9d83468e78ba23f024ce3c11443913ad75cf1ea5 (diff)
downloadmariadb-git-285e7aa179a6081531be3274772b89e8989fd107.tar.gz
MDEV-4425 REGEXP enhancements
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 93efc91d62c..e09dee18d4f 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -195,6 +195,49 @@ public:
};
+class Item_func_regexp_replace :public Item_str_func
+{
+ Regexp_processor_pcre re;
+ bool append_replacement(String *str,
+ const LEX_CSTRING *source,
+ const LEX_CSTRING *replace);
+public:
+ Item_func_regexp_replace(Item *a, Item *b, Item *c)
+ :Item_str_func(a, b, c)
+ {}
+ void cleanup()
+ {
+ DBUG_ENTER("Item_func_regex::cleanup");
+ Item_str_func::cleanup();
+ re.cleanup();
+ DBUG_VOID_RETURN;
+ }
+ String *val_str(String *str);
+ void fix_length_and_dec();
+ const char *func_name() const { return "regexp_replace"; }
+};
+
+
+class Item_func_regexp_substr :public Item_str_func
+{
+ Regexp_processor_pcre re;
+public:
+ Item_func_regexp_substr(Item *a, Item *b)
+ :Item_str_func(a, b)
+ {}
+ void cleanup()
+ {
+ DBUG_ENTER("Item_func_regex::cleanup");
+ Item_str_func::cleanup();
+ re.cleanup();
+ DBUG_VOID_RETURN;
+ }
+ String *val_str(String *str);
+ void fix_length_and_dec();
+ const char *func_name() const { return "regexp_substr"; }
+};
+
+
class Item_func_insert :public Item_str_func
{
String tmp_value;