Sun Mar 30 13:43:13 CEST 2003
- Interval datetype now fully functional.
+
+Tue Apr 8 14:03:32 CEST 2003
+
+ - Added rstrdate function.
+ - Made Informix mode honor environment variable to set dbname to
+ connect to.
- Set ecpg version to 2.12.0.
- Set ecpg library to 3.4.2.
- Set pgtypes library to 1.0.0
{
Date dat = PGTYPESdate_from_asc(str, NULL);
- /* XXX: ERROR handling hier und in datetime.c */
+ if (errno != PGTYPES_DATE_BAD_DATE && dat == 0)
+ return -1218;
+
+ *d=dat;
return 0;
}
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.2 2003/04/04 20:42:13 momjian Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.3 2003/04/08 12:34:25 meskes Exp $ */
#include "postgres_fe.h"
static struct connection *all_connections = NULL,
*actual_connection = NULL;
+extern enum COMPAT_MODE ecpg_compat_mode;
+
struct connection *
ECPGget_connection(const char *connection_name)
{
*tmp,
*port = NULL,
*realname = NULL,
- *options = NULL;
+ *options = NULL,
+ *envname;
ECPGinit_sqlca();
if ((this = (struct connection *) ECPGalloc(sizeof(struct connection), lineno)) == NULL)
return false;
+ if (ecpg_compat_mode == ECPG_COMPAT_INFORMIX)
+ {
+ /* Informix uses an environment variable DBPATH that overrides
+ * the connection parameters given here */
+ envname = getenv("DBPATH");
+ if (envname)
+ {
+ free(dbname);
+ dbname=strdup(envname);
+ }
+ }
+
if (dbname == NULL && connection_name == NULL)
connection_name = "DEFAULT";
/* dynamic result allocation */
void ECPGfree_auto_mem(void);
+enum COMPAT_MODE { ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX};
+
#ifdef __cplusplus
}
bool EuroDates = FALSE;
+ errno = 0;
if (strlen(str) >= sizeof(lowstr))
{
errno = PGTYPES_DATE_BAD_DATE;
- return -1;
+ return 0;
}
if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf, ptr) != 0)
|| (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp, EuroDates) != 0))
{
errno = PGTYPES_DATE_BAD_DATE;
- return -1;
+ return 0;
}
switch (dtype)
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.65 2003/04/04 20:42:13 momjian Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.66 2003/04/08 12:34:25 meskes Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
lex_init();
/* we need several includes */
- fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n/* These four include files are added by the preprocessor */\n#include <ecpgtype.h>\n#include <ecpglib.h>\n#include <ecpgerrno.h>\n#include <sqlca.h>\n#line 1 \"%s\"\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL, input_filename);
+ fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n/* These four include files are added by the preprocessor */\n#include <ecpgtype.h>\n#include <ecpglib.h>\n#include <ecpgerrno.h>\n#include <sqlca.h>\n#line 1 \"%s\"\nenum COMPAT_MODE ecpg_compat_mode=%d;\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL, input_filename, compat);
/* add some compatibility headers */
if (compat == ECPG_COMPAT_INFORMIX)