Skip site navigation (1) Skip section navigation (2)

ECPGdo fails to restore LC_NUMERIC

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: ECPGdo fails to restore LC_NUMERIC
Date: 2011-09-01 11:27:07
Message-ID: 4E5F6C0B.6030708@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-bugs
ECPGdo function in ecpglib sets LC_NUMERIC locale temporarily to C, to 
make sure it uses the '.' as the decimal separator for any numerics it 
sends to the backend. However, it fails to restore it back to the 
original locale in some error cases. I can see two returns from the 
function that neglect that, on lines 1776 and 1803 in execute.c.

Attached is a test program to showcase the first of those. It produces 
this output for me:

LC_NUMERIC before: fi_FI.utf8
number: 1,230000
LC_NUMERIC after: C
number: 1.230000

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachment: autoprep-setlocale.pgc
Description: text/plain (439 bytes)

Responses

pgsql-bugs by date

Next:From: Kevin GrittnerDate: 2011-09-01 13:42:05
Subject: Re: The translation into Bulgarian
Previous:From: LampaDate: 2011-09-01 09:59:02
Subject: Re: BUG #6186: out of memory while analyze

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group