mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
- Made several variables "const char *" instead of "char *" as proposed by Qingqing Zhou <zhouqq@cs.toronto.edu>.
- Replaced all strdup() calls by ECPGstrdup(). - Set ecpg library version to 5.2. - Set ecpg version to 4.2.1.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.43 2005/10/15 02:49:47 momjian Exp $ */
|
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.44 2005/11/30 12:49:49 meskes Exp $ */
|
||||
|
||||
/*
|
||||
* The aim is to get a simpler inteface to the database routines.
|
||||
@ -141,7 +141,7 @@ ECPGget_variable(va_list APREF, enum ECPGttype type, struct variable * var, bool
|
||||
* ind_offset - indicator offset
|
||||
*/
|
||||
static bool
|
||||
create_statement(int lineno, int compat, int force_indicator, struct connection * connection, struct statement ** stmt, char *query, va_list ap)
|
||||
create_statement(int lineno, int compat, int force_indicator, struct connection * connection, struct statement ** stmt, const char *query, va_list ap)
|
||||
{
|
||||
struct variable **list = &((*stmt)->inlist);
|
||||
enum ECPGttype type;
|
||||
@ -149,7 +149,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection
|
||||
if (!(*stmt = (struct statement *) ECPGalloc(sizeof(struct statement), lineno)))
|
||||
return false;
|
||||
|
||||
(*stmt)->command = query;
|
||||
(*stmt)->command = ECPGstrdup(query, lineno);
|
||||
(*stmt)->connection = connection;
|
||||
(*stmt)->lineno = lineno;
|
||||
(*stmt)->compat = compat;
|
||||
@ -224,6 +224,7 @@ free_statement(struct statement * stmt)
|
||||
return;
|
||||
free_variable(stmt->inlist);
|
||||
free_variable(stmt->outlist);
|
||||
ECPGfree(stmt->command);
|
||||
ECPGfree(stmt);
|
||||
}
|
||||
|
||||
@ -1359,7 +1360,7 @@ ECPGexecute(struct statement * stmt)
|
||||
}
|
||||
|
||||
bool
|
||||
ECPGdo(int lineno, int compat, int force_indicator, const char *connection_name, char *query,...)
|
||||
ECPGdo(int lineno, int compat, int force_indicator, const char *connection_name, const char *query,...)
|
||||
{
|
||||
va_list args;
|
||||
struct statement *stmt;
|
||||
@ -1369,7 +1370,7 @@ ECPGdo(int lineno, int compat, int force_indicator, const char *connection_name,
|
||||
|
||||
/* Make sure we do NOT honor the locale for numeric input/output */
|
||||
/* since the database wants the standard decimal point */
|
||||
oldlocale = strdup(setlocale(LC_NUMERIC, NULL));
|
||||
oldlocale = ECPGstrdup(setlocale(LC_NUMERIC, NULL), lineno);
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
if (!ECPGinit(con, connection_name, lineno))
|
||||
|
Reference in New Issue
Block a user