Skip to content

Commit cb8961a

Browse files
author
Michael Meskes
committed
Added patch to temporarily disable locale for descriptors too (Christof)
1 parent 9d25b39 commit cb8961a

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,5 +1211,9 @@ Sat Jan 12 22:04:02 CET 2002
12111211
Fri Jan 18 16:49:02 CET 2002
12121212

12131213
- Accept subsequent commits.
1214+
1215+
Wed Jan 23 17:35:23 CET 2002
1216+
1217+
- Added patch to temporarily disable locale for descriptors too (Christof).
12141218
- Set ecpg version to 2.9.0.
12151219
- Set library version to 3.3.0.

src/interfaces/ecpg/lib/descriptor.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* dynamic SQL support routines
22
*
3-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/descriptor.c,v 1.21 2002/01/11 14:43:11 meskes Exp $
3+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/descriptor.c,v 1.22 2002/01/23 16:34:06 meskes Exp $
44
*/
55

66
#include "postgres_fe.h"
@@ -330,11 +330,22 @@ ECPGget_desc(int lineno, char *desc_name, int index,...)
330330
if (data_var.type!=ECPGt_EORT)
331331
{
332332
struct statement stmt;
333+
char *oldlocale;
334+
335+
/* Make sure we do NOT honor the locale for numeric input */
336+
/* since the database gives the standard decimal point */
337+
oldlocale = strdup(setlocale(LC_NUMERIC, NULL));
338+
setlocale(LC_NUMERIC, "C");
339+
333340
memset (&stmt, 0, sizeof stmt);
334341
stmt.lineno=lineno;
342+
335343
/* desparate try to guess something sensible */
336344
stmt.connection=ECPGget_connection(NULL);
337345
ECPGstore_result(ECPGresult, index, &stmt, &data_var);
346+
347+
setlocale(LC_NUMERIC, oldlocale);
348+
ECPGfree(oldlocale);
338349
}
339350
else if (data_var.ind_type!=ECPGt_NO_INDICATOR)
340351
{

src/interfaces/ecpg/test/header_test.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
exec sql include sqlca;
2-
31
#include "stdlib.h"
42

53
static void

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy