Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4dc642e

Browse files
committed
Adjust regex for test with opening parenthesis in character classes
As written, the test was throwing an error because of an unbalancedparenthesis. The regex used in the test is adjusted to not fail and totest the case of an opening parenthesis in a character class after somenested square brackets.Oversight ind46911e.Discussion:https://postgr.es/m/16ab039d1af455652bdf4173402ddda145f2c73b.camel@cybertec.at
1 parentb3e9911 commit4dc642e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎src/test/regress/expected/strings.out

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,13 @@ EXPLAIN (COSTS OFF) SELECT * FROM TEXT_TBL WHERE f1 SIMILAR TO '$[$[:alnum:]$]$'
606606
(2 rows)
607607

608608
-- Opening parenthesis "("
609-
EXPLAIN (COSTS OFF) SELECT * FROM TEXT_TBL WHERE f1 SIMILAR TO '([([:alnum:](](';
610-
ERROR: invalid regular expression: parentheses () not balanced
609+
EXPLAIN (COSTS OFF) SELECT * FROM TEXT_TBL WHERE f1 SIMILAR TO '()[([:alnum:](]()';
610+
QUERY PLAN
611+
------------------------------------------------------
612+
Seq Scan on text_tbl
613+
Filter: (f1 ~ '^(?:(?:)[([:alnum:](](?:))$'::text)
614+
(2 rows)
615+
611616
-- Caret "^"
612617
EXPLAIN (COSTS OFF) SELECT * FROM TEXT_TBL WHERE f1 SIMILAR TO '^[^[:alnum:]^[^^][[^^]][\^][[\^]]\^]^';
613618
QUERY PLAN

‎src/test/regress/sql/strings.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ EXPLAIN (COSTS OFF) SELECT * FROM TEXT_TBL WHERE f1 SIMILAR TO '.[.[:alnum:].].'
198198
-- Dollar "$"
199199
EXPLAIN (COSTS OFF)SELECT*FROM TEXT_TBLWHERE f1 SIMILAR TO'$[$[:alnum:]$]$';
200200
-- Opening parenthesis "("
201-
EXPLAIN (COSTS OFF)SELECT*FROM TEXT_TBLWHERE f1 SIMILAR TO'([([:alnum:](](';
201+
EXPLAIN (COSTS OFF)SELECT*FROM TEXT_TBLWHERE f1 SIMILAR TO'()[([:alnum:](]()';
202202
-- Caret "^"
203203
EXPLAIN (COSTS OFF)SELECT*FROM TEXT_TBLWHERE f1 SIMILAR TO'^[^[:alnum:]^[^^][[^^]][\^][[\^]]\^]^';
204204
-- Closing square bracket "]" at the beginning of character class

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp