Commit d91baea0 authored by Tom Lane's avatar Tom Lane

Ooops ... I had left some test coding in selfuncs.c that

failed on 'field < textconstant' ...
parent ca5c10f7
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.38 1999/08/09 03:16:45 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.39 1999/08/21 00:56:18 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "parser/parse_func.h" #include "parser/parse_func.h"
#include "parser/parse_oper.h" #include "parser/parse_oper.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/int8.h"
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
#include "utils/syscache.h" #include "utils/syscache.h"
...@@ -460,22 +461,31 @@ convert_to_scale(Datum value, Oid typid, ...@@ -460,22 +461,31 @@ convert_to_scale(Datum value, Oid typid,
case INT4OID: case INT4OID:
*scaleval = (double) DatumGetInt32(value); *scaleval = (double) DatumGetInt32(value);
return true; return true;
// case INT8OID: case INT8OID:
*scaleval = (double) (* i8tod((int64 *) DatumGetPointer(value)));
return true;
case FLOAT4OID: case FLOAT4OID:
*scaleval = (double) (* DatumGetFloat32(value)); *scaleval = (double) (* DatumGetFloat32(value));
return true; return true;
case FLOAT8OID: case FLOAT8OID:
*scaleval = (double) (* DatumGetFloat64(value)); *scaleval = (double) (* DatumGetFloat64(value));
return true; return true;
// case NUMERICOID: case NUMERICOID:
*scaleval = (double) (* numeric_float8((Numeric) DatumGetPointer(value)));
return true;
case OIDOID: case OIDOID:
case REGPROCOID: case REGPROCOID:
/* we can treat OIDs as integers... */ /* we can treat OIDs as integers... */
*scaleval = (double) DatumGetObjectId(value); *scaleval = (double) DatumGetObjectId(value);
return true; return true;
case TEXTOID:
/*
* Eventually this should get handled by somehow scaling as a
* string value. For now, we need to call it out to avoid
* falling into the default case, because there is a float8(text)
* function declared in pg_proc that will do the wrong thing :-(
*/
break;
default: default:
{ {
/* See whether there is a registered type-conversion function, /* See whether there is a registered type-conversion function,
......
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