diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-11-10 16:43:27 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-11-10 16:43:27 +0400 |
commit | 9e8202013a8e0fc5e5693d8a08ab831d7ae49253 (patch) | |
tree | 219044ff1950c93ff961a92c967377fcd8f39864 /mysql-test | |
parent | 080fdbf937cc01af61c141fb4e1918a3468948ea (diff) | |
download | mariadb-git-9e8202013a8e0fc5e5693d8a08ab831d7ae49253.tar.gz |
MDEV-6965 non-captured group \2 in regexp_replace
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_regexp_pcre.result | 6 | ||||
-rw-r--r-- | mysql-test/t/func_regexp_pcre.test | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/func_regexp_pcre.result b/mysql-test/r/func_regexp_pcre.result index b777af767cb..641c4fddbf7 100644 --- a/mysql-test/r/func_regexp_pcre.result +++ b/mysql-test/r/func_regexp_pcre.result @@ -839,3 +839,9 @@ SELECT REGEXP_REPLACE('abc','^(.*)(.*)$','\\1/\\2'); REGEXP_REPLACE('abc','^(.*)(.*)$','\\1/\\2') /abc SET default_regex_flags=DEFAULT; +# +# MDEV-6965 non-captured group \2 in regexp_replace +# +SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); +REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that') +1 this and that diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test index 7e8df840239..6710f5cf096 100644 --- a/mysql-test/t/func_regexp_pcre.test +++ b/mysql-test/t/func_regexp_pcre.test @@ -397,3 +397,8 @@ SET default_regex_flags='UNGREEDY'; SELECT REGEXP_SUBSTR('abc','.+'); SELECT REGEXP_REPLACE('abc','^(.*)(.*)$','\\1/\\2'); SET default_regex_flags=DEFAULT; + +--echo # +--echo # MDEV-6965 non-captured group \2 in regexp_replace +--echo # +SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); |