Re: [PORTS] FPE on Alpha in Select with PKEY - Mailing list pgsql-ports

From Adriaan Joubert
Subject Re: [PORTS] FPE on Alpha in Select with PKEY
Date
Msg-id 36DAC5AD.97F1A0FE@albourne.com
Whole thread Raw
In response to FPE on Alpha in Select with PKEY  (Adriaan Joubert <a.joubert@albourne.com>)
List pgsql-ports
Further to the above: the error occurs on line 136 of the file

src/backend/optimizer/path/orindxpath.c

which reads

>   136    clausenode->selectivity = (Cost) floatVal(selecs);



floatVal is a macro

#define floatVal(v)             (((Value *)v)->val.dval)

where value is

typedef struct Value
{
        NodeTag         type;                   /* tag appropriately
(eg. T_String) */
        union ValUnion
        {
                char       *str;                /* string */
                long            ival;
                double          dval;
        }                       val;
} Value;

The variable selecs is of type list, i.e.

typedef struct List
{
        NodeTag         type;
        union
        {
                void       *ptr_value;
                int                     int_value;
        }                       elem;
        struct List *next;
} List;


The variable selecs is filled in in the routine best_or_subclause_index
in orindxpath.c, where the value that is read via the floatVal macro is
assigned from a float (called selec as well). So this seems wrong
anyway.

Unfortunately casting ptr_value to float gives garbage as well:

(ladebug) p *(double*)selecs->elem.ptr_value
2.48515019858147e-321
(ladebug) p *(float*)selecs->elem.ptr_value
1.3342e-312


Any ideas?

Adriaan

pgsql-ports by date:

Previous
From: Unprivileged user
Date:
Subject: Port Bug Report: INSERT on VIEWs
Next
From: Adriaan Joubert
Date:
Subject: Re: [PORTS] FPE on Alpha in Select with PKEY