- Notifications
You must be signed in to change notification settings - Fork5
Commitfba999c
committed
Allow ORDER BY/GROUP BY/etc items to match targetlist items regardless of
any implicit casting previously applied to the targetlist item. This isreasonable because the implicit cast, by definition, wasn't written by theuser; so we are preserving the expected behavior that ORDER BY items matchtextually equivalent tlist items. The case never arose before because therecouldn't be any implicit casting of a top-level SELECT item before we processORDER BY etc. But now it can arise in the context of aggregates containingORDER BY clauses, since the "targetlist" is the already-casted list ofarguments for the aggregate. The net effect is that the datatype used forORDER BY/DISTINCT purposes is the aggregate's declared input type, not thatof the original input column; which is a bit debatable but not horrendous,and to do otherwise would require major rework that doesn't seem justified.Per bug #5564 from Daniel Grace. Back-patch to 9.0 where aggregate ORDER BYwas implemented.1 parent1b51018 commitfba999c
File tree
3 files changed
+42
-2
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+42
-2
lines changedLines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| 24 | + | |
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| |||
1430 | 1431 |
| |
1431 | 1432 |
| |
1432 | 1433 |
| |
| 1434 | + | |
1433 | 1435 |
| |
1434 |
| - | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
1435 | 1448 |
| |
1436 | 1449 |
| |
1437 | 1450 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
830 | 830 |
| |
831 | 831 |
| |
832 | 832 |
| |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + |
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
362 | 362 |
| |
363 | 363 |
| |
364 | 364 |
| |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + |
0 commit comments
Comments
(0)