/pgpatches/interval
text/x-diff
Filename: /pgpatches/interval
Type: text/x-diff
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/backend/utils/adt/timestamp.c | 12 | 0 |
Index: src/backend/utils/adt/timestamp.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v retrieving revision 1.165 diff -c -c -r1.165 timestamp.c *** src/backend/utils/adt/timestamp.c 13 Jul 2006 16:49:16 -0000 1.165 --- src/backend/utils/adt/timestamp.c 29 Aug 2006 16:06:49 -0000 *************** *** 2505,2510 **** --- 2505,2513 ---- result->day = (int32) day_remainder; month_remainder -= result->month; day_remainder -= result->day; + if (day_remainder != (int32)day_remainder && + TSROUND(day_remainder) == rint(day_remainder)) + day_remainder = rint(day_remainder); /* * The above correctly handles the whole-number part of the month and day *************** *** 2518,2523 **** --- 2521,2529 ---- /* fractional months full days into days */ month_remainder_days = month_remainder * DAYS_PER_MONTH; + if (month_remainder_days != (int32)month_remainder_days && + TSROUND(month_remainder_days) == rint(month_remainder_days)) + month_remainder_days = rint(month_remainder_days); result->day += (int32) month_remainder_days; /* fractional months partial days into time */ day_remainder += month_remainder_days - (int32) month_remainder_days; *************** *** 2564,2569 **** --- 2570,2578 ---- result->day = (int32) day_remainder; month_remainder -= result->month; day_remainder -= result->day; + if (day_remainder != (int32)day_remainder && + TSROUND(day_remainder) == rint(day_remainder)) + day_remainder = rint(day_remainder); /* * Handle any fractional parts the same way as in interval_mul. *************** *** 2571,2576 **** --- 2580,2588 ---- /* fractional months full days into days */ month_remainder_days = month_remainder * DAYS_PER_MONTH; + if (month_remainder_days != (int32)month_remainder_days && + TSROUND(month_remainder_days) == rint(month_remainder_days)) + month_remainder_days = rint(month_remainder_days); result->day += (int32) month_remainder_days; /* fractional months partial days into time */ day_remainder += month_remainder_days - (int32) month_remainder_days;