summaryrefslogtreecommitdiff
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:31:16 +0200
commitf8c74422010e63506fa69635ea61920bc042b70e (patch)
tree9f67bcdf9322c47c55da5ab4491336cc53d9536b /src
parenta02e40990433e59dee14129c119184dcbca4c2e3 (diff)
In ecpglib restore LC_NUMERIC in case of an error.
Diffstat (limited to 'src')
-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 1019bfe6201..589c57dffa8 100644
--- a/src/interfaces/ecpg/ecpglib/execute.c
+++ b/src/interfaces/ecpg/ecpglib/execute.c
@@ -1773,8 +1773,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
@@ -1801,6 +1805,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);
}
}