git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 48fb49e)
In ecpglib restore LC_NUMERIC in case of an error.
Thu, 1 Sep 2011 13:27:38 +0000 (15:27 +0200)
Thu, 1 Sep 2011 13:46:12 +0000 (15:46 +0200)

diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c
index f173736757bab22d8d33c390718dc8478ceb73b4..f34ea1f3f4fc7d8a8303e6b8b25cfb2ccc4a769f 100644 (file)
--- 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);
}
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /