Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35182 from vdimir/regex-replace-35117
Fix replaceRegexpAll
- Loading branch information
Showing
3 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/queries/0_stateless/02151_replace_regexp_all_empty_match_alternative.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 | ||
1 |
24 changes: 21 additions & 3 deletions
24
tests/queries/0_stateless/02151_replace_regexp_all_empty_match_alternative.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
select replaceRegexpAll(',,1,,', '^[,]*|[,]*$', '') x; | ||
select replaceRegexpAll(',,1', '^[,]*|[,]*$', '') x; | ||
select replaceRegexpAll('1,,', '^[,]*|[,]*$', '') x; | ||
SELECT replaceRegexpAll(',,1,,', '^[,]*|[,]*$', ''); | ||
SELECT replaceRegexpAll(',,1', '^[,]*|[,]*$', ''); | ||
SELECT replaceRegexpAll('1,,', '^[,]*|[,]*$', ''); | ||
|
||
SELECT replaceRegexpAll(materialize(',,1,,'), '^[,]*|[,]*$', ''); | ||
SELECT replaceRegexpAll(materialize(',,1'), '^[,]*|[,]*$', ''); | ||
SELECT replaceRegexpAll(materialize('1,,'), '^[,]*|[,]*$', ''); | ||
|
||
SELECT replaceRegexpAll('a', 'z*', '') == 'a'; | ||
SELECT replaceRegexpAll('aa', 'z*', '') == 'aa'; | ||
SELECT replaceRegexpAll('aaq', 'z*', '') == 'aaq'; | ||
SELECT replaceRegexpAll('aazq', 'z*', '') == 'aaq'; | ||
SELECT replaceRegexpAll('aazzq', 'z*', '') == 'aaq'; | ||
SELECT replaceRegexpAll('aazzqa', 'z*', '') == 'aaqa'; | ||
|
||
SELECT replaceRegexpAll(materialize('a'), 'z*', '') == 'a'; | ||
SELECT replaceRegexpAll(materialize('aa'), 'z*', '') == 'aa'; | ||
SELECT replaceRegexpAll(materialize('aaq'), 'z*', '') == 'aaq'; | ||
SELECT replaceRegexpAll(materialize('aazq'), 'z*', '') == 'aaq'; | ||
SELECT replaceRegexpAll(materialize('aazzq'), 'z*', '') == 'aaq'; | ||
SELECT replaceRegexpAll(materialize('aazzqa'), 'z*', '') == 'aaqa'; |