File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.86 2003/07/17 00:55:37 tgl Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.87 2003/07/26 15:17:36 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -2533,7 +2533,7 @@ timestamp_trunc(PG_FUNCTION_ARGS)
2533
2533
case DTK_YEAR :
2534
2534
tm -> tm_mon = 1 ;
2535
2535
case DTK_QUARTER :
2536
- tm -> tm_mon = (3 * (tm -> tm_mon / 4 )) + 1 ;
2536
+ tm -> tm_mon = (3 * (( tm -> tm_mon - 1 ) / 3 )) + 1 ;
2537
2537
case DTK_MONTH :
2538
2538
tm -> tm_mday = 1 ;
2539
2539
case DTK_DAY :
@@ -2626,7 +2626,7 @@ timestamptz_trunc(PG_FUNCTION_ARGS)
2626
2626
case DTK_YEAR :
2627
2627
tm -> tm_mon = 1 ;
2628
2628
case DTK_QUARTER :
2629
- tm -> tm_mon = (3 * (tm -> tm_mon / 4 )) + 1 ;
2629
+ tm -> tm_mon = (3 * (( tm -> tm_mon - 1 ) / 3 )) + 1 ;
2630
2630
case DTK_MONTH :
2631
2631
tm -> tm_mday = 1 ;
2632
2632
case DTK_DAY :
@@ -2719,7 +2719,7 @@ interval_trunc(PG_FUNCTION_ARGS)
2719
2719
case DTK_YEAR :
2720
2720
tm -> tm_mon = 0 ;
2721
2721
case DTK_QUARTER :
2722
- tm -> tm_mon = (3 * (tm -> tm_mon / 4 ));
2722
+ tm -> tm_mon = (3 * (tm -> tm_mon / 3 ));
2723
2723
case DTK_MONTH :
2724
2724
tm -> tm_mday = 0 ;
2725
2725
case DTK_DAY :
@@ -3297,7 +3297,7 @@ interval_part(PG_FUNCTION_ARGS)
3297
3297
break ;
3298
3298
3299
3299
case DTK_QUARTER :
3300
- result = (tm -> tm_mon / 4 ) + 1 ;
3300
+ result = (tm -> tm_mon / 3 ) + 1 ;
3301
3301
break ;
3302
3302
3303
3303
case DTK_YEAR :
You can’t perform that action at this time.
0 commit comments