Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfecbeed

Browse files
author
Michael Meskes
committed
Re-added Tom's patch fixing my setlocale patch. I accidently
deleted it.
1 parentf02ffdf commitfecbeed

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,5 +1107,10 @@ Mon Okt 1 13:49:40 CEST 2001
11071107
- Fixed truncate bug.
11081108
- Added patch by Christof Petig <christof.petig@wtal.de> to clean up
11091109
ecpglib.
1110+
1111+
TUe Okt 2 16:09:26 CEST 2001
1112+
1113+
- Re-added Tom's patch fixing my setlocale patch. I accidently
1114+
deleted it.
11101115
- Set ecpg version to 2.9.0.
11111116
- Set library version to 3.3.0.

‎src/interfaces/ecpg/lib/execute.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.26 2001/10/01 12:02:28 meskes Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.27 2001/10/02 14:08:28 meskes Exp $ */
22

33
/*
44
* The aim is to get a simpler inteface to the database routines.
@@ -1040,23 +1040,26 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
10401040
va_listargs;
10411041
structstatement*stmt;
10421042
structconnection*con=get_connection(connection_name);
1043-
boolstatus= true;
1044-
char*locale;
1043+
boolstatus;
1044+
char*oldlocale;
10451045

10461046
/* Make sure we do NOT honor the locale for numeric input/output */
10471047
/* since the database wants the standard decimal point */
1048-
locale=setlocale(LC_NUMERIC,"C");
1048+
oldlocale=strdup(setlocale(LC_NUMERIC,NULL));
1049+
setlocale(LC_NUMERIC,"C");
10491050

10501051
if (!ecpg_init(con,connection_name,lineno))
10511052
{
1052-
setlocale(LC_NUMERIC,locale);
1053+
setlocale(LC_NUMERIC,oldlocale);
1054+
free(oldlocale);
10531055
return (false);
10541056
}
10551057

10561058
va_start(args,query);
10571059
if (create_statement(lineno,con,&stmt,query,args)== false)
10581060
{
1059-
setlocale(LC_NUMERIC,locale);
1061+
setlocale(LC_NUMERIC,oldlocale);
1062+
free(oldlocale);
10601063
return (false);
10611064
}
10621065
va_end(args);
@@ -1067,15 +1070,18 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
10671070
free_statement(stmt);
10681071
ECPGlog("ECPGdo: not connected to %s\n",con->name);
10691072
ECPGraise(lineno,ECPG_NOT_CONN,NULL);
1070-
setlocale(LC_NUMERIC,locale);
1073+
setlocale(LC_NUMERIC,oldlocale);
1074+
free(oldlocale);
10711075
return false;
10721076
}
10731077

10741078
status=ECPGexecute(stmt);
10751079
free_statement(stmt);
10761080

10771081
/* and reset locale value so our application is not affected */
1078-
setlocale(LC_NUMERIC,locale);
1082+
setlocale(LC_NUMERIC,oldlocale);
1083+
free(oldlocale);
1084+
10791085
return (status);
10801086
}
10811087

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp