- Replaced all strdup() calls by ECPGstrdup().
- Set ecpg library version to 5.2.
- Set ecpg version to 4.2.1.
- Set ecpg library version to 5.1.
- Set ecpg version to 4.1.1.
+Wed Nov 30 12:49:13 CET 2005
+
+ - 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.
+
#
# Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.33 2005/03/14 17:27:50 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.34 2005/11/30 12:49:49 meskes Exp $
#
#-------------------------------------------------------------------------
NAME= ecpg
SO_MAJOR_VERSION= 5
-SO_MINOR_VERSION= 1
+SO_MINOR_VERSION= 2
DLTYPE= library
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.26 2005/10/15 02:49:47 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.27 2005/11/30 12:49:49 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
struct sqlca_t *sqlca = ECPGget_sqlca();
enum COMPAT_MODE compat = c;
struct connection *this;
- char *dbname = name ? strdup(name) : NULL,
+ char *dbname = name ? ECPGstrdup(name, lineno) : NULL,
*host = NULL,
*tmp,
*port = NULL,
if (envname)
{
ECPGfree(dbname);
- dbname = strdup(envname);
+ dbname = ECPGstrdup(envname, lineno);
}
}
tmp = strrchr(dbname, ':');
if (tmp != NULL) /* port number given */
{
- port = strdup(tmp + 1);
+ port = ECPGstrdup(tmp + 1, lineno);
*tmp = '\0';
}
tmp = strrchr(dbname, '@');
if (tmp != NULL) /* host name given */
{
- host = strdup(tmp + 1);
+ host = ECPGstrdup(tmp + 1, lineno);
*tmp = '\0';
}
- realname = strdup(dbname);
+ realname = ECPGstrdup(dbname, lineno);
}
else if (strncmp(dbname, "tcp:", 4) == 0 || strncmp(dbname, "unix:", 5) == 0)
{
tmp = strrchr(dbname + offset, '?');
if (tmp != NULL) /* options given */
{
- options = strdup(tmp + 1);
+ options = ECPGstrdup(tmp + 1, lineno);
*tmp = '\0';
}
tmp = last_dir_separator(dbname + offset);
if (tmp != NULL) /* database name given */
{
- realname = strdup(tmp + 1);
+ realname = ECPGstrdup(tmp + 1, lineno);
*tmp = '\0';
}
if ((tmp2 = strchr(tmp + 1, ':')) != NULL)
{
*tmp2 = '\0';
- host = strdup(tmp + 1);
+ host = ECPGstrdup(tmp + 1, lineno);
if (strncmp(dbname, "unix:", 5) != 0)
{
ECPGlog("connect: socketname %s given for TCP connection in line %d\n", host, lineno);
}
}
else
- port = strdup(tmp + 1);
+ port = ECPGstrdup(tmp + 1, lineno);
}
if (strncmp(dbname, "unix:", 5) == 0)
}
}
else
- host = strdup(dbname + offset);
+ host = ECPGstrdup(dbname + offset, lineno);
}
else
- realname = strdup(dbname);
+ realname = ECPGstrdup(dbname, lineno);
}
else
- realname = strdup(dbname);
+ realname = ECPGstrdup(dbname, lineno);
}
else
realname = NULL;
/* dynamic SQL support routines
*
- * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.12 2004/08/29 05:06:59 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.13 2005/11/30 12:49:49 meskes Exp $
*/
#define POSTGRES_ECPG_INTERNAL
}
bool
-ECPGget_desc_header(int lineno, char *desc_name, int *count)
+ECPGget_desc_header(int lineno, const char *desc_name, int *count)
{
PGresult *ECPGresult;
struct sqlca_t *sqlca = ECPGget_sqlca();
}
bool
-ECPGget_desc(int lineno, char *desc_name, int index,...)
+ECPGget_desc(int lineno, const char *desc_name, int index,...)
{
va_list args;
PGresult *ECPGresult;
/* Make sure we do NOT honor the locale for numeric input */
/* since the database gives the standard decimal point */
- oldlocale = strdup(setlocale(LC_NUMERIC, NULL));
+ oldlocale = ECPGstrdup(setlocale(LC_NUMERIC, NULL), lineno);
setlocale(LC_NUMERIC, "C");
memset(&stmt, 0, sizeof stmt);
}
bool
-ECPGset_desc_header(int lineno, char *desc_name, int count)
+ECPGset_desc_header(int lineno, const char *desc_name, int count)
{
struct descriptor *desc;
}
bool
-ECPGset_desc(int lineno, char *desc_name, int index,...)
+ECPGset_desc(int lineno, const char *desc_name, int index,...)
{
va_list args;
struct descriptor *desc;
-/* $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.
* 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;
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;
return;
free_variable(stmt->inlist);
free_variable(stmt->outlist);
+ ECPGfree(stmt->command);
ECPGfree(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;
/* 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))
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.14 2005/10/15 02:49:47 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.15 2005/11/30 12:49:49 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
/* handle the EXEC SQL PREPARE statement */
bool
-ECPGprepare(int lineno, char *name, char *variable)
+ECPGprepare(int lineno, const char *name, const char *variable)
{
struct statement *stmt;
struct prepared_statement *this;
/* handle the EXEC SQL DEALLOCATE PREPARE statement */
bool
-ECPGdeallocate(int lineno, int c, char *name)
+ECPGdeallocate(int lineno, int c, const char *name)
{
bool ret = ECPGdeallocate_one(lineno, name);
enum COMPAT_MODE compat = c;
}
bool
-ECPGdeallocate_one(int lineno, char *name)
+ECPGdeallocate_one(int lineno, const char *name)
{
struct prepared_statement *this,
*prev;
bool ECPGsetcommit(int, const char *, const char *);
bool ECPGsetconn(int, const char *);
bool ECPGconnect(int, int, const char *, const char *, const char *, const char *, int);
-bool ECPGdo(int, int, int, const char *, char *,...);
+bool ECPGdo(int, int, int, const char *, const char *,...);
bool ECPGtrans(int, const char *, const char *);
bool ECPGdisconnect(int, const char *);
-bool ECPGprepare(int, char *, char *);
-bool ECPGdeallocate(int, int, char *);
-bool ECPGdeallocate_one(int, char *);
+bool ECPGprepare(int, const char *, const char *);
+bool ECPGdeallocate(int, int, const char *);
+bool ECPGdeallocate_one(int, const char *);
bool ECPGdeallocate_all(int);
char *ECPGprepared_statement(const char *);
bool ECPGallocate_desc(int line, const char *name);
void ECPGraise(int line, int code, const char *sqlstate, const char *str);
void ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat);
-bool ECPGget_desc_header(int, char *, int *);
-bool ECPGget_desc(int, char *, int,...);
-bool ECPGset_desc_header(int, char *, int);
-bool ECPGset_desc(int, char *, int,...);
+bool ECPGget_desc_header(int, const char *, int *);
+bool ECPGget_desc(int, const char *, int,...);
+bool ECPGset_desc_header(int, const char *, int);
+bool ECPGset_desc(int, const char *, int,...);
void ECPGset_noind_null(enum ECPGttype, void *);
bool ECPGis_noind_null(enum ECPGttype, void *);
#
# Copyright (c) 1998-2005, PostgreSQL Global Development Group
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.114 2005/03/14 17:27:50 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.115 2005/11/30 12:49:49 meskes Exp $
#
#-------------------------------------------------------------------------
include $(top_builddir)/src/Makefile.global
MAJOR_VERSION= 4
-MINOR_VERSION= 1
+MINOR_VERSION= 2
PATCHLEVEL=1
override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \