Commit 575c40a6 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Handle conversion of floating point constants to internal strings.

parent 8d21a6ef
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.43 1999/04/23 19:37:41 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.44 1999/05/12 07:14:24 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -642,9 +642,12 @@ parser_typecast(Value *expr, TypeName *typename, int32 atttypmod) ...@@ -642,9 +642,12 @@ parser_typecast(Value *expr, TypeName *typename, int32 atttypmod)
const_string = DatumGetPointer(expr->val.str); const_string = DatumGetPointer(expr->val.str);
break; break;
case T_Integer: case T_Integer:
const_string = (char *) palloc(256);
string_palloced = true; string_palloced = true;
sprintf(const_string, "%ld", expr->val.ival); const_string = int4out(expr->val.ival);
break;
case T_Float:
string_palloced = true;
const_string = float8out(&expr->val.dval);
break; break;
default: default:
elog(ERROR, elog(ERROR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment