Windows env returns error while running "select pgstatindex"

From: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Windows env returns error while running "select pgstatindex"
Date: 2011-08-24 09:09:22
Message-ID: CAGPqQf0Ldx_Zx_TLEswK0i6ogiN0GUR8--Ub7B6CMwnJQ93_Ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Description:
===========

Error Message " invalid input syntax for type double precision: -1#I" is
displayed while running "select pgstatindex"

Issue only getting reproduce on windows environment.

Analysis:
=========

Consider the following testcase to reproduce the issue on windows:

create table test (a int primary key );

Windows Output:
==============

psql>select pgstatindex('public.test_pkey');
ERROR: invalid input syntax for type double precision: "-1.#J"

Linux output:
==========

psql=# select pgstatindex('public.test_pkey');
pgstatindex
---------------------------
(2,0,0,0,0,0,0,0,NaN,NaN)
(1 row)

here when we run the select on linux its returning proper result and on
windows error coming from float8in() while trying to work for the NaN
values.

After debugging I noticed that "0/0" returning NaN on linux but it returns
"-1.#JIND0000" on windows. Now when float8in() getting call for such value
on windows it ending up with error "invalid input syntax for type double
precision:" as strtod() not able to understand such values.

I added to check into pgstatindex() to avoid "0/0" situation and issue got
fixed.

PFA patch for the same.

Thanks,
Rushabh Lathia

EnterpriseDB Corporation
The Enterprise Postgres Company

Website: http://www.enterprisedb.com
EnterpriseDB Blog: http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterprisedb

Attachment Content-Type Size
win_pgstat_fix.patch application/octet-stream 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gokulakannan Somasundaram 2011-08-24 10:19:57 Re: the big picture for index-only scans
Previous Message Markus Wanner 2011-08-24 08:30:36 Re: cheaper snapshots redux