- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit0420b24
committed
Fix deparsing FETCH FIRST <expr> ROWS WITH TIES
In the grammar, <expr> is a c_expr, which accepts only a limited setof integer literals and simple expressions without parens. Thedeparsing logic didn't quite match the grammar rule, and failed to useparens e.g. for "5::bigint".To fix, always surround the expression with parens. Would be nice toomit the parens in simple cases, but unfortunately it's non-trivial todetect such simple cases. Even if the expression is a simple literal123 in the original query, after parse analysis it becomes a FuncExprwith COERCE_IMPLICIT_CAST rather than a simple Const.Reported-by: yonghao leeBackpatch-through: 13Discussion:https://www.postgresql.org/message-id/18929-077d6b7093b176e2@postgresql.org1 parente684594 commit0420b24
File tree
3 files changed
+31
-4
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+31
-4
lines changedLines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5662 | 5662 |
| |
5663 | 5663 |
| |
5664 | 5664 |
| |
| 5665 | + | |
| 5666 | + | |
| 5667 | + | |
| 5668 | + | |
| 5669 | + | |
| 5670 | + | |
| 5671 | + | |
| 5672 | + | |
5665 | 5673 |
| |
5666 | 5674 |
| |
| 5675 | + | |
5667 | 5676 |
| |
| 5677 | + | |
5668 | 5678 |
| |
5669 | 5679 |
| |
5670 | 5680 |
| |
|
Lines changed: 17 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
643 | 643 |
| |
644 | 644 |
| |
645 | 645 |
| |
646 |
| - | |
| 646 | + | |
647 | 647 |
| |
648 | 648 |
| |
649 | 649 |
| |
| |||
675 | 675 |
| |
676 | 676 |
| |
677 | 677 |
| |
678 |
| - | |
| 678 | + | |
679 | 679 |
| |
680 | 680 |
| |
681 |
| - | |
| 681 | + | |
682 | 682 |
| |
683 | 683 |
| |
684 | 684 |
| |
685 | 685 |
| |
686 | 686 |
| |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
687 | 701 |
| |
688 | 702 |
| |
689 | 703 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
199 |
| - | |
| 199 | + | |
200 | 200 |
| |
| 201 | + | |
| 202 | + | |
| 203 | + | |
201 | 204 |
|
0 commit comments
Comments
(0)