- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit29f7ce6
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 parentad5eaf3 commit29f7ce6
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 | |
---|---|---|---|
| |||
5956 | 5956 |
| |
5957 | 5957 |
| |
5958 | 5958 |
| |
| 5959 | + | |
| 5960 | + | |
| 5961 | + | |
| 5962 | + | |
| 5963 | + | |
| 5964 | + | |
| 5965 | + | |
| 5966 | + | |
5959 | 5967 |
| |
5960 | 5968 |
| |
| 5969 | + | |
5961 | 5970 |
| |
| 5971 | + | |
5962 | 5972 |
| |
5963 | 5973 |
| |
5964 | 5974 |
| |
|
Lines changed: 17 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
647 | 647 |
| |
648 | 648 |
| |
649 | 649 |
| |
650 |
| - | |
| 650 | + | |
651 | 651 |
| |
652 | 652 |
| |
653 | 653 |
| |
| |||
679 | 679 |
| |
680 | 680 |
| |
681 | 681 |
| |
682 |
| - | |
| 682 | + | |
683 | 683 |
| |
684 | 684 |
| |
685 |
| - | |
| 685 | + | |
686 | 686 |
| |
687 | 687 |
| |
688 | 688 |
| |
689 | 689 |
| |
690 | 690 |
| |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
691 | 705 |
| |
692 | 706 |
| |
693 | 707 |
| |
|
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)