1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Added some more informix compatibility functions.

This commit is contained in:
Michael Meskes
2003-04-08 12:34:25 +00:00
parent cd203f3395
commit a50f285d8d
6 changed files with 34 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $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"
@ -11,6 +11,8 @@
static struct connection *all_connections = NULL,
*actual_connection = NULL;
extern enum COMPAT_MODE ecpg_compat_mode;
struct connection *
ECPGget_connection(const char *connection_name)
{
@ -267,13 +269,26 @@ ECPGconnect(int lineno, const char *name, const char *user, const char *passwd,
*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";