- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit7ee0091
committed
Fix deparsing FETCH FIRST <expr> ROWS WITH TIES
In the grammar, <expr> is a c_expr, which accepts only a limited setof simple constants and expressions without parens. The deparsinglogic didn't quite match the grammar rule, and failed to use parense.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 parente323d9d commit7ee0091
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 | |
---|---|---|---|
| |||
5300 | 5300 |
| |
5301 | 5301 |
| |
5302 | 5302 |
| |
| 5303 | + | |
| 5304 | + | |
| 5305 | + | |
| 5306 | + | |
| 5307 | + | |
| 5308 | + | |
| 5309 | + | |
| 5310 | + | |
5303 | 5311 |
| |
5304 | 5312 |
| |
| 5313 | + | |
5305 | 5314 |
| |
| 5315 | + | |
5306 | 5316 |
| |
5307 | 5317 |
| |
5308 | 5318 |
| |
|
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)