Add cases to test replaceRegexpAll_bug

This commit is contained in:
vdimir 2021-10-19 12:38:11 +03:00
parent 131aa77017
commit 3dfbc80f0b
No known key found for this signature in database
GPG Key ID: 9B404D301C0CC7EB
2 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,11 @@
aaaabb 1
b aaaa 1
aaaa 1
1
1
1
1
1
1
1
1

View File

@ -1,3 +1,14 @@
SELECT trim(leading 'b ' FROM 'b aaaabb ') x; SELECT 'aaaabb ' == trim(leading 'b ' FROM 'b aaaabb ') x;
SELECT trim(trailing 'b ' FROM 'b aaaabb ') x; SELECT 'b aaaa' == trim(trailing 'b ' FROM 'b aaaabb ') x;
SELECT trim(both 'b ' FROM 'b aaaabb ') x; SELECT 'aaaa' == trim(both 'b ' FROM 'b aaaabb ') x;
SELECT '1' == replaceRegexpAll(',,1,,', '^[,]*|[,]*$', '') x;
SELECT '1' == replaceRegexpAll(',,1', '^[,]*|[,]*$', '') x;
SELECT '1' == replaceRegexpAll('1,,', '^[,]*|[,]*$', '') x;
SELECT '1,,' == replaceRegexpOne(',,1,,', '^[,]*|[,]*$', '') x;
SELECT '1' == replaceRegexpOne(',,1', '^[,]*|[,]*$', '') x;
SELECT '1,,' == replaceRegexpOne('1,,', '^[,]*|[,]*$', '') x;
SELECT '5935,5998,6014' == trim(BOTH ', ' FROM '5935,5998,6014, ') x;
SELECT '5935,5998,6014' == replaceRegexpAll('5935,5998,6014, ', concat('^[', regexpQuoteMeta(', '), ']*|[', regexpQuoteMeta(', '), ']*$'), '') AS x;