From 35ba9de276150fd3d589509a86ae651924f34cb3 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Wed, 16 Feb 2000 16:18:29 +0000 Subject: *** empty log message *** --- src/interfaces/ecpg/lib/ecpglib.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/interfaces/ecpg/lib/ecpglib.c') diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c index 5074bc20e07..a6e2b23e01b 100644 --- a/src/interfaces/ecpg/lib/ecpglib.c +++ b/src/interfaces/ecpg/lib/ecpglib.c @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -753,7 +752,7 @@ ECPGexecute(struct statement * stmt) { char *pval; char *scan_length; - char *array_query; + char *array_query; if (var == NULL) { @@ -1127,36 +1126,44 @@ ECPGexecute(struct statement * stmt) bool ECPGdo(int lineno, const char *connection_name, char *query,...) { - va_list args; - struct statement *stmt; - struct connection *con = get_connection(connection_name); - bool status; - char *locale = setlocale(LC_NUMERIC, NULL); + va_list args; + struct statement *stmt; + struct connection *con = get_connection(connection_name); + bool status=true; + char *locale = setlocale(LC_NUMERIC, NULL); /* Make sure we do NOT honor the locale for numeric input/output */ /* since the database wants teh standard decimal point */ setlocale(LC_NUMERIC, "C"); if (!ecpg_init(con, connection_name, lineno)) + { + setlocale(LC_NUMERIC, locale); return(false); + } va_start(args, query); if (create_statement(lineno, con, &stmt, query, args) == false) + { + setlocale(LC_NUMERIC, locale); return (false); + } va_end(args); /* are we connected? */ if (con == NULL || con->connection == NULL) { + free_statement(stmt); ECPGlog("ECPGdo: not connected to %s\n", con->name); register_error(ECPG_NOT_CONN, "Not connected in line %d.", lineno); + setlocale(LC_NUMERIC, locale); return false; } status = ECPGexecute(stmt); free_statement(stmt); - /* and reser value so our application is not affected */ + /* and reset locale value so our application is not affected */ setlocale(LC_NUMERIC, locale); return (status); } @@ -1508,3 +1515,5 @@ ECPGprepared_statement(char *name) for (this = prep_stmts; this != NULL && strcmp(this->name, name) != 0; this = this->next); return (this) ? this->stmt->command : NULL; } + +#include "dynamic.c" -- cgit v1.2.3