diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-02-21 18:47:12 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-02-21 18:47:12 +0000 |
| commit | 393f313227fba2b7905cfbd69b3e4c18d762bf4f (patch) | |
| tree | 0eab81bd6705a19b625880d9b5cefb1d50c78d78 /src/backend/nodes/equalfuncs.c | |
| parent | ee97d103ccf68ae45343caea4188ca3dd5ce7365 (diff) | |
| download | postgresql-393f313227fba2b7905cfbd69b3e4c18d762bf4f.tar.gz | |
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.
Diffstat (limited to 'src/backend/nodes/equalfuncs.c')
| -rw-r--r-- | src/backend/nodes/equalfuncs.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index b4f5fc6285..6cb9eada0f 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.62 2000/02/20 21:32:05 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.63 2000/02/21 18:47:00 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -737,12 +737,11 @@ _equalValue(Value *a, Value *b) switch (a->type) { - case T_String: - return strcmp(a->val.str, b->val.str); case T_Integer: return a->val.ival == b->val.ival; case T_Float: - return a->val.dval == b->val.dval; + case T_String: + return strcmp(a->val.str, b->val.str) == 0; default: break; } @@ -870,8 +869,8 @@ equal(void *a, void *b) retval = _equalEState(a, b); break; case T_Integer: - case T_String: case T_Float: + case T_String: retval = _equalValue(a, b); break; case T_List: |
