diff options
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/execute.c')
-rw-r--r-- | src/interfaces/ecpg/ecpglib/execute.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index e98646214d4..93f912b8915 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.55 2006/07/28 11:49:36 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.56 2006/08/02 13:43:23 meskes Exp $ */ /* * The aim is to get a simpler inteface to the database routines. @@ -1465,7 +1465,7 @@ ECPGdo(int lineno, int compat, int force_indicator, const char *connection_name, { va_list args; struct statement *stmt; - struct connection *con = ECPGget_connection(connection_name); + struct connection *con; bool status; char *oldlocale; @@ -1474,6 +1474,12 @@ ECPGdo(int lineno, int compat, int force_indicator, const char *connection_name, oldlocale = ECPGstrdup(setlocale(LC_NUMERIC, NULL), lineno); setlocale(LC_NUMERIC, "C"); +#ifdef ENABLE_THREAD_SAFETY + ecpg_pthreads_init(); +#endif + + con = ECPGget_connection(connection_name); + if (!ECPGinit(con, connection_name, lineno)) { setlocale(LC_NUMERIC, oldlocale); |