Skip to content

Commit 575c40a

Browse files
author
Thomas G. Lockhart
committed
Handle conversion of floating point constants to internal strings.
1 parent 8d21a6e commit 575c40a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/parser/parse_expr.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.43 1999/04/23 19:37:41 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.44 1999/05/12 07:14:24 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -642,9 +642,12 @@ parser_typecast(Value *expr, TypeName *typename, int32 atttypmod)
642642
const_string = DatumGetPointer(expr->val.str);
643643
break;
644644
case T_Integer:
645-
const_string = (char *) palloc(256);
646645
string_palloced = true;
647-
sprintf(const_string, "%ld", expr->val.ival);
646+
const_string = int4out(expr->val.ival);
647+
break;
648+
case T_Float:
649+
string_palloced = true;
650+
const_string = float8out(&expr->val.dval);
648651
break;
649652
default:
650653
elog(ERROR,

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