mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Change parse-time representation of float literals (which include oversize
integers) to be strings instead of 'double'. We convert from string form to internal representation only after type resolution has determined the correct type for the constant. This eliminates loss-of-precision worries and gets rid of the change in behavior seen at 17 digits with the previous kluge.
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.109 2000/02/20 21:32:05 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.110 2000/02/21 18:47:00 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@ -1265,16 +1265,19 @@ _outValue(StringInfo str, Value *value)
|
||||
{
|
||||
switch (value->type)
|
||||
{
|
||||
case T_String:
|
||||
appendStringInfo(str, " \"");
|
||||
_outToken(str, value->val.str);
|
||||
appendStringInfo(str, "\" ");
|
||||
break;
|
||||
case T_Integer:
|
||||
appendStringInfo(str, " %ld ", value->val.ival);
|
||||
break;
|
||||
case T_Float:
|
||||
appendStringInfo(str, " %.17g ", value->val.dval);
|
||||
/* We assume the value is a valid numeric literal
|
||||
* and so does not need quoting.
|
||||
*/
|
||||
appendStringInfo(str, " %s ", value->val.str);
|
||||
break;
|
||||
case T_String:
|
||||
appendStringInfo(str, " \"");
|
||||
_outToken(str, value->val.str);
|
||||
appendStringInfo(str, "\" ");
|
||||
break;
|
||||
default:
|
||||
elog(NOTICE, "_outValue: don't know how to print type %d ",
|
||||
|
Reference in New Issue
Block a user