Skip to content

Commit 63d06ef

Browse files
author
Michael Meskes
committed
In ecpglib restore LC_NUMERIC in case of an error.
1 parent 48fb49e commit 63d06ef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/interfaces/ecpg/ecpglib/execute.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,8 +1772,12 @@ ECPGdo(const int lineno, const int compat, const int force_indicator, const char
17721772
*/
17731773
if (statement_type == ECPGst_prepnormal)
17741774
{
1775-
if (!ecpg_auto_prepare(lineno, connection_name, compat, &prepname, query))
1775+
if (!ecpg_auto_prepare(lineno, connection_name, compat, &prepname, query)) {
1776+
setlocale(LC_NUMERIC, oldlocale);
1777+
ecpg_free(oldlocale);
1778+
va_end(args);
17761779
return (false);
1780+
}
17771781

17781782
/*
17791783
* 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
18001804
else
18011805
{
18021806
ecpg_raise(lineno, ECPG_INVALID_STMT, ECPG_SQLSTATE_INVALID_SQL_STATEMENT_NAME, stmt->command);
1807+
setlocale(LC_NUMERIC, oldlocale);
1808+
ecpg_free(oldlocale);
1809+
va_end(args);
18031810
return (false);
18041811
}
18051812
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy