Re: ECPG patch: get descriptor did not use "C" locale while

Поиск
Список
Период
Сортировка
От Bernhard Herzog
Тема Re: ECPG patch: get descriptor did not use "C" locale while
Дата
Msg-id 6qofjl10su.fsf@abnoba.intevation.de
обсуждение исходный текст
Ответ на Re: ECPG patch: get descriptor did not use "C" locale while  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-interfaces
Bruce Momjian <pgman@candle.pha.pa.us> writes:

> RCS file: /projects/cvsroot/pgsql/src/interfaces/ecpg/lib/descriptor.c,v
> retrieving revision 1.21
> diff -u -r1.21 descriptor.c
> --- lib/descriptor.c    2002/01/11 14:43:11    1.21
> +++ lib/descriptor.c    2002/01/23 15:32:54
> @@ -330,11 +330,18 @@
>      if (data_var.type!=ECPGt_EORT)
>      {
>          struct statement stmt;
> +        char       *oldlocale;
> +
> +        /* Make sure we do NOT honor the locale for numeric input */
> +        /* since the database gives the standard decimal point */
> +        oldlocale = strdup(setlocale(LC_NUMERIC, NULL));
> +        setlocale(LC_NUMERIC, "C");
>          memset (&stmt, 0, sizeof stmt);
>          stmt.lineno=lineno;
>          /* desparate try to guess something sensible */
>          stmt.connection=ECPGget_connection(NULL);
>          ECPGstore_result(ECPGresult, index, &stmt, &data_var);
> +        setlocale(LC_NUMERIC, oldlocale);

There should be a free(oldlocale); here, I think.

>      }

 Bernhard


-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                               http://mapit.de/


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Christof Petig
Дата:
Сообщение: Re: ECPG patch: get descriptor did not use "C" locale while parsing data
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: ECPG patch: get descriptor did not use "C" locale while parsing data