Sun Jun 22 11:20:29 CEST 2003
- Fixed missing '\0' in output char pointer.
+
+Wed Jun 25 09:29:34 CEST 2003
+
+ - Synced keyword.x and preproc.y/gram.y.
+ - Implemented Informix special way to treat NULLs.
+
+Thu Jun 26 13:26:13 CEST 2003
+
+ - Added another compatibility level INFORMIX_SE.
+ - Synced again.
- Set ecpg version to 3.0.0
- Set ecpg library to 4.0.0
- Set pgtypes library to 1.0.0
-/* $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"
ECPGinit_sqlca(sqlca);
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE(compat) )
{
char *envname;
-/* $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"
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 */
-/* $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.
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";
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);
#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. */
-/* $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"
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. */
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.74 2003/06/25 10:44:21 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.75 2003/06/26 11:37:05 meskes Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes Feb 5th, 1998 */
printf(" -d generate parser debug output\n");
#endif
printf(" -C set compatibility mode\n"
- " mode may be \"INFORMIX\" only at the moment\n");
+ " mode may be one of\n"
+ " \"INFORMIX\"\n"
+ " \"INFORMIX_SE\"\n");
printf(" -r specify runtime behaviour\n"
" option may be only \"no_indicator\" at the moment\n");
printf(" -D SYMBOL define SYMBOL\n");
system_includes = true;
break;
case 'C':
- if (strcmp(optarg, "INFORMIX" ) == 0)
+ if (strncmp(optarg, "INFORMIX", strlen("INFORMIX") ) == 0)
{
- compat = ECPG_COMPAT_INFORMIX ;
+ compat = (strcmp(optarg, "INFORMIX") == 0) ? ECPG_COMPAT_INFORMIX : ECPG_COMPAT_INFORMIX_SE ;
/* system_includes = true; */
add_preprocessor_define("dec_t=Numeric");
add_preprocessor_define("intrvl_t=Interval");
fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n/* These four include files are added by the preprocessor */\n#include \n#include \n#include \n#include \n#line 1 \"%s\"\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL, input_filename);
/* add some compatibility headers */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
fprintf(yyout, "/* Needed for informix compatibility */\n#include \n");
/* and parse the source */
#define INDICATOR_NOT_STRUCT 6
#define INDICATOR_NOT_SIMPLE 7
-enum COMPAT_MODE { ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX};
+enum COMPAT_MODE { ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE };
extern enum COMPAT_MODE compat;
+#define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
#endif /* _ECPG_PREPROC_EXTERN_H */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.117 2003/06/20 15:16:06 meskes Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.118 2003/06/26 11:37:05 meskes Exp $
*
*-------------------------------------------------------------------------
*/
{typecast} { return TYPECAST; }
{informix_special} {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
unput(':');
}
{exec_sql} { BEGIN SQL; return SQL_START; }
{informix_special} {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
BEGIN SQL;
return SQL_START;
{exec_sql}{define}{space}* { BEGIN(def_ident); }
{informix_special}{define}{space}* {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
BEGIN(def_ident);
}
{exec_sql}{include}{space}* { BEGIN(incl); }
{informix_special}{include}{space}* {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
BEGIN(incl);
}
{exec_sql}{ifdef}{space}* { ifcond = TRUE; BEGIN(xcond); }
{informix_special}{ifdef}{space}* {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
ifcond = TRUE;
BEGIN(xcond);
{exec_sql}{ifndef}{space}* { ifcond = FALSE; BEGIN(xcond); }
{informix_special}{ifndef}{space}* {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
ifcond = FALSE;
BEGIN(xcond);
}
{informix_special}{elif}{space}* {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
if ( preproc_tos == 0 ) {
mmerror(PARSE_ERROR, ET_FATAL, "Missing matching 'EXEC SQL IFDEF / EXEC SQL IFNDEF'");
}
{informix_special}{else}{space}* {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
if ( stacked_if_value[preproc_tos].else_branch ) {
mmerror(PARSE_ERROR, ET_FATAL, "Duplicated 'EXEC SQL ELSE;'");
}
{informix_special}{endif}{space}*";" {
/* are we simulating Informix? */
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
{
if ( preproc_tos == 0 )
mmerror(PARSE_ERROR, ET_FATAL, "Unmatched 'EXEC SQL ENDIF;'");
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.239 2003/06/25 21:30:33 momjian Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.240 2003/06/26 11:37:05 meskes Exp $ */
/* Copyright comment */
%{
argsinsert = argsresult = NULL;
cur = this;
- if (compat == ECPG_COMPAT_INFORMIX )
+ if (INFORMIX_MODE )
$$ = cat_str(5, adjust_informix(this->argsinsert), adjust_informix(this->argsresult), make_str("/*"), mm_strdup(this->command), make_str("*/"));
else
$$ = cat_str(3, make_str("/*"), mm_strdup(this->command), make_str("*/"));
{ $$ = cat_str(3, $1, make_str("not in"), $4); }
| a_expr qual_all_Op sub_type select_with_parens %prec Op
{ $$ = cat_str(4, $1, $2, $3, $4); }
- | a_expr qual_all_Op sub_type '(' a_expr ')' %prec Op
- { $$ = cat_str(6, $1, $2, $3, make_str("("), $5, make_str(")")); }
| UNIQUE select_with_parens %prec Op
{ $$ = cat2_str(make_str("unique"), $2); }
| r_expr
else
printf("%d %d\n", i, j);
}
-
+
+ $delete from test where i=87;
+ printf("delete: %ld\n", sqlca.sqlcode);
+
+ $commit;
$drop table test;
+ $commit;
$disconnect;