aboutsummaryrefslogtreecommitdiff
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:46:12 +0200
commit63d06ef59156719efd0208c62e764a69611b3f12 (patch)
treee5f0d6b9e775f023af8f845d6d56eabda9f0beb2
parent48fb49e39445a5429b24111658b193ed36b09da3 (diff)
downloadpostgresql-63d06ef59156719efd0208c62e764a69611b3f12.tar.gz
postgresql-63d06ef59156719efd0208c62e764a69611b3f12.zip
In ecpglib restore LC_NUMERIC in case of an error.
-rw-r--r--src/interfaces/ecpg/ecpglib/execute.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index f173736757b..f34ea1f3f4f 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -1772,8 +1772,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
@@ -1800,6 +1804,9 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
else
{
ecpg_raise(lineno, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt->command);
+ setlocale(LC_NUMERIC, oldlocale);
+ ecpg_free(oldlocale);
+ va_end(args);
return (false);
}
}