forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit78aef14
committed
Fix time_part and timetz_part (ie, EXTRACT() for those datatypes) to
include a fractional part in the output for MILLISECOND and SECOND cases,rather than truncating the source value. This is what the float-timestampcode has always done, and it was clearly the code author's intent to dothe same for integer timestamps, but he forgot about integer division in C.The other datatypes supported by EXTRACT() already do this correctly.Backpatch to 8.4, so that the default (integer) behavior of that branch willmatch the default (float) behavior of older branches. Arguably we shouldpatch further back, but it's possible that applications are expecting thebroken behavior in older branches. 8.4 is new enough that expectationsshouldn't be too settled.Per report from Greg Stark.1 parent25d9bf2 commit78aef14
1 file changed
+7
-7
lines changedLines changed: 7 additions & 7 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 |
| |
| |||
1701 | 1701 |
| |
1702 | 1702 |
| |
1703 | 1703 |
| |
1704 |
| - | |
| 1704 | + | |
1705 | 1705 |
| |
1706 | 1706 |
| |
1707 | 1707 |
| |
1708 | 1708 |
| |
1709 | 1709 |
| |
1710 | 1710 |
| |
1711 | 1711 |
| |
1712 |
| - | |
| 1712 | + | |
1713 | 1713 |
| |
1714 | 1714 |
| |
1715 | 1715 |
| |
1716 | 1716 |
| |
1717 | 1717 |
| |
1718 | 1718 |
| |
1719 | 1719 |
| |
1720 |
| - | |
| 1720 | + | |
1721 | 1721 |
| |
1722 | 1722 |
| |
1723 | 1723 |
| |
| |||
2469 | 2469 |
| |
2470 | 2470 |
| |
2471 | 2471 |
| |
2472 |
| - | |
| 2472 | + | |
2473 | 2473 |
| |
2474 | 2474 |
| |
2475 | 2475 |
| |
2476 | 2476 |
| |
2477 | 2477 |
| |
2478 | 2478 |
| |
2479 | 2479 |
| |
2480 |
| - | |
| 2480 | + | |
2481 | 2481 |
| |
2482 | 2482 |
| |
2483 | 2483 |
| |
2484 | 2484 |
| |
2485 | 2485 |
| |
2486 | 2486 |
| |
2487 | 2487 |
| |
2488 |
| - | |
| 2488 | + | |
2489 | 2489 |
| |
2490 | 2490 |
| |
2491 | 2491 |
| |
|
0 commit comments
Comments
(0)