forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb5a66e7
committed
Fix another ancient bug in parsing of BRE-mode regular expressions.
While poking at the regex code, I happened to notice that the bugsquashed in commitafcc877 had a sibling: next() failed to returna specific value associated with the '}' token for a "\{m,n\}"quantifier when parsing in basic RE mode. Again, this could resultin treating the quantifier as non-greedy, which it never should be inbasic mode. For that to happen, the last character before "\}" thatsets "nextvalue" would have to set it to zero, or it'd have to haveaccidentally been zero from the start. The failure can be provokedrepeatably with, for example, a bound ending in digit "0".Like the previous patch, back-patch all the way.1 parent614b7f1 commitb5a66e7
File tree
3 files changed
+11
-3
lines changed- src
- backend/regex
- test/modules/test_regex
- expected
- sql
3 files changed
+11
-3
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
389 | 389 |
| |
390 | 390 |
| |
391 | 391 |
| |
392 |
| - | |
| 392 | + | |
393 | 393 |
| |
394 | 394 |
| |
395 | 395 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
614 | 614 |
| |
615 | 615 |
| |
616 | 616 |
| |
617 |
| - | |
| 617 | + | |
618 | 618 |
| |
619 | 619 |
| |
620 | 620 |
| |
621 | 621 |
| |
622 | 622 |
| |
623 | 623 |
| |
624 | 624 |
| |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
625 | 632 |
| |
626 | 633 |
| |
627 | 634 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
214 | 214 |
| |
215 | 215 |
| |
216 | 216 |
| |
217 |
| - | |
| 217 | + | |
218 | 218 |
| |
| 219 | + | |
219 | 220 |
| |
220 | 221 |
| |
221 | 222 |
| |
|
0 commit comments
Comments
(0)