Skip to content

Commit 14572e4

Browse files
committed
Fix cash_mul_int4 and cash_div_int4 for overenthusiastic substitution
of int64 for int32. Per reports from Merlin Moncure and Andrew Chernow.
1 parent 1783e5d commit 14572e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/utils/adt/cash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* this version handles 64 bit numbers and so can hold values up to
1414
* $92,233,720,368,547,758.07.
1515
*
16-
* $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.72 2007/08/21 03:14:36 tgl Exp $
16+
* $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.73 2007/08/21 03:56:07 tgl Exp $
1717
*/
1818

1919
#include "postgres.h"
@@ -652,7 +652,7 @@ Datum
652652
cash_mul_int4(PG_FUNCTION_ARGS)
653653
{
654654
Cash c = PG_GETARG_CASH(0);
655-
int64 i = PG_GETARG_INT64(1);
655+
int32 i = PG_GETARG_INT32(1);
656656
Cash result;
657657

658658
result = c * i;
@@ -683,7 +683,7 @@ Datum
683683
cash_div_int4(PG_FUNCTION_ARGS)
684684
{
685685
Cash c = PG_GETARG_CASH(0);
686-
int64 i = PG_GETARG_INT64(1);
686+
int32 i = PG_GETARG_INT32(1);
687687
Cash result;
688688

689689
if (i == 0)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy