aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2011-09-01 15:27:38 +0200
committerMichael Meskes <meskes@postgresql.org>2011-09-01 15:35:09 +0200
commita6d72ac344a8643142d76abe2c9d0b1ea68847fb (patch)
treeb4e9056a85f41291f454aac5a20e491e9008ea2f /src
parentf2d875983b9a1acf8c49477b5afe733a3ba7a817 (diff)
downloadpostgresql-a6d72ac344a8643142d76abe2c9d0b1ea68847fb.tar.gz
postgresql-a6d72ac344a8643142d76abe2c9d0b1ea68847fb.zip
In ecpglib restore LC_NUMERIC in case of an error.
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index 6836df65f6c..05cbb3ecb12 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -1503,8 +1503,12 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
*/
if (statement_type == ECPGst_prepnormal)
{
- if (!ecpg_auto_prepare(lineno, connection_name, compat, &prepname, query))
+ if (!ecpg_auto_prepare(lineno, connection_name, compat, &prepname, query)) {
+ setlocale(LC_NUMERIC, oldlocale);
+ ecpg_free(oldlocale);
+ va_end(args);
return (false);
+ }
/*
* statement is now prepared, so instead of the query we have to