mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Added just another compatibility level for Informix.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.8 2003/06/25 10:44:21 meskes Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.9 2003/06/26 11:37:05 meskes Exp $ */
|
||||
|
||||
#define POSTGRES_ECPG_INTERNAL
|
||||
#include "postgres_fe.h"
|
||||
@@ -304,7 +304,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
|
||||
|
||||
ECPGinit_sqlca(sqlca);
|
||||
|
||||
if (compat == ECPG_COMPAT_INFORMIX)
|
||||
if (INFORMIX_MODE(compat))
|
||||
{
|
||||
char *envname;
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.8 2003/06/25 10:44:21 meskes Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.9 2003/06/26 11:37:05 meskes Exp $ */
|
||||
|
||||
#define POSTGRES_ECPG_INTERNAL
|
||||
#include "postgres_fe.h"
|
||||
@@ -78,7 +78,7 @@ ECPGget_data(const PGresult *results, int act_tuple, int act_field, int lineno,
|
||||
break;
|
||||
#endif /* HAVE_LONG_LONG_INT_64 */
|
||||
case ECPGt_NO_INDICATOR:
|
||||
if (force_indicator == false && compat == ECPG_COMPAT_INFORMIX)
|
||||
if (force_indicator == false)
|
||||
{
|
||||
/* Informix has an additional way to specify NULLs
|
||||
* note that this uses special values to denote NULL */
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.12 2003/06/25 10:44:21 meskes Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.13 2003/06/26 11:37:05 meskes Exp $ */
|
||||
|
||||
/*
|
||||
* The aim is to get a simpler inteface to the database routines.
|
||||
@@ -508,7 +508,7 @@ ECPGstore_input(const struct statement * stmt, const struct variable * var,
|
||||
break;
|
||||
#endif /* HAVE_LONG_LONG_INT_64 */
|
||||
case ECPGt_NO_INDICATOR:
|
||||
if (stmt->force_indicator == false && stmt->compat == ECPG_COMPAT_INFORMIX)
|
||||
if (stmt->force_indicator == false)
|
||||
{
|
||||
if (ECPGis_informix_null(var->type, var->value))
|
||||
*tobeinserted_p = "null";
|
||||
@@ -1186,7 +1186,9 @@ ECPGexecute(struct statement * stmt)
|
||||
sqlca->sqlerrd[1] = PQoidValue(results);
|
||||
sqlca->sqlerrd[2] = atol(PQcmdTuples(results));
|
||||
ECPGlog("ECPGexecute line %d Ok: %s\n", stmt->lineno, cmdstat);
|
||||
if (!sqlca->sqlerrd[2] && ( !strncmp(cmdstat, "UPDATE", 6)
|
||||
if (stmt->compat != ECPG_COMPAT_INFORMIX_SE &&
|
||||
!sqlca->sqlerrd[2] &&
|
||||
( !strncmp(cmdstat, "UPDATE", 6)
|
||||
|| !strncmp(cmdstat, "INSERT", 6)
|
||||
|| !strncmp(cmdstat, "DELETE", 6)))
|
||||
ECPGraise(stmt->lineno, ECPG_NOT_FOUND, NULL);
|
||||
|
@@ -5,7 +5,8 @@
|
||||
#include "libpq-fe.h"
|
||||
#include "sqlca.h"
|
||||
|
||||
enum COMPAT_MODE { ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX};
|
||||
enum COMPAT_MODE { ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE};
|
||||
#define INFORMIX_MODE(X) ((X) == ECPG_COMPAT_INFORMIX || (X) == ECPG_COMPAT_INFORMIX_SE)
|
||||
|
||||
/* Here are some methods used by the lib. */
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.4 2003/06/25 10:44:21 meskes Exp $ */
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/prepare.c,v 1.5 2003/06/26 11:37:05 meskes Exp $ */
|
||||
|
||||
#define POSTGRES_ECPG_INTERNAL
|
||||
#include "postgres_fe.h"
|
||||
@@ -110,7 +110,7 @@ ECPGdeallocate(int lineno, int c, char *name)
|
||||
bool ret = ECPGdeallocate_one(lineno, name);
|
||||
enum COMPAT_MODE compat = c;
|
||||
|
||||
if (compat == ECPG_COMPAT_INFORMIX)
|
||||
if (INFORMIX_MODE(compat))
|
||||
{
|
||||
/* Just ignore all errors since we do not know the list of cursors we
|
||||
* are allowed to free. We have to trust that the software. */
|
||||
|
Reference in New Issue
Block a user