Commit 635a0b9a authored by Michael Meskes's avatar Michael Meskes

- Finished major rewrite to use new protocol version

- Really prepare statements
- Added more regression tests
- Added auto-prepare mode
- Use '$n' for positional variables, '?' is still possible via ecpg option
- Cleaned up the sources a little bit
parent b83bd31b
...@@ -2215,5 +2215,15 @@ Tue, 12 Jun 2007 09:46:03 +0200 ...@@ -2215,5 +2215,15 @@ Tue, 12 Jun 2007 09:46:03 +0200
Wed, 25 Jul 2007 15:34:54 +0200 Wed, 25 Jul 2007 15:34:54 +0200
- Synced parser. - Synced parser.
- Set ecpg library version to 5.3.
- Set ecpg version to 4.3.1. Tue, 14 Aug 2007 11:46:51 +0200
- Finished major rewrite to use new protocol version.
- Really prepare statements.
- Added more regression tests.
- Added auto-prepare mode.
- Use '$n' for positional variables, '?' is still possible via ecpg
option.
- Cleaned up the sources a little bit.
- Set ecpg library version to 6.0.
- Set ecpg version to 4.4.
/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.48 2006/10/04 00:30:11 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.49 2007/08/14 10:01:52 meskes Exp $ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -202,10 +202,11 @@ deccvasc(char *cp, int len, decimal *np) ...@@ -202,10 +202,11 @@ deccvasc(char *cp, int len, decimal *np)
} }
else else
{ {
if (PGTYPESnumeric_to_decimal(result, np) != 0) int i = PGTYPESnumeric_to_decimal(result, np);
ret = ECPG_INFORMIX_NUM_OVERFLOW;
free(result); free(result);
if (i != 0)
ret = ECPG_INFORMIX_NUM_OVERFLOW;
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.46 2007/01/20 17:16:17 petere Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.47 2007/08/14 10:01:52 meskes Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -13,8 +13,8 @@ top_builddir = ../../../.. ...@@ -13,8 +13,8 @@ top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
NAME= ecpg NAME= ecpg
SO_MAJOR_VERSION= 5 SO_MAJOR_VERSION= 6
SO_MINOR_VERSION= 3 SO_MINOR_VERSION= 0
DLTYPE= library DLTYPE= library
override CPPFLAGS := -DFRONTEND \ override CPPFLAGS := -DFRONTEND \
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.41 2007/03/29 12:02:24 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.42 2007/08/14 10:01:52 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -185,11 +185,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name) ...@@ -185,11 +185,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
{ {
if (con->committed) if (con->committed)
{ {
if ((results = PQexec(con->connection, "begin transaction")) == NULL) results = PQexec(con->connection, "begin transaction");
{ if (!ECPGcheck_PQresult(results, lineno, con->connection, ECPG_COMPAT_PGSQL))
ECPGraise(lineno, ECPG_TRANS, ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN, NULL);
return false; return false;
}
PQclear(results); PQclear(results);
con->committed = false; con->committed = false;
} }
...@@ -199,11 +197,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name) ...@@ -199,11 +197,9 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
{ {
if (!con->committed) if (!con->committed)
{ {
if ((results = PQexec(con->connection, "commit")) == NULL) results = PQexec(con->connection, "commit");
{ if (!ECPGcheck_PQresult(results, lineno, con->connection, ECPG_COMPAT_PGSQL))
ECPGraise(lineno, ECPG_TRANS, ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN, NULL);
return false; return false;
}
PQclear(results); PQclear(results);
con->committed = true; con->committed = true;
} }
...@@ -249,7 +245,7 @@ ECPGnoticeReceiver(void *arg, const PGresult *result) ...@@ -249,7 +245,7 @@ ECPGnoticeReceiver(void *arg, const PGresult *result)
if (strncmp(sqlstate, "00", 2) == 0) if (strncmp(sqlstate, "00", 2) == 0)
return; return;
ECPGlog("%s", message); ECPGlog("ECPGnoticeReceiver %s\n", message);
/* map to SQLCODE for backward compatibility */ /* map to SQLCODE for backward compatibility */
if (strcmp(sqlstate, ECPG_SQLSTATE_INVALID_CURSOR_NAME) == 0) if (strcmp(sqlstate, ECPG_SQLSTATE_INVALID_CURSOR_NAME) == 0)
......
/* dynamic SQL support routines /* dynamic SQL support routines
* *
* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.22 2007/06/11 11:52:08 meskes Exp $ * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.23 2007/08/14 10:01:52 meskes Exp $
*/ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
...@@ -495,6 +495,8 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...) ...@@ -495,6 +495,8 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...)
if (!desc_item) if (!desc_item)
return false; return false;
desc_item->num = index; desc_item->num = index;
if (desc->count < index)
desc->count = index;
desc_item->next = desc->items; desc_item->next = desc->items;
desc->items = desc_item; desc->items = desc_item;
} }
...@@ -508,7 +510,6 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...) ...@@ -508,7 +510,6 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...)
{ {
enum ECPGdtype itemtype; enum ECPGdtype itemtype;
const char *tobeinserted = NULL; const char *tobeinserted = NULL;
bool malloced;
itemtype = va_arg(args, enum ECPGdtype); itemtype = va_arg(args, enum ECPGdtype);
...@@ -542,11 +543,12 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...) ...@@ -542,11 +543,12 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...)
{ {
case ECPGd_data: case ECPGd_data:
{ {
if (!ECPGstore_input(lineno, true, var, &tobeinserted, &malloced, false)) if (!ECPGstore_input(lineno, true, var, &tobeinserted, false))
{ {
ECPGfree(var); ECPGfree(var);
return false; return false;
} }
ECPGfree(desc_item->data); /* free() takes care of a potential NULL value */ ECPGfree(desc_item->data); /* free() takes care of a potential NULL value */
desc_item->data = (char *) tobeinserted; desc_item->data = (char *) tobeinserted;
tobeinserted = NULL; tobeinserted = NULL;
...@@ -583,13 +585,7 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...) ...@@ -583,13 +585,7 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...)
return false; return false;
} }
} }
} while (true);
/*
* if (itemtype == ECPGd_data) { free(desc_item->data);
* desc_item->data = NULL; }
*/
}
while (true);
ECPGfree(var); ECPGfree(var);
return true; return true;
...@@ -598,18 +594,18 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...) ...@@ -598,18 +594,18 @@ ECPGset_desc(int lineno, const char *desc_name, int index,...)
bool bool
ECPGdeallocate_desc(int line, const char *name) ECPGdeallocate_desc(int line, const char *name)
{ {
struct descriptor *i; struct descriptor *desc;
struct descriptor **lastptr = &all_descriptors; struct descriptor **lastptr = &all_descriptors;
struct sqlca_t *sqlca = ECPGget_sqlca(); struct sqlca_t *sqlca = ECPGget_sqlca();
ECPGinit_sqlca(sqlca); ECPGinit_sqlca(sqlca);
for (i = all_descriptors; i; lastptr = &i->next, i = i->next) for (desc = all_descriptors; desc; lastptr = &desc->next, desc = desc->next)
{ {
if (!strcmp(name, i->name)) if (!strcmp(name, desc->name))
{ {
struct descriptor_item *desc_item; struct descriptor_item *desc_item;
for (desc_item = i->items; desc_item;) for (desc_item = desc->items; desc_item;)
{ {
struct descriptor_item *di; struct descriptor_item *di;
...@@ -619,10 +615,10 @@ ECPGdeallocate_desc(int line, const char *name) ...@@ -619,10 +615,10 @@ ECPGdeallocate_desc(int line, const char *name)
ECPGfree(di); ECPGfree(di);
} }
*lastptr = i->next; *lastptr = desc->next;
ECPGfree(i->name); ECPGfree(desc->name);
PQclear(i->result); PQclear(desc->result);
ECPGfree(i); ECPGfree(desc);
return true; return true;
} }
} }
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.16 2007/05/31 15:13:05 petere Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/error.c,v 1.17 2007/08/14 10:01:52 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "extern.h" #include "extern.h"
#include "sqlca.h" #include "sqlca.h"
void void
ECPGraise(int line, int code, const char *sqlstate, const char *str) ECPGraise(int line, int code, const char *sqlstate, const char *str)
{ {
...@@ -196,6 +195,59 @@ ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat) ...@@ -196,6 +195,59 @@ ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat)
ECPGfree_auto_mem(); ECPGfree_auto_mem();
} }
/* filter out all error codes */
bool
ECPGcheck_PQresult(PGresult *results, int lineno, PGconn *connection, enum COMPAT_MODE compat)
{
if (results == NULL)
{
ECPGlog("ECPGcheck_PQresult line %d: error: %s", lineno, PQerrorMessage(connection));
ECPGraise_backend(lineno, NULL, connection, compat);
return (false);
}
switch (PQresultStatus(results))
{
case PGRES_TUPLES_OK:
return (true);
break;
case PGRES_EMPTY_QUERY:
/* do nothing */
ECPGraise(lineno, ECPG_EMPTY, ECPG_SQLSTATE_ECPG_INTERNAL_ERROR, NULL);
PQclear(results);
return (false);
break;
case PGRES_COMMAND_OK:
return (true);
break;
case PGRES_NONFATAL_ERROR:
case PGRES_FATAL_ERROR:
case PGRES_BAD_RESPONSE:
ECPGlog("ECPGcheck_PQresult line %d: Error: %s", lineno, PQresultErrorMessage(results));
ECPGraise_backend(lineno, results, connection, compat);
PQclear(results);
return (false);
break;
case PGRES_COPY_OUT:
return(true);
break;
case PGRES_COPY_IN:
ECPGlog("ECPGcheck_PQresult line %d: Got PGRES_COPY_IN ... tossing.\n", lineno);
PQendcopy(connection);
PQclear(results);
return(false);
break;
default:
ECPGlog("ECPGcheck_PQresult line %d: Got something else, postgres error.\n",
lineno);
ECPGraise_backend(lineno, results, connection, compat);
PQclear(results);
return(false);
break;
}
}
/* print out an error message */ /* print out an error message */
void void
sqlprint(void) sqlprint(void)
......
This diff is collapsed.
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.24 2007/04/27 07:55:14 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/extern.h,v 1.25 2007/08/14 10:01:52 meskes Exp $ */
#ifndef _ECPG_LIB_EXTERN_H #ifndef _ECPG_LIB_EXTERN_H
#define _ECPG_LIB_EXTERN_H #define _ECPG_LIB_EXTERN_H
...@@ -70,9 +70,12 @@ struct statement ...@@ -70,9 +70,12 @@ struct statement
{ {
int lineno; int lineno;
char *command; char *command;
char *name;
struct connection *connection; struct connection *connection;
enum COMPAT_MODE compat; enum COMPAT_MODE compat;
bool force_indicator; bool force_indicator;
enum ECPG_statement_type statement_type;
bool questionmarks;
struct variable *inlist; struct variable *inlist;
struct variable *outlist; struct variable *outlist;
}; };
...@@ -133,7 +136,12 @@ PGresult **ECPGdescriptor_lvalue(int line, const char *descriptor); ...@@ -133,7 +136,12 @@ PGresult **ECPGdescriptor_lvalue(int line, const char *descriptor);
bool ECPGstore_result(const PGresult *results, int act_field, bool ECPGstore_result(const PGresult *results, int act_field,
const struct statement * stmt, struct variable * var); const struct statement * stmt, struct variable * var);
bool ECPGstore_input(const int, const bool, const struct variable *, const char **, bool *, bool); bool ECPGstore_input(const int, const bool, const struct variable *, const char **, bool);
bool ECPGcheck_PQresult(PGresult *, int, PGconn *, enum COMPAT_MODE);
void ECPGraise(int line, int code, const char *sqlstate, const char *str);
void ECPGraise_backend(int line, PGresult *result, PGconn *conn, int compat);
char *ECPGprepared(const char *, int);
/* SQLSTATE values generated or processed by ecpglib (intentionally /* SQLSTATE values generated or processed by ecpglib (intentionally
* not exported -- users should refer to the codes directly) */ * not exported -- users should refer to the codes directly) */
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.35 2007/03/29 12:02:24 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.36 2007/08/14 10:01:52 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL #define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -213,20 +213,14 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction) ...@@ -213,20 +213,14 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
if (con->committed && !con->autocommit && strncmp(transaction, "begin", 5) != 0 && strncmp(transaction, "start", 5) != 0) if (con->committed && !con->autocommit && strncmp(transaction, "begin", 5) != 0 && strncmp(transaction, "start", 5) != 0)
{ {
res = PQexec(con->connection, "begin transaction"); res = PQexec(con->connection, "begin transaction");
if (res == NULL || PQresultStatus(res) != PGRES_COMMAND_OK) if (!ECPGcheck_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
{
ECPGraise(lineno, ECPG_TRANS, ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN, NULL);
return FALSE; return FALSE;
}
PQclear(res); PQclear(res);
} }
res = PQexec(con->connection, transaction); res = PQexec(con->connection, transaction);
if (res == NULL || PQresultStatus(res) != PGRES_COMMAND_OK) if (!ECPGcheck_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL))
{
ECPGraise(lineno, ECPG_TRANS, ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN, NULL);
return FALSE; return FALSE;
}
PQclear(res); PQclear(res);
} }
......
This diff is collapsed.
/* /*
* this is a small part of c.h since we don't want to leak all postgres * this is a small part of c.h since we don't want to leak all postgres
* definitions into ecpg programs * definitions into ecpg programs
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.70 2006/10/04 00:30:11 momjian Exp $ * $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpglib.h,v 1.71 2007/08/14 10:01:52 meskes Exp $
*/ */
#ifndef _ECPGLIB_H #ifndef _ECPGLIB_H
...@@ -44,14 +44,14 @@ bool ECPGstatus(int, const char *); ...@@ -44,14 +44,14 @@ bool ECPGstatus(int, const char *);
bool ECPGsetcommit(int, const char *, const char *); bool ECPGsetcommit(int, const char *, const char *);
bool ECPGsetconn(int, const char *); bool ECPGsetconn(int, const char *);
bool ECPGconnect(int, int, const char *, const char *, const char *, const char *, int); bool ECPGconnect(int, int, const char *, const char *, const char *, const char *, int);
bool ECPGdo(int, int, int, const char *, const char *,...); bool ECPGdo(const int, const int, const int, const char *, const char, const enum ECPG_statement_type, const char *,...);
bool ECPGtrans(int, const char *, const char *); bool ECPGtrans(int, const char *, const char *);
bool ECPGdisconnect(int, const char *); bool ECPGdisconnect(int, const char *);
bool ECPGprepare(int, const char *, const char *); bool ECPGprepare(int, const char *, const int, const char *, const char *);
bool ECPGauto_prepare(int, const char *, const int, char **, const char *);
bool ECPGdeallocate(int, int, const char *); bool ECPGdeallocate(int, int, const char *);
bool ECPGdeallocate_one(int, const char *); bool ECPGdeallocate_all(int, int);
bool ECPGdeallocate_all(int); char *ECPGprepared_statement(const char *, int);
char *ECPGprepared_statement(const char *);
void ECPGlog(const char *format,...); void ECPGlog(const char *format,...);
char *ECPGerrmsg(void); char *ECPGerrmsg(void);
...@@ -69,8 +69,6 @@ bool ECPGdo_descriptor(int line, const char *connection, ...@@ -69,8 +69,6 @@ bool ECPGdo_descriptor(int line, const char *connection,
const char *descriptor, const char *query); const char *descriptor, const char *query);
bool ECPGdeallocate_desc(int line, const char *name); bool ECPGdeallocate_desc(int line, const char *name);
bool ECPGallocate_desc(int line, const char *name); 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, const char *, int *); bool ECPGget_desc_header(int, const char *, int *);
bool ECPGget_desc(int, const char *, int,...); bool ECPGget_desc(int, const char *, int,...);
bool ECPGset_desc_header(int, const char *, int); bool ECPGset_desc_header(int, const char *, int);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* All types that can be handled for host variable declarations has to * All types that can be handled for host variable declarations has to
* be handled eventually. * be handled eventually.
* *
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpgtype.h,v 1.36 2006/03/11 04:38:39 momjian Exp $ * $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpgtype.h,v 1.37 2007/08/14 10:01:52 meskes Exp $
*/ */
/* /*
...@@ -88,6 +88,15 @@ enum ECPGdtype ...@@ -88,6 +88,15 @@ enum ECPGdtype
#define IS_SIMPLE_TYPE(type) ((type) >= ECPGt_char && (type) <= ECPGt_interval) #define IS_SIMPLE_TYPE(type) ((type) >= ECPGt_char && (type) <= ECPGt_interval)
/* we also have to handle different statement types */
enum ECPG_statement_type
{
ECPGst_normal,
ECPGst_execute,
ECPGst_exec_immediate,
ECPGst_prepnormal
};
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/datetime.c,v 1.32 2006/10/04 00:30:11 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/datetime.c,v 1.33 2007/08/14 10:01:52 meskes Exp $ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -57,7 +57,6 @@ PGTYPESdate_from_asc(char *str, char **endptr) ...@@ -57,7 +57,6 @@ PGTYPESdate_from_asc(char *str, char **endptr)
fsec_t fsec; fsec_t fsec;
struct tm tt, struct tm tt,
*tm = &tt; *tm = &tt;
int tzp;
int dtype; int dtype;
int nf; int nf;
char *field[MAXDATEFIELDS]; char *field[MAXDATEFIELDS];
...@@ -76,7 +75,7 @@ PGTYPESdate_from_asc(char *str, char **endptr) ...@@ -76,7 +75,7 @@ PGTYPESdate_from_asc(char *str, char **endptr)
} }
if (ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf, ptr) != 0 || if (ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf, ptr) != 0 ||
DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp, EuroDates) != 0) DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, EuroDates) != 0)
{ {
errno = PGTYPES_DATE_BAD_DATE; errno = PGTYPES_DATE_BAD_DATE;
return INT_MIN; return INT_MIN;
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt.h,v 1.36 2007/02/19 17:41:39 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt.h,v 1.37 2007/08/14 10:01:53 meskes Exp $ */
#ifndef DT_H #ifndef DT_H
#define DT_H #define DT_H
...@@ -331,7 +331,7 @@ bool CheckDateTokenTables(void); ...@@ -331,7 +331,7 @@ bool CheckDateTokenTables(void);
int EncodeDateOnly(struct tm *, int, char *, bool); int EncodeDateOnly(struct tm *, int, char *, bool);
void GetEpochTime(struct tm *); void GetEpochTime(struct tm *);
int ParseDateTime(char *, char *, char **, int *, int, int *, char **); int ParseDateTime(char *, char *, char **, int *, int, int *, char **);
int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, int *, bool); int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, bool);
void j2date(int, int *, int *, int *); void j2date(int, int *, int *, int *);
void GetCurrentDateTime(struct tm *); void GetCurrentDateTime(struct tm *);
int date2j(int, int, int); int date2j(int, int, int);
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.40 2007/05/21 07:07:48 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.41 2007/08/14 10:01:53 meskes Exp $ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -1816,7 +1816,7 @@ ParseDateTime(char *timestr, char *lowstr, ...@@ -1816,7 +1816,7 @@ ParseDateTime(char *timestr, char *lowstr,
*/ */
int int
DecodeDateTime(char **field, int *ftype, int nf, DecodeDateTime(char **field, int *ftype, int nf,
int *dtype, struct tm * tm, fsec_t *fsec, int *tzp, bool EuroDates) int *dtype, struct tm * tm, fsec_t *fsec, bool EuroDates)
{ {
int fmask = 0, int fmask = 0,
tmask, tmask,
...@@ -1828,6 +1828,8 @@ DecodeDateTime(char **field, int *ftype, int nf, ...@@ -1828,6 +1828,8 @@ DecodeDateTime(char **field, int *ftype, int nf,
int haveTextMonth = FALSE; int haveTextMonth = FALSE;
int is2digits = FALSE; int is2digits = FALSE;
int bc = FALSE; int bc = FALSE;
int t = 0;
int *tzp = &t;
/*** /***
* We'll insist on at least all of the date fields, but initialize the * We'll insist on at least all of the date fields, but initialize the
......
...@@ -308,7 +308,6 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr) ...@@ -308,7 +308,6 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr)
fsec_t fsec; fsec_t fsec;
struct tm tt, struct tm tt,
*tm = &tt; *tm = &tt;
int tz;
int dtype; int dtype;
int nf; int nf;
char *field[MAXDATEFIELDS]; char *field[MAXDATEFIELDS];
...@@ -324,7 +323,7 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr) ...@@ -324,7 +323,7 @@ PGTYPEStimestamp_from_asc(char *str, char **endptr)
} }
if (ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf, ptr) != 0 || if (ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf, ptr) != 0 ||
DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tz, 0) != 0) DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, 0) != 0)
{ {
errno = PGTYPES_TS_BAD_TIMESTAMP; errno = PGTYPES_TS_BAD_TIMESTAMP;
return (noresult); return (noresult);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Copyright (c) 1998-2007, PostgreSQL Global Development Group # Copyright (c) 1998-2007, PostgreSQL Global Development Group
# #
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.126 2007/04/01 08:56:58 petere Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.127 2007/08/14 10:01:53 meskes Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -14,8 +14,8 @@ top_builddir = ../../../.. ...@@ -14,8 +14,8 @@ top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
MAJOR_VERSION= 4 MAJOR_VERSION= 4
MINOR_VERSION= 3 MINOR_VERSION= 4
PATCHLEVEL=1 PATCHLEVEL=0
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(srcdir) -DMAJOR_VERSION=$(MAJOR_VERSION) \ -I$(srcdir) -DMAJOR_VERSION=$(MAJOR_VERSION) \
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.99 2007/06/11 11:52:08 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.100 2007/08/14 10:01:53 meskes Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */ /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */ /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
...@@ -17,8 +17,10 @@ int ret_value = 0, ...@@ -17,8 +17,10 @@ int ret_value = 0,
auto_create_c = false, auto_create_c = false,
system_includes = false, system_includes = false,
force_indicator = true, force_indicator = true,
questionmarks = false,
header_mode = false, header_mode = false,
regression_mode = false; regression_mode = false,
auto_prepare = false;
char *output_filename; char *output_filename;
...@@ -51,7 +53,10 @@ help(const char *progname) ...@@ -51,7 +53,10 @@ help(const char *progname)
printf(" -I DIRECTORY search DIRECTORY for include files\n"); printf(" -I DIRECTORY search DIRECTORY for include files\n");
printf(" -o OUTFILE write result to OUTFILE\n"); printf(" -o OUTFILE write result to OUTFILE\n");
printf(" -r OPTION specify runtime behaviour;\n" printf(" -r OPTION specify runtime behaviour;\n"
" OPTION can only be \"no_indicator\"\n"); " OPTION can be:\n"
" \"no_indicator\"\n"
" \"prepare\"\n"
" \"questionmarks\"\n");
printf(" -t turn on autocommit of transactions\n"); printf(" -t turn on autocommit of transactions\n");
printf(" --help show this help, then exit\n"); printf(" --help show this help, then exit\n");
printf(" --regression run in regression testing mode\n"); printf(" --regression run in regression testing mode\n");
...@@ -225,6 +230,10 @@ main(int argc, char *const argv[]) ...@@ -225,6 +230,10 @@ main(int argc, char *const argv[])
case 'r': case 'r':
if (strcmp(optarg, "no_indicator") == 0) if (strcmp(optarg, "no_indicator") == 0)
force_indicator = false; force_indicator = false;
else if (strcmp(optarg, "prepare") == 0)
auto_prepare = true;
else if (strcmp(optarg, "questionmarks") == 0)
questionmarks = true;
else else
{ {
fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]); fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]);
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.66 2007/06/11 11:52:08 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/extern.h,v 1.67 2007/08/14 10:01:53 meskes Exp $ */
#ifndef _ECPG_PREPROC_EXTERN_H #ifndef _ECPG_PREPROC_EXTERN_H
#define _ECPG_PREPROC_EXTERN_H #define _ECPG_PREPROC_EXTERN_H
...@@ -19,10 +19,12 @@ extern int braces_open, ...@@ -19,10 +19,12 @@ extern int braces_open,
auto_create_c, auto_create_c,
system_includes, system_includes,
force_indicator, force_indicator,
questionmarks,
ret_value, ret_value,
struct_level, struct_level,
ecpg_informix_var, ecpg_informix_var,
regression_mode; regression_mode,
auto_prepare;
extern char *descriptor_index; extern char *descriptor_index;
extern char *descriptor_name; extern char *descriptor_name;
extern char *connection; extern char *connection;
...@@ -58,7 +60,9 @@ extern const char *get_dtype(enum ECPGdtype); ...@@ -58,7 +60,9 @@ extern const char *get_dtype(enum ECPGdtype);
extern void lex_init(void); extern void lex_init(void);
extern char *make_str(const char *); extern char *make_str(const char *);
extern void output_line_number(void); extern void output_line_number(void);
extern void output_statement(char *, int, char *); extern void output_statement(char *, int, enum ECPG_statement_type);
extern void output_prepare_statement(char *, char *);
extern void output_deallocate_prepare_statement(char *);
extern void output_simple_statement(char *); extern void output_simple_statement(char *);
extern char *hashline_number(void); extern char *hashline_number(void);
extern int base_yyparse(void); extern int base_yyparse(void);
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/output.c,v 1.19 2006/10/04 00:30:12 momjian Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/output.c,v 1.20 2007/08/14 10:01:53 meskes Exp $ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "extern.h" #include "extern.h"
static void output_escaped_str(char *cmd); static void output_escaped_str(char *cmd, bool quoted);
void void
output_line_number(void) output_line_number(void)
{ {
char *line = hashline_number(); char *line = hashline_number();
/* output_escaped_str(line); */
fprintf(yyout, "%s", line); fprintf(yyout, "%s", line);
free(line); free(line);
} }
...@@ -19,11 +18,12 @@ output_line_number(void) ...@@ -19,11 +18,12 @@ output_line_number(void)
void void
output_simple_statement(char *stmt) output_simple_statement(char *stmt)
{ {
output_escaped_str(stmt); output_escaped_str(stmt, false);
output_line_number(); output_line_number();
free(stmt); free(stmt);
} }
/* /*
* store the whenever action here * store the whenever action here
*/ */
...@@ -95,7 +95,7 @@ hashline_number(void) ...@@ -95,7 +95,7 @@ hashline_number(void)
#endif #endif
) )
{ {
char *line = mm_alloc(strlen("\n#line %d \"%s\"\n") + 21 + strlen(input_filename)); char *line = mm_alloc(strlen("\n#line %d \"%s\"\n") + sizeof(int) * CHAR_BIT * 10 / 3 + strlen(input_filename));
sprintf(line, "\n#line %d \"%s\"\n", yylineno, input_filename); sprintf(line, "\n#line %d \"%s\"\n", yylineno, input_filename);
...@@ -106,11 +106,22 @@ hashline_number(void) ...@@ -106,11 +106,22 @@ hashline_number(void)
} }
void void
output_statement(char *stmt, int mode, char *con) output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
{ {
fprintf(yyout, "{ ECPGdo(__LINE__, %d, %d, %s, \"", compat, force_indicator, con ? con : "NULL");
output_escaped_str(stmt); fprintf(yyout, "{ ECPGdo(__LINE__, %d, %d, %s, %d, ", compat, force_indicator, connection ? connection : "NULL", questionmarks);
if (st == ECPGst_normal)
{
if (auto_prepare)
fprintf(yyout, "%d, \"", ECPGst_prepnormal);
else
fprintf(yyout, "%d, \"", ECPGst_normal);
output_escaped_str(stmt, false);
fputs("\", ", yyout); fputs("\", ", yyout);
}
else
fprintf(yyout, "%d, %s, ", st, stmt);
/* dump variables to C file */ /* dump variables to C file */
dump_variables(argsinsert, 1); dump_variables(argsinsert, 1);
...@@ -119,27 +130,66 @@ output_statement(char *stmt, int mode, char *con) ...@@ -119,27 +130,66 @@ output_statement(char *stmt, int mode, char *con)
fputs("ECPGt_EORT);", yyout); fputs("ECPGt_EORT);", yyout);
reset_variables(); reset_variables();
mode |= 2; whenever_action(whenever_mode|2);
whenever_action(mode);
free(stmt); free(stmt);
if (connection != NULL) if (connection != NULL)
free(connection); free(connection);
} }
void
output_prepare_statement(char *name, char *stmt)
{
fprintf(yyout, "{ ECPGprepare(__LINE__, %s, %d, ", connection ? connection : "NULL", questionmarks);
output_escaped_str(name, true);
fputs(", ", yyout);
output_escaped_str(stmt, true);
fputs(");", yyout);
whenever_action(2);
free(name);
if (connection != NULL)
free(connection);
}
void
output_deallocate_prepare_statement(char *name)
{
if (strcmp(name, "all"))
{
fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, ", compat);
output_escaped_str(name, true);
fputs(");", yyout);
}
else
fprintf(yyout, "{ ECPGdeallocate_all(__LINE__, %d);", compat);
whenever_action(2);
free(name);
if (connection != NULL)
free(connection);
}
static void static void
output_escaped_str(char *str) output_escaped_str(char *str, bool quoted)
{ {
int i, int i = 0;
len = strlen(str); int len = strlen(str);
if (quoted && str[0] == '\"' && str[len-1] == '\"') /* do not escape quotes at beginning and end if quoted string */
{
i = 1;
len--;
fputs("\"", yyout);
}
/* output this char by char as we have to filter " and \n */ /* output this char by char as we have to filter " and \n */
for (i = 0; i < len; i++) for (; i < len; i++)
{ {
if (str[i] == '"') if (str[i] == '"')
fputs("\\\"", yyout); fputs("\\\"", yyout);
else if (str[i] == '\n') else if (str[i] == '\n')
fputs("\\\n", yyout); fputs("\\\n", yyout);
else if (str[i] == '\\')
fputs("\\\\", yyout);
else if (str[i] == '\r' && str[i + 1] == '\n') else if (str[i] == '\r' && str[i + 1] == '\n')
{ {
fputs("\\\r\n", yyout); fputs("\\\r\n", yyout);
...@@ -148,4 +198,7 @@ output_escaped_str(char *str) ...@@ -148,4 +198,7 @@ output_escaped_str(char *str)
else else
fputc(str[i], yyout); fputc(str[i], yyout);
} }
if (quoted && str[0] == '\"' && str[len] == '\"')
fputs("\"", yyout);
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.152 2007/03/17 19:25:23 meskes Exp $ * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.153 2007/08/14 10:01:53 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -29,7 +29,6 @@ extern YYSTYPE yylval; ...@@ -29,7 +29,6 @@ extern YYSTYPE yylval;
static int xcdepth = 0; /* depth of nesting in slash-star comments */ static int xcdepth = 0; /* depth of nesting in slash-star comments */
static char *dolqstart; /* current $foo$ quote start string */ static char *dolqstart; /* current $foo$ quote start string */
static bool escape_string_warning; static bool escape_string_warning;
static bool standard_conforming_strings;
static bool warn_on_first_escape; static bool warn_on_first_escape;
static YY_BUFFER_STATE scanbufhandle; static YY_BUFFER_STATE scanbufhandle;
static char *scanbuf; static char *scanbuf;
...@@ -101,6 +100,7 @@ static struct _if_value ...@@ -101,6 +100,7 @@ static struct _if_value
* <xh> hexadecimal numeric string - thomas 1997-11-16 * <xh> hexadecimal numeric string - thomas 1997-11-16
* <xq> standard quoted strings - thomas 1997-07-30 * <xq> standard quoted strings - thomas 1997-07-30
* <xe> extended quoted strings (support backslash escape sequences) * <xe> extended quoted strings (support backslash escape sequences)
* <xn> national character quoted strings
* <xdolq> $foo$ quoted strings * <xdolq> $foo$ quoted strings
*/ */
...@@ -110,6 +110,7 @@ static struct _if_value ...@@ -110,6 +110,7 @@ static struct _if_value
%x xdc %x xdc
%x xh %x xh
%x xe %x xe
%x xn
%x xq %x xq
%x xdolq %x xdolq
%x xcond %x xcond
...@@ -409,27 +410,21 @@ cppline {space}*#(.*\\{space})*.*{newline} ...@@ -409,27 +410,21 @@ cppline {space}*#(.*\\{space})*.*{newline}
warn_on_first_escape = true; warn_on_first_escape = true;
token_start = yytext; token_start = yytext;
state_before = YYSTATE; state_before = YYSTATE;
if (standard_conforming_strings) BEGIN(xn);
BEGIN(xq);
else
BEGIN(xe);
startlit(); startlit();
} }
<C>{xqstart} { <C>{xqstart} {
warn_on_first_escape = false; warn_on_first_escape = false;
token_start = yytext; token_start = yytext;
state_before = YYSTATE; state_before = YYSTATE;
BEGIN(xe); BEGIN(xq);
startlit(); startlit();
} }
<SQL>{xqstart} { <SQL>{xqstart} {
warn_on_first_escape = true; warn_on_first_escape = true;
token_start = yytext; token_start = yytext;
state_before = YYSTATE; state_before = YYSTATE;
if (standard_conforming_strings)
BEGIN(xq); BEGIN(xq);
else
BEGIN(xe);
startlit(); startlit();
} }
<SQL>{xestart} { <SQL>{xestart} {
...@@ -439,15 +434,29 @@ cppline {space}*#(.*\\{space})*.*{newline} ...@@ -439,15 +434,29 @@ cppline {space}*#(.*\\{space})*.*{newline}
BEGIN(xe); BEGIN(xe);
startlit(); startlit();
} }
<xq,xe>{quotestop} | <xq>{quotestop} |
<xq,xe>{quotefail} { <xq>{quotefail} {
yyless(1); yyless(1);
BEGIN(state_before); BEGIN(state_before);
yylval.str = mm_strdup(literalbuf); yylval.str = mm_strdup(literalbuf);
return SCONST; return SCONST;
} }
<xq,xe>{xqdouble} { addlitchar('\''); } <xe>{quotestop} |
<xq>{xqinside} { addlit(yytext, yyleng); } <xe>{quotefail} {
yyless(1);
BEGIN(state_before);
yylval.str = mm_strdup(literalbuf);
return ECONST;
}
<xn>{quotestop} |
<xn>{quotefail} {
yyless(1);
BEGIN(state_before);
yylval.str = mm_strdup(literalbuf);
return NCONST;
}
<xq,xe,xn>{xqdouble} { addlitchar('\''); }
<xq,xn>{xqinside} { addlit(yytext, yyleng); }
<xe>{xeinside} { addlit(yytext, yyleng); } <xe>{xeinside} { addlit(yytext, yyleng); }
<xe>{xeescape} { <xe>{xeescape} {
check_escape_warning(); check_escape_warning();
...@@ -461,12 +470,12 @@ cppline {space}*#(.*\\{space})*.*{newline} ...@@ -461,12 +470,12 @@ cppline {space}*#(.*\\{space})*.*{newline}
check_escape_warning(); check_escape_warning();
addlit(yytext, yyleng); addlit(yytext, yyleng);
} }
<xq,xe>{quotecontinue} { /* ignore */ } <xq,xe,xn>{quotecontinue} { /* ignore */ }
<xe>. { <xe>. {
/* This is only needed for \ just before EOF */ /* This is only needed for \ just before EOF */
addlitchar(yytext[0]); addlitchar(yytext[0]);
} }
<xq,xe><<EOF>> { mmerror(PARSE_ERROR, ET_FATAL, "Unterminated quoted string"); } <xq,xe,xn><<EOF>> { mmerror(PARSE_ERROR, ET_FATAL, "Unterminated quoted string"); }
<SQL>{dolqfailed} { <SQL>{dolqfailed} {
/* throw back all but the initial "$" */ /* throw back all but the initial "$" */
yyless(1); yyless(1);
......
This diff is collapsed.
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.72 2007/03/17 19:25:23 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.73 2007/08/14 10:01:53 meskes Exp $ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -57,10 +57,10 @@ ECPGstruct_member_dup(struct ECPGstruct_member * rm) ...@@ -57,10 +57,10 @@ ECPGstruct_member_dup(struct ECPGstruct_member * rm)
if (rm->type->u.element->type == ECPGt_struct) if (rm->type->u.element->type == ECPGt_struct)
type = ECPGmake_struct_type(rm->type->u.element->u.members, rm->type->u.element->type, rm->type->u.element->struct_sizeof); type = ECPGmake_struct_type(rm->type->u.element->u.members, rm->type->u.element->type, rm->type->u.element->struct_sizeof);
else else
type = ECPGmake_array_type(ECPGmake_simple_type(rm->type->u.element->type, rm->type->u.element->size), rm->type->size); type = ECPGmake_array_type(ECPGmake_simple_type(rm->type->u.element->type, rm->type->u.element->size, rm->type->u.element->lineno), rm->type->size);
break; break;
default: default:
type = ECPGmake_simple_type(rm->type->type, rm->type->size); type = ECPGmake_simple_type(rm->type->type, rm->type->size, rm->type->lineno);
break; break;
} }
...@@ -93,7 +93,7 @@ ECPGmake_struct_member(char *name, struct ECPGtype * type, struct ECPGstruct_mem ...@@ -93,7 +93,7 @@ ECPGmake_struct_member(char *name, struct ECPGtype * type, struct ECPGstruct_mem
} }
struct ECPGtype * struct ECPGtype *
ECPGmake_simple_type(enum ECPGttype type, char *size) ECPGmake_simple_type(enum ECPGttype type, char *size, int lineno)
{ {
struct ECPGtype *ne = (struct ECPGtype *) mm_alloc(sizeof(struct ECPGtype)); struct ECPGtype *ne = (struct ECPGtype *) mm_alloc(sizeof(struct ECPGtype));
...@@ -101,6 +101,7 @@ ECPGmake_simple_type(enum ECPGttype type, char *size) ...@@ -101,6 +101,7 @@ ECPGmake_simple_type(enum ECPGttype type, char *size)
ne->size = size; ne->size = size;
ne->u.element = NULL; ne->u.element = NULL;
ne->struct_sizeof = NULL; ne->struct_sizeof = NULL;
ne->lineno = lineno; /* only needed for varchar */
return ne; return ne;
} }
...@@ -108,7 +109,7 @@ ECPGmake_simple_type(enum ECPGttype type, char *size) ...@@ -108,7 +109,7 @@ ECPGmake_simple_type(enum ECPGttype type, char *size)
struct ECPGtype * struct ECPGtype *
ECPGmake_array_type(struct ECPGtype * type, char *size) ECPGmake_array_type(struct ECPGtype * type, char *size)
{ {
struct ECPGtype *ne = ECPGmake_simple_type(ECPGt_array, size); struct ECPGtype *ne = ECPGmake_simple_type(ECPGt_array, size, 0);
ne->u.element = type; ne->u.element = type;
...@@ -118,7 +119,7 @@ ECPGmake_array_type(struct ECPGtype * type, char *size) ...@@ -118,7 +119,7 @@ ECPGmake_array_type(struct ECPGtype * type, char *size)
struct ECPGtype * struct ECPGtype *
ECPGmake_struct_type(struct ECPGstruct_member * rm, enum ECPGttype type, char *struct_sizeof) ECPGmake_struct_type(struct ECPGstruct_member * rm, enum ECPGttype type, char *struct_sizeof)
{ {
struct ECPGtype *ne = ECPGmake_simple_type(type, make_str("1")); struct ECPGtype *ne = ECPGmake_simple_type(type, make_str("1"), 0);
ne->u.members = ECPGstruct_member_dup(rm); ne->u.members = ECPGstruct_member_dup(rm);
ne->struct_sizeof = struct_sizeof; ne->struct_sizeof = struct_sizeof;
...@@ -222,7 +223,7 @@ get_type(enum ECPGttype type) ...@@ -222,7 +223,7 @@ get_type(enum ECPGttype type)
*/ */
static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type, static void ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
char *varcharsize, char *varcharsize,
char *arrsiz, const char *siz, const char *prefix); char *arrsiz, const char *siz, const char *prefix, int);
static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz, static void ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
struct ECPGtype * type, struct ECPGtype * ind_type, const char *offset, const char *prefix, const char *ind_prefix); struct ECPGtype * type, struct ECPGtype * ind_type, const char *offset, const char *prefix, const char *ind_prefix);
...@@ -258,16 +259,16 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type, ...@@ -258,16 +259,16 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
ECPGdump_a_simple(o, name, ECPGdump_a_simple(o, name,
type->u.element->type, type->u.element->type,
type->u.element->size, type->size, NULL, prefix); type->u.element->size, type->size, NULL, prefix, type->lineno);
if (ind_type != NULL) if (ind_type != NULL)
{ {
if (ind_type->type == ECPGt_NO_INDICATOR) if (ind_type->type == ECPGt_NO_INDICATOR)
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, make_str("-1"), NULL, ind_prefix); ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, make_str("-1"), NULL, ind_prefix, 0);
else else
{ {
ECPGdump_a_simple(o, ind_name, ind_type->u.element->type, ECPGdump_a_simple(o, ind_name, ind_type->u.element->type,
ind_type->u.element->size, ind_type->size, NULL, ind_prefix); ind_type->u.element->size, ind_type->size, NULL, ind_prefix, 0);
} }
} }
} }
...@@ -285,25 +286,25 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type, ...@@ -285,25 +286,25 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array)) if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "Indicator for simple datatype has to be simple.\n"); mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "Indicator for simple datatype has to be simple.\n");
ECPGdump_a_simple(o, name, type->type, make_str("1"), (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("1"), struct_sizeof, prefix); ECPGdump_a_simple(o, name, type->type, make_str("1"), (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("1"), struct_sizeof, prefix, 0);
if (ind_type != NULL) if (ind_type != NULL)
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("-1"), ind_struct_sizeof, ind_prefix); ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("-1"), ind_struct_sizeof, ind_prefix, 0);
break; break;
case ECPGt_descriptor: case ECPGt_descriptor:
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array)) if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "Indicator for simple datatype has to be simple.\n"); mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "Indicator for simple datatype has to be simple.\n");
ECPGdump_a_simple(o, name, type->type, NULL, make_str("-1"), NULL, prefix); ECPGdump_a_simple(o, name, type->type, NULL, make_str("-1"), NULL, prefix, 0);
if (ind_type != NULL) if (ind_type != NULL)
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, make_str("-1"), NULL, ind_prefix); ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, make_str("-1"), NULL, ind_prefix, 0);
break; break;
default: default:
if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array)) if (indicator_set && (ind_type->type == ECPGt_struct || ind_type->type == ECPGt_array))
mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "Indicator for simple datatype has to be simple.\n"); mmerror(INDICATOR_NOT_SIMPLE, ET_FATAL, "Indicator for simple datatype has to be simple.\n");
ECPGdump_a_simple(o, name, type->type, type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("-1"), struct_sizeof, prefix); ECPGdump_a_simple(o, name, type->type, type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("-1"), struct_sizeof, prefix, type->lineno);
if (ind_type != NULL) if (ind_type != NULL)
ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("-1"), ind_struct_sizeof, ind_prefix); ECPGdump_a_simple(o, ind_name, ind_type->type, ind_type->size, (arr_str_siz && strcmp(arr_str_siz, "0") != 0) ? arr_str_siz : make_str("-1"), ind_struct_sizeof, ind_prefix, 0);
break; break;
} }
} }
...@@ -316,8 +317,8 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type, ...@@ -316,8 +317,8 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
char *varcharsize, char *varcharsize,
char *arrsize, char *arrsize,
const char *siz, const char *siz,
const char *prefix const char *prefix,
) int lineno)
{ {
if (type == ECPGt_NO_INDICATOR) if (type == ECPGt_NO_INDICATOR)
fprintf(o, "\n\tECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, "); fprintf(o, "\n\tECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ");
...@@ -327,7 +328,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type, ...@@ -327,7 +328,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
else else
{ {
char *variable = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 4); char *variable = (char *) mm_alloc(strlen(name) + ((prefix == NULL) ? 0 : strlen(prefix)) + 4);
char *offset = (char *) mm_alloc(strlen(name) + strlen("sizeof(struct varchar_)") + 1 + strlen(varcharsize)); char *offset = (char *) mm_alloc(strlen(name) + strlen("sizeof(struct varchar_)") + 1 + strlen(varcharsize)+ sizeof(int) * CHAR_BIT * 10 / 3);
switch (type) switch (type)
{ {
...@@ -349,6 +350,9 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type, ...@@ -349,6 +350,9 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
else else
sprintf(variable, "&(%s%s)", prefix ? prefix : "", name); sprintf(variable, "&(%s%s)", prefix ? prefix : "", name);
if (lineno)
sprintf(offset, "sizeof(struct varchar_%s_%d)", name, lineno);
else
sprintf(offset, "sizeof(struct varchar_%s)", name); sprintf(offset, "sizeof(struct varchar_%s)", name);
break; break;
case ECPGt_char: case ECPGt_char:
...@@ -430,7 +434,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type, ...@@ -430,7 +434,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype type,
if (atoi(arrsize) < 0) if (atoi(arrsize) < 0)
strcpy(arrsize, "1"); strcpy(arrsize, "1");
if (siz == NULL || strcmp(arrsize, "0") == 0 || strcmp(arrsize, "1") == 0) if (siz == NULL || strlen(siz) == 0 || strcmp(arrsize, "0") == 0 || strcmp(arrsize, "1") == 0)
fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, offset); fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, offset);
else else
fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, siz); fprintf(o, "\n\t%s,%s,(long)%s,(long)%s,%s, ", get_type(type), variable, varcharsize, arrsize, siz);
......
...@@ -25,11 +25,12 @@ struct ECPGtype ...@@ -25,11 +25,12 @@ struct ECPGtype
struct ECPGstruct_member *members; /* A pointer to a list of struct ECPGstruct_member *members; /* A pointer to a list of
* members. */ * members. */
} u; } u;
int lineno;
}; };
/* Everything is malloced. */ /* Everything is malloced. */
void ECPGmake_struct_member(char *, struct ECPGtype *, struct ECPGstruct_member **); void ECPGmake_struct_member(char *, struct ECPGtype *, struct ECPGstruct_member **);
struct ECPGtype *ECPGmake_simple_type(enum ECPGttype, char *); struct ECPGtype *ECPGmake_simple_type(enum ECPGttype, char *, int);
struct ECPGtype *ECPGmake_varchar_type(enum ECPGttype, long); struct ECPGtype *ECPGmake_varchar_type(enum ECPGttype, long);
struct ECPGtype *ECPGmake_array_type(struct ECPGtype *, char *); struct ECPGtype *ECPGmake_array_type(struct ECPGtype *, char *);
struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *, enum ECPGttype, char *); struct ECPGtype *ECPGmake_struct_type(struct ECPGstruct_member *, enum ECPGttype, char *);
...@@ -94,6 +95,13 @@ struct su_symbol ...@@ -94,6 +95,13 @@ struct su_symbol
char *symbol; char *symbol;
}; };
struct prep
{
char *name;
char *stmt;
char *type;
};
struct this_type struct this_type
{ {
enum ECPGttype type_enum; enum ECPGttype type_enum;
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.41 2006/07/30 16:28:58 meskes Exp $ */ /* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.42 2007/08/14 10:01:53 meskes Exp $ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -44,12 +44,12 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member * members, in ...@@ -44,12 +44,12 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member * members, in
switch (members->type->type) switch (members->type->type)
{ {
case ECPGt_array: case ECPGt_array:
return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size), members->type->size), brace_level)); return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size, members->type->u.element->lineno), members->type->size), brace_level));
case ECPGt_struct: case ECPGt_struct:
case ECPGt_union: case ECPGt_union:
return (new_variable(name, ECPGmake_struct_type(members->type->u.members, members->type->type, members->type->struct_sizeof), brace_level)); return (new_variable(name, ECPGmake_struct_type(members->type->u.members, members->type->type, members->type->struct_sizeof), brace_level));
default: default:
return (new_variable(name, ECPGmake_simple_type(members->type->type, members->type->size), brace_level)); return (new_variable(name, ECPGmake_simple_type(members->type->type, members->type->size, members->type->lineno), brace_level));
} }
} }
else else
...@@ -91,12 +91,12 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member * members, in ...@@ -91,12 +91,12 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member * members, in
switch (members->type->u.element->type) switch (members->type->u.element->type)
{ {
case ECPGt_array: case ECPGt_array:
return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->u.element->type, members->type->u.element->u.element->size), members->type->u.element->size), brace_level)); return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(members->type->u.element->u.element->type, members->type->u.element->u.element->size, members->type->u.element->u.element->lineno), members->type->u.element->size), brace_level));
case ECPGt_struct: case ECPGt_struct:
case ECPGt_union: case ECPGt_union:
return (new_variable(name, ECPGmake_struct_type(members->type->u.element->u.members, members->type->u.element->type, members->type->u.element->struct_sizeof), brace_level)); return (new_variable(name, ECPGmake_struct_type(members->type->u.element->u.members, members->type->u.element->type, members->type->u.element->struct_sizeof), brace_level));
default: default:
return (new_variable(name, ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size), brace_level)); return (new_variable(name, ECPGmake_simple_type(members->type->u.element->type, members->type->u.element->size, members->type->u.element->lineno), brace_level));
} }
break; break;
case '-': case '-':
...@@ -232,12 +232,12 @@ find_variable(char *name) ...@@ -232,12 +232,12 @@ find_variable(char *name)
switch (p->type->u.element->type) switch (p->type->u.element->type)
{ {
case ECPGt_array: case ECPGt_array:
return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(p->type->u.element->u.element->type, p->type->u.element->u.element->size), p->type->u.element->size), p->brace_level)); return (new_variable(name, ECPGmake_array_type(ECPGmake_simple_type(p->type->u.element->u.element->type, p->type->u.element->u.element->size, p->type->u.element->u.element->lineno), p->type->u.element->size), p->brace_level));
case ECPGt_struct: case ECPGt_struct:
case ECPGt_union: case ECPGt_union:
return (new_variable(name, ECPGmake_struct_type(p->type->u.element->u.members, p->type->u.element->type, p->type->u.element->struct_sizeof), p->brace_level)); return (new_variable(name, ECPGmake_struct_type(p->type->u.element->u.members, p->type->u.element->type, p->type->u.element->struct_sizeof), p->brace_level));
default: default:
return (new_variable(name, ECPGmake_simple_type(p->type->u.element->type, p->type->u.element->size), p->brace_level)); return (new_variable(name, ECPGmake_simple_type(p->type->u.element->type, p->type->u.element->size, p->type->u.element->u.element->lineno), p->brace_level));
} }
} }
} }
......
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.71 2007/06/15 08:23:52 meskes Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.72 2007/08/14 10:01:53 meskes Exp $
subdir = src/interfaces/ecpg/test subdir = src/interfaces/ecpg/test
top_builddir = ../../../.. top_builddir = ../../../..
...@@ -6,7 +6,7 @@ include $(top_builddir)/src/Makefile.global ...@@ -6,7 +6,7 @@ include $(top_builddir)/src/Makefile.global
# port number for temp-installation test postmaster # port number for temp-installation test postmaster
# this is also defined in test/connect/Makefile # this is also defined in test/connect/Makefile
TEMP_PORT = 5$(DEF_PGPORT) TEMP_PORT = 4$(DEF_PGPORT)
# where to find psql for testing an existing installation # where to find psql for testing an existing installation
PSQLDIR = $(bindir) PSQLDIR = $(bindir)
......
...@@ -236,5 +236,4 @@ check_errno(void) ...@@ -236,5 +236,4 @@ check_errno(void)
printf("(libc: (%s)) ", strerror(errno)); printf("(libc: (%s)) ", strerror(errno));
break; break;
} }
} }
...@@ -12,7 +12,7 @@ test_null(int type, char *ptr) ...@@ -12,7 +12,7 @@ test_null(int type, char *ptr)
int main(void) int main(void)
{ {
$char c[] = "abc "; $char c[] = "abc";
$short s = 17; $short s = 17;
$int i = -74874; $int i = -74874;
$bool b = 1; $bool b = 1;
......
...@@ -69,7 +69,7 @@ int main(void) ...@@ -69,7 +69,7 @@ int main(void)
deccvint(7, &j); deccvint(7, &j);
deccvint(14, &m); deccvint(14, &m);
decadd(&j, &m, &n); decadd(&j, &m, &n);
$delete from test where i=:n; $delete from test where i= :n::decimal;
printf("DELETE: %ld\n", sqlca.sqlcode); printf("DELETE: %ld\n", sqlca.sqlcode);
$select 1 from test where i=14; $select 1 from test where i=14;
......
...@@ -89,7 +89,7 @@ int main(void) ...@@ -89,7 +89,7 @@ int main(void)
intvl = PGTYPESinterval_from_asc("1 day 2 hours 24 minutes 65 seconds", NULL); intvl = PGTYPESinterval_from_asc("1 day 2 hours 24 minutes 65 seconds", NULL);
PGTYPEStimestamp_add_interval(&d, intvl, &e); PGTYPEStimestamp_add_interval(&d, intvl, &e);
free(intvl);
c++; c++;
EXEC SQL insert into history EXEC SQL insert into history
......
...@@ -5,7 +5,7 @@ include $(top_srcdir)/$(subdir)/../Makefile.regress ...@@ -5,7 +5,7 @@ include $(top_srcdir)/$(subdir)/../Makefile.regress
# port number for temp-installation test postmaster # port number for temp-installation test postmaster
# this is also defined in ../Makefile # this is also defined in ../Makefile
TEMP_PORT = 5$(DEF_PGPORT) TEMP_PORT = 4$(DEF_PGPORT)
test1.pgc: test1.pgc.in test1.pgc: test1.pgc.in
sed -e 's,@TEMP_PORT@,$(TEMP_PORT),g' \ sed -e 's,@TEMP_PORT@,$(TEMP_PORT),g' \
......
...@@ -13,6 +13,8 @@ test: pgtypeslib/dt_test ...@@ -13,6 +13,8 @@ test: pgtypeslib/dt_test
test: pgtypeslib/dt_test2 test: pgtypeslib/dt_test2
test: pgtypeslib/num_test test: pgtypeslib/num_test
test: pgtypeslib/num_test2 test: pgtypeslib/num_test2
test: preproc/array_of_struct
test: preproc/autoprep
test: preproc/comment test: preproc/comment
test: preproc/define test: preproc/define
test: preproc/init test: preproc/init
...@@ -32,6 +34,7 @@ test: sql/execute ...@@ -32,6 +34,7 @@ test: sql/execute
test: sql/fetch test: sql/fetch
test: sql/func test: sql/func
test: sql/indicators test: sql/indicators
test: sql/oldexec
test: sql/quote test: sql/quote
test: sql/show test: sql/show
test: sql/insupd test: sql/insupd
......
...@@ -13,6 +13,8 @@ test: pgtypeslib/dt_test ...@@ -13,6 +13,8 @@ test: pgtypeslib/dt_test
test: pgtypeslib/dt_test2 test: pgtypeslib/dt_test2
test: pgtypeslib/num_test test: pgtypeslib/num_test
test: pgtypeslib/num_test2 test: pgtypeslib/num_test2
test: preproc/array_of_struct
test: preproc/autoprep
test: preproc/comment test: preproc/comment
test: preproc/define test: preproc/define
test: preproc/init test: preproc/init
...@@ -32,6 +34,7 @@ test: sql/execute ...@@ -32,6 +34,7 @@ test: sql/execute
test: sql/fetch test: sql/fetch
test: sql/func test: sql/func
test: sql/indicators test: sql/indicators
test: sql/oldexec
test: sql/quote test: sql/quote
test: sql/show test: sql/show
test: sql/insupd test: sql/insupd
......
...@@ -257,5 +257,4 @@ check_errno(void) ...@@ -257,5 +257,4 @@ check_errno(void)
printf("(libc: (%s)) ", strerror(errno)); printf("(libc: (%s)) ", strerror(errno));
break; break;
} }
} }
...@@ -35,7 +35,7 @@ int main(void) ...@@ -35,7 +35,7 @@ int main(void)
{ {
#line 15 "rnull.pgc" #line 15 "rnull.pgc"
char c [] = "abc " ; char c [] = "abc" ;
#line 15 "rnull.pgc" #line 15 "rnull.pgc"
...@@ -106,7 +106,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -106,7 +106,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
#line 29 "rnull.pgc" #line 29 "rnull.pgc"
{ ECPGdo(__LINE__, 1, 0, NULL, "create table test ( id int , c char ( 10 ) , s smallint , i int , b bool , f float , l bigint , dbl double precision , dec decimal , dat date , tmp timestamptz ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 0, NULL, 0, 0, "create table test ( id int , c char ( 10 ) , s smallint , i int , b bool , f float , l bigint , dbl double precision , dec decimal , dat date , tmp timestamptz ) ", ECPGt_EOIT, ECPGt_EORT);
#line 33 "rnull.pgc" #line 33 "rnull.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );} if (sqlca.sqlcode < 0) sqlprint ( );}
...@@ -119,8 +119,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -119,8 +119,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
#line 34 "rnull.pgc" #line 34 "rnull.pgc"
{ ECPGdo(__LINE__, 1, 0, NULL, "insert into test ( id , c , s , i , b , f , l , dbl ) values ( 1 , ? , ? , ? , ? , ? , ? , ? ) ", { ECPGdo(__LINE__, 1, 0, NULL, 0, 0, "insert into test ( id , c , s , i , b , f , l , dbl ) values ( 1 , $1 , $2 , $3 , $4 , $5 , $6 , $7 ) ",
ECPGt_char,(c),(long)sizeof("abc "),(long)1,(sizeof("abc "))*sizeof(char), ECPGt_char,(c),(long)sizeof("abc"),(long)1,(sizeof("abc"))*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_short,&(s),(long)1,(long)1,sizeof(short), ECPGt_short,&(s),(long)1,(long)1,sizeof(short),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
...@@ -157,8 +157,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -157,8 +157,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
rsetnull(CDATETYPE, (char *) &dat); rsetnull(CDATETYPE, (char *) &dat);
rsetnull(CDTIMETYPE, (char *) &tmp); rsetnull(CDTIMETYPE, (char *) &tmp);
{ ECPGdo(__LINE__, 1, 0, NULL, "insert into test ( id , c , s , i , b , f , l , dbl , dec , dat , tmp ) values ( 2 , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ", { ECPGdo(__LINE__, 1, 0, NULL, 0, 0, "insert into test ( id , c , s , i , b , f , l , dbl , dec , dat , tmp ) values ( 2 , $1 , $2 , $3 , $4 , $5 , $6 , $7 , $8 , $9 , $10 ) ",
ECPGt_char,(c),(long)sizeof("abc "),(long)1,(sizeof("abc "))*sizeof(char), ECPGt_char,(c),(long)sizeof("abc"),(long)1,(sizeof("abc"))*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_short,&(s),(long)1,(long)1,sizeof(short), ECPGt_short,&(s),(long)1,(long)1,sizeof(short),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
...@@ -192,8 +192,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -192,8 +192,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
printf("first select\n"); printf("first select\n");
{ ECPGdo(__LINE__, 1, 0, NULL, "select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 1 ", ECPGt_EOIT, { ECPGdo(__LINE__, 1, 0, NULL, 0, 0, "select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 1 ", ECPGt_EOIT,
ECPGt_char,(c),(long)sizeof("abc "),(long)1,(sizeof("abc "))*sizeof(char), ECPGt_char,(c),(long)sizeof("abc"),(long)1,(sizeof("abc"))*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_short,&(s),(long)1,(long)1,sizeof(short), ECPGt_short,&(s),(long)1,(long)1,sizeof(short),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
...@@ -232,8 +232,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -232,8 +232,8 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
printf("second select\n"); printf("second select\n");
{ ECPGdo(__LINE__, 1, 0, NULL, "select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 2 ", ECPGt_EOIT, { ECPGdo(__LINE__, 1, 0, NULL, 0, 0, "select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 2 ", ECPGt_EOIT,
ECPGt_char,(c),(long)sizeof("abc "),(long)1,(sizeof("abc "))*sizeof(char), ECPGt_char,(c),(long)sizeof("abc"),(long)1,(sizeof("abc"))*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_short,&(s),(long)1,(long)1,sizeof(short), ECPGt_short,&(s),(long)1,(long)1,sizeof(short),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
...@@ -270,7 +270,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -270,7 +270,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
test_null(CDATETYPE, (char *) &dat); test_null(CDATETYPE, (char *) &dat);
test_null(CDTIMETYPE, (char *) &tmp); test_null(CDTIMETYPE, (char *) &tmp);
{ ECPGdo(__LINE__, 1, 0, NULL, "drop table test ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 0, NULL, 0, 0, "drop table test ", ECPGt_EOIT, ECPGt_EORT);
#line 91 "rnull.pgc" #line 91 "rnull.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );} if (sqlca.sqlcode < 0) sqlprint ( );}
......
...@@ -2,25 +2,67 @@ ...@@ -2,25 +2,67 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31: QUERY: create table test ( id int , c char ( 10 ) , s smallint , i int , b bool , f float , l bigint , dbl double precision , dec decimal , dat date , tmp timestamptz ) on connection regress1 [NO_PID]: ECPGexecute line 31: QUERY: create table test ( id int , c char ( 10 ) , s smallint , i int , b bool , f float , l bigint , dbl double precision , dec decimal , dat date , tmp timestamptz ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31 Ok: CREATE TABLE [NO_PID]: ECPGexecute line 31 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 34 action = commit connection = regress1 [NO_PID]: ECPGtrans line 34 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: QUERY: insert into test ( id , c , s , i , b , f , l , dbl ) values ( 1 , 'abc ' , 17 , -74874 , 't' , 3.710000038147 , 487444 , 404.404 ) on connection regress1 [NO_PID]: ECPGexecute line 36: QUERY: insert into test ( id , c , s , i , b , f , l , dbl ) values ( 1 , $1 , $2 , $3 , $4 , $5 , $6 , $7 ) with 7 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: parameter 1 = abc
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: parameter 2 = 17
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: parameter 3 = -74874
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: parameter 4 = t
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: parameter 5 = 3.710000038147
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: parameter 6 = 487444
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: parameter 7 = 404.404
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 36 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 39 action = commit connection = regress1 [NO_PID]: ECPGtrans line 39 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: QUERY: insert into test ( id , c , s , i , b , f , l , dbl , dec , dat , tmp ) values ( 2 , null , null , null , 't' , null , null , null , null , null , null ) on connection regress1 [NO_PID]: ECPGexecute line 52: QUERY: insert into test ( id , c , s , i , b , f , l , dbl , dec , dat , tmp ) values ( 2 , $1 , $2 , $3 , $4 , $5 , $6 , $7 , $8 , $9 , $10 ) with 10 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 1 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 2 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 3 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 4 = t
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 5 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 6 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 7 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 8 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 9 = null
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: parameter 10 = null
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 55 action = commit connection = regress1 [NO_PID]: ECPGtrans line 55 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 59: QUERY: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 1 on connection regress1 [NO_PID]: ECPGexecute line 59: QUERY: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 1 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 59: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 59: Correctly got 1 tuples with 10 fields [NO_PID]: ECPGexecute line 59: Correctly got 1 tuples with 10 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -44,7 +86,9 @@ ...@@ -44,7 +86,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 59: RESULT: offset: -1 array: Yes [NO_PID]: ECPGget_data line 59: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 76: QUERY: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 2 on connection regress1 [NO_PID]: ECPGexecute line 76: QUERY: select c , s , i , b , f , l , dbl , dec , dat , tmp from test where id = 2 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 76: Correctly got 1 tuples with 10 fields [NO_PID]: ECPGexecute line 76: Correctly got 1 tuples with 10 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -68,7 +112,9 @@ ...@@ -68,7 +112,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 76: RESULT: offset: -1 array: Yes [NO_PID]: ECPGget_data line 76: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 91: QUERY: drop table test on connection regress1 [NO_PID]: ECPGexecute line 91: QUERY: drop table test with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 91: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 91 Ok: DROP TABLE [NO_PID]: ECPGexecute line 91 Ok: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -58,7 +58,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -58,7 +58,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
if (sqlca.sqlcode != 0) exit(1); if (sqlca.sqlcode != 0) exit(1);
{ ECPGdo(__LINE__, 1, 1, NULL, "create table test ( i int primary key , j int ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "create table test ( i int primary key , j int ) ", ECPGt_EOIT, ECPGt_EORT);
#line 23 "test_informix.pgc" #line 23 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
...@@ -67,7 +67,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -67,7 +67,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
/* this INSERT works */ /* this INSERT works */
rsetnull(CDECIMALTYPE, (char *)&j); rsetnull(CDECIMALTYPE, (char *)&j);
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values ( 7 , ? ) ", { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "insert into test ( i , j ) values ( 7 , $1 ) ",
ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal), ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 27 "test_informix.pgc" #line 27 "test_informix.pgc"
...@@ -83,7 +83,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -83,7 +83,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
/* this INSERT should fail because i is a unique column */ /* this INSERT should fail because i is a unique column */
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values ( 7 , 12 ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "insert into test ( i , j ) values ( 7 , 12 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 31 "test_informix.pgc" #line 31 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
...@@ -97,7 +97,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -97,7 +97,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
#line 33 "test_informix.pgc" #line 33 "test_informix.pgc"
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values ( ? , 1 ) ", { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "insert into test ( i , j ) values ( $1 , 1 ) ",
ECPGt_int,&(i),(long)1,(long)1,sizeof(int), ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 35 "test_informix.pgc" #line 35 "test_informix.pgc"
...@@ -113,7 +113,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -113,7 +113,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
/* this will fail (more than one row in subquery) */ /* this will fail (more than one row in subquery) */
{ ECPGdo(__LINE__, 1, 1, NULL, "select i from test where j = ( select j from test ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "select i from test where j = ( select j from test ) ", ECPGt_EOIT, ECPGt_EORT);
#line 39 "test_informix.pgc" #line 39 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
...@@ -127,7 +127,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -127,7 +127,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
/* this however should be ok */ /* this however should be ok */
{ ECPGdo(__LINE__, 1, 1, NULL, "select i from test where j = ( select j from test order by i limit 1 ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "select i from test where j = ( select j from test order by i limit 1 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 43 "test_informix.pgc" #line 43 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
...@@ -142,7 +142,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -142,7 +142,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
ECPG_informix_set_var( 0, &( i ), __LINE__);\ ECPG_informix_set_var( 0, &( i ), __LINE__);\
/* declare c cursor for select * from test where i <= ? */ /* declare c cursor for select * from test where i <= $1 */
#line 47 "test_informix.pgc" #line 47 "test_informix.pgc"
openit(); openit();
...@@ -151,7 +151,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -151,7 +151,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
while (1) while (1)
{ {
{ ECPGdo(__LINE__, 1, 1, NULL, "fetch forward from c", ECPGt_EOIT, { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "fetch forward from c", ECPGt_EOIT,
ECPGt_int,&(i),(long)1,(long)1,sizeof(int), ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal), ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal),
...@@ -178,7 +178,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -178,7 +178,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
deccvint(7, &j); deccvint(7, &j);
deccvint(14, &m); deccvint(14, &m);
decadd(&j, &m, &n); decadd(&j, &m, &n);
{ ECPGdo(__LINE__, 1, 1, NULL, "delete from test where i = ? ", { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "delete from test where i = $1 :: decimal ",
ECPGt_decimal,&(n),(long)1,(long)1,sizeof(decimal), ECPGt_decimal,&(n),(long)1,(long)1,sizeof(decimal),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 72 "test_informix.pgc" #line 72 "test_informix.pgc"
...@@ -188,7 +188,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -188,7 +188,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
printf("DELETE: %ld\n", sqlca.sqlcode); printf("DELETE: %ld\n", sqlca.sqlcode);
{ ECPGdo(__LINE__, 1, 1, NULL, "select 1 from test where i = 14 ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "select 1 from test where i = 14 ", ECPGt_EOIT, ECPGt_EORT);
#line 75 "test_informix.pgc" #line 75 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
...@@ -196,7 +196,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -196,7 +196,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
printf("Exists: %ld\n", sqlca.sqlcode); printf("Exists: %ld\n", sqlca.sqlcode);
{ ECPGdo(__LINE__, 1, 1, NULL, "select 1 from test where i = 147 ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "select 1 from test where i = 147 ", ECPGt_EOIT, ECPGt_EORT);
#line 78 "test_informix.pgc" #line 78 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
...@@ -210,7 +210,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -210,7 +210,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
#line 81 "test_informix.pgc" #line 81 "test_informix.pgc"
{ ECPGdo(__LINE__, 1, 1, NULL, "drop table test ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "drop table test ", ECPGt_EOIT, ECPGt_EORT);
#line 82 "test_informix.pgc" #line 82 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );} if (sqlca.sqlcode < 0) dosqlprint ( );}
...@@ -235,7 +235,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ...@@ -235,7 +235,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
static void openit(void) static void openit(void)
{ {
{ ECPGdo(__LINE__, 1, 1, NULL, "declare c cursor for select * from test where i <= ? ", { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "declare c cursor for select * from test where i <= $1 ",
ECPGt_int,&(*( int *)(ECPG_informix_get_var( 0))),(long)1,(long)1,sizeof(int), ECPGt_int,&(*( int *)(ECPG_informix_get_var( 0))),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 92 "test_informix.pgc" #line 92 "test_informix.pgc"
......
...@@ -2,47 +2,69 @@ ...@@ -2,47 +2,69 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23: QUERY: create table test ( i int primary key , j int ) on connection regress1 [NO_PID]: ECPGexecute line 23: QUERY: create table test ( i int primary key , j int ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23 Ok: CREATE TABLE [NO_PID]: ECPGexecute line 23 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27: QUERY: insert into test ( i , j ) values ( 7 , 0 ) on connection regress1 [NO_PID]: ECPGexecute line 27: QUERY: insert into test ( i , j ) values ( 7 , $1 ) with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27: parameter 1 = 0
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 27 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 28 action = commit connection = regress1 [NO_PID]: ECPGtrans line 28 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31: QUERY: insert into test ( i , j ) values ( 7 , 12 ) on connection regress1 [NO_PID]: ECPGexecute line 31: QUERY: insert into test ( i , j ) values ( 7 , 12 ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31: Error: ERROR: duplicate key value violates unique constraint "test_pkey" [NO_PID]: ECPGexecute line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGcheck_PQresult line 31: Error: ERROR: duplicate key value violates unique constraint "test_pkey"
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlstate 23505 (sqlcode: -239) in line 31, ''duplicate key value violates unique constraint "test_pkey"' in line 31.'. [NO_PID]: raising sqlstate 23505 (sqlcode: -239) in line 31, ''duplicate key value violates unique constraint "test_pkey"' in line 31.'.
[NO_PID]: sqlca: code: -239, state: 23505 [NO_PID]: sqlca: code: -239, state: 23505
[NO_PID]: ECPGtrans line 33 action = rollback connection = regress1 [NO_PID]: ECPGtrans line 33 action = rollback connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: QUERY: insert into test ( i , j ) values ( 14 , 1 ) on connection regress1 [NO_PID]: ECPGexecute line 35: QUERY: insert into test ( i , j ) values ( $1 , 1 ) with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: parameter 1 = 14
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 35 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 36 action = commit connection = regress1 [NO_PID]: ECPGtrans line 36 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 39: QUERY: select i from test where j = ( select j from test ) on connection regress1 [NO_PID]: ECPGexecute line 39: QUERY: select i from test where j = ( select j from test ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 39: Error: ERROR: more than one row returned by a subquery used as an expression [NO_PID]: ECPGcheck_PQresult line 39: Error: ERROR: more than one row returned by a subquery used as an expression
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlstate 21000 (sqlcode: -284) in line 39, ''more than one row returned by a subquery used as an expression' in line 39.'. [NO_PID]: raising sqlstate 21000 (sqlcode: -284) in line 39, ''more than one row returned by a subquery used as an expression' in line 39.'.
[NO_PID]: sqlca: code: -284, state: 21000 [NO_PID]: sqlca: code: -284, state: 21000
[NO_PID]: ECPGtrans line 40 action = rollback connection = regress1 [NO_PID]: ECPGtrans line 40 action = rollback connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 43: QUERY: select i from test where j = ( select j from test order by i limit 1 ) on connection regress1 [NO_PID]: ECPGexecute line 43: QUERY: select i from test where j = ( select j from test order by i limit 1 ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 43: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 43: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 43: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 92: QUERY: declare c cursor for select * from test where i <= 14 on connection regress1 [NO_PID]: ECPGexecute line 92: QUERY: declare c cursor for select * from test where i <= $1 with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 92: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 92: parameter 1 = 14
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 92 Ok: DECLARE CURSOR [NO_PID]: ECPGexecute line 92 Ok: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: QUERY: fetch forward from c on connection regress1 [NO_PID]: ECPGexecute line 54: QUERY: fetch forward from c with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: Correctly got 1 tuples with 2 fields [NO_PID]: ECPGexecute line 54: Correctly got 1 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -50,7 +72,9 @@ ...@@ -50,7 +72,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 54: RESULT: 0 offset: -1 array: Yes [NO_PID]: ECPGget_data line 54: RESULT: 0 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: QUERY: fetch forward from c on connection regress1 [NO_PID]: ECPGexecute line 54: QUERY: fetch forward from c with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: Correctly got 1 tuples with 2 fields [NO_PID]: ECPGexecute line 54: Correctly got 1 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -58,23 +82,33 @@ ...@@ -58,23 +82,33 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 54: RESULT: 1 offset: -1 array: Yes [NO_PID]: ECPGget_data line 54: RESULT: 1 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: QUERY: fetch forward from c on connection regress1 [NO_PID]: ECPGexecute line 54: QUERY: fetch forward from c with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 54: Correctly got 0 tuples with 2 fields [NO_PID]: ECPGexecute line 54: Correctly got 0 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 in line 54, 'No data found in line 54.'. [NO_PID]: raising sqlcode 100 in line 54, 'No data found in line 54.'.
[NO_PID]: sqlca: code: 100, state: 02000 [NO_PID]: sqlca: code: 100, state: 02000
[NO_PID]: ECPGexecute line 72: QUERY: delete from test where i = 21.0 on connection regress1 [NO_PID]: ECPGexecute line 72: QUERY: delete from test where i = $1 :: decimal with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 72: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 72: parameter 1 = 21.0
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 72 Ok: DELETE 0 [NO_PID]: ECPGexecute line 72 Ok: DELETE 0
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode 100 in line 72, 'No data found in line 72.'. [NO_PID]: raising sqlcode 100 in line 72, 'No data found in line 72.'.
[NO_PID]: sqlca: code: 100, state: 02000 [NO_PID]: sqlca: code: 100, state: 02000
[NO_PID]: ECPGexecute line 75: QUERY: select 1 from test where i = 14 on connection regress1 [NO_PID]: ECPGexecute line 75: QUERY: select 1 from test where i = 14 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 75: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 75: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 75: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 78: QUERY: select 1 from test where i = 147 on connection regress1 [NO_PID]: ECPGexecute line 78: QUERY: select 1 from test where i = 147 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 78: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 78: Correctly got 0 tuples with 1 fields [NO_PID]: ECPGexecute line 78: Correctly got 0 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -82,7 +116,9 @@ ...@@ -82,7 +116,9 @@
[NO_PID]: sqlca: code: 100, state: 02000 [NO_PID]: sqlca: code: 100, state: 02000
[NO_PID]: ECPGtrans line 81 action = commit connection = regress1 [NO_PID]: ECPGtrans line 81 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 82: QUERY: drop table test on connection regress1 [NO_PID]: ECPGexecute line 82: QUERY: drop table test with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 82: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 82 Ok: DROP TABLE [NO_PID]: ECPGexecute line 82 Ok: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -180,14 +180,14 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -180,14 +180,14 @@ if (sqlca.sqlcode < 0) sqlprint();}
sql_check("main", "connect", 0); sql_check("main", "connect", 0);
{ ECPGdo(__LINE__, 1, 1, NULL, "set DateStyle to 'DMY'", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "set DateStyle to 'DMY'", ECPGt_EOIT, ECPGt_EORT);
#line 66 "test_informix2.pgc" #line 66 "test_informix2.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
#line 66 "test_informix2.pgc" #line 66 "test_informix2.pgc"
{ ECPGdo(__LINE__, 1, 1, NULL, "create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) ", ECPGt_EOIT, ECPGt_EORT);
#line 68 "test_informix2.pgc" #line 68 "test_informix2.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
...@@ -195,7 +195,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -195,7 +195,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
sql_check("main", "create", 0); sql_check("main", "create", 0);
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 73 "test_informix2.pgc" #line 73 "test_informix2.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
...@@ -203,7 +203,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -203,7 +203,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
sql_check("main", "insert", 0); sql_check("main", "insert", 0);
{ ECPGdo(__LINE__, 1, 1, NULL, "select max ( timestamp ) from history ", ECPGt_EOIT, { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "select max ( timestamp ) from history ", ECPGt_EOIT,
ECPGt_timestamp,&(maxd),(long)1,(long)1,sizeof(timestamp), ECPGt_timestamp,&(maxd),(long)1,(long)1,sizeof(timestamp),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 78 "test_informix2.pgc" #line 78 "test_informix2.pgc"
...@@ -213,7 +213,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -213,7 +213,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
sql_check("main", "select max", 100); sql_check("main", "select max", 100);
{ ECPGdo(__LINE__, 1, 1, NULL, "select customerid , timestamp from history where timestamp = ? limit 1 ", { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "select customerid , timestamp from history where timestamp = $1 limit 1 ",
ECPGt_timestamp,&(maxd),(long)1,(long)1,sizeof(timestamp), ECPGt_timestamp,&(maxd),(long)1,(long)1,sizeof(timestamp),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_int,&(c),(long)1,(long)1,sizeof(int), ECPGt_int,&(c),(long)1,(long)1,sizeof(int),
...@@ -231,10 +231,10 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -231,10 +231,10 @@ if (sqlca.sqlcode < 0) sqlprint();}
intvl = PGTYPESinterval_from_asc("1 day 2 hours 24 minutes 65 seconds", NULL); intvl = PGTYPESinterval_from_asc("1 day 2 hours 24 minutes 65 seconds", NULL);
PGTYPEStimestamp_add_interval(&d, intvl, &e); PGTYPEStimestamp_add_interval(&d, intvl, &e);
free(intvl);
c++; c++;
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into history ( customerid , timestamp , action_taken , narrative ) values ( ? , ? , 'test' , 'test' ) ", { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "insert into history ( customerid , timestamp , action_taken , narrative ) values ( $1 , $2 , 'test' , 'test' ) ",
ECPGt_int,&(c),(long)1,(long)1,sizeof(int), ECPGt_int,&(c),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_timestamp,&(e),(long)1,(long)1,sizeof(timestamp), ECPGt_timestamp,&(e),(long)1,(long)1,sizeof(timestamp),
...@@ -253,7 +253,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -253,7 +253,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 100 "test_informix2.pgc" #line 100 "test_informix2.pgc"
{ ECPGdo(__LINE__, 1, 1, NULL, "drop table history ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, 0, "drop table history ", ECPGt_EOIT, ECPGt_EORT);
#line 102 "test_informix2.pgc" #line 102 "test_informix2.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
......
...@@ -2,25 +2,37 @@ ...@@ -2,25 +2,37 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 66: QUERY: set DateStyle to 'DMY' on connection regress1 [NO_PID]: ECPGexecute line 66: QUERY: set DateStyle to 'DMY' with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 66: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 66 Ok: SET [NO_PID]: ECPGexecute line 66 Ok: SET
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 68: QUERY: create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) on connection regress1 [NO_PID]: ECPGexecute line 68: QUERY: create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 68: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 68 Ok: CREATE TABLE [NO_PID]: ECPGexecute line 68 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 71: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) on connection regress1 [NO_PID]: ECPGexecute line 71: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 71: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 71 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 71 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 76: QUERY: select max ( timestamp ) from history on connection regress1 [NO_PID]: ECPGexecute line 76: QUERY: select max ( timestamp ) from history with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 76: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 76: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 76: RESULT: Wed 07 May 13:28:34 2003 offset: -1 array: Yes [NO_PID]: ECPGget_data line 76: RESULT: Wed 07 May 13:28:34 2003 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 81: QUERY: select customerid , timestamp from history where timestamp = timestamp '2003-05-07 13:28:34' limit 1 on connection regress1 [NO_PID]: ECPGexecute line 81: QUERY: select customerid , timestamp from history where timestamp = $1 limit 1 with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 81: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 81: parameter 1 = 2003-05-07 13:28:34
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 81: Correctly got 1 tuples with 2 fields [NO_PID]: ECPGexecute line 81: Correctly got 1 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -28,13 +40,21 @@ ...@@ -28,13 +40,21 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 81: RESULT: Wed 07 May 13:28:34 2003 offset: -1 array: Yes [NO_PID]: ECPGget_data line 81: RESULT: Wed 07 May 13:28:34 2003 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 95: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values ( 2 , timestamp '2003-05-08 15:53:39' , 'test' , 'test' ) on connection regress1 [NO_PID]: ECPGexecute line 95: QUERY: insert into history ( customerid , timestamp , action_taken , narrative ) values ( $1 , $2 , 'test' , 'test' ) with 2 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 95: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 95: parameter 1 = 2
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 95: parameter 2 = 2003-05-08 15:53:39
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 95 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 95 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 100 action = commit connection = regress1 [NO_PID]: ECPGtrans line 100 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 102: QUERY: drop table history on connection regress1 [NO_PID]: ECPGexecute line 102: QUERY: drop table history with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 102: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 102 Ok: DROP TABLE [NO_PID]: ECPGexecute line 102 Ok: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23: QUERY: alter user connectuser encrypted password 'connectpw' on connection main [NO_PID]: ECPGexecute line 23: QUERY: alter user connectuser encrypted password 'connectpw' with 0 parameter on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23 Ok: ALTER ROLE [NO_PID]: ECPGexecute line 23 Ok: ALTER ROLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -56,17 +56,17 @@ main(void) ...@@ -56,17 +56,17 @@ main(void)
/* this selects from "second" which was opened last */ /* this selects from "second" which was opened last */
{ ECPGdo(__LINE__, 0, 1, NULL, "select current_database () ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select current_database () ", ECPGt_EOIT,
ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char), ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 28 "test2.pgc" #line 28 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, "first", "select current_database () ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, "first", 0, 0, "select current_database () ", ECPGt_EOIT,
ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char), ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 29 "test2.pgc" #line 29 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, "second", "select current_database () ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, "second", 0, 0, "select current_database () ", ECPGt_EOIT,
ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char), ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 30 "test2.pgc" #line 30 "test2.pgc"
...@@ -75,7 +75,7 @@ main(void) ...@@ -75,7 +75,7 @@ main(void)
{ ECPGsetconn(__LINE__, "first");} { ECPGsetconn(__LINE__, "first");}
#line 32 "test2.pgc" #line 32 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select current_database () ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select current_database () ", ECPGt_EOIT,
ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char), ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 33 "test2.pgc" #line 33 "test2.pgc"
...@@ -85,7 +85,7 @@ main(void) ...@@ -85,7 +85,7 @@ main(void)
{ ECPGdisconnect(__LINE__, "CURRENT");} { ECPGdisconnect(__LINE__, "CURRENT");}
#line 36 "test2.pgc" #line 36 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select current_database () ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select current_database () ", ECPGt_EOIT,
ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char), ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 37 "test2.pgc" #line 37 "test2.pgc"
......
...@@ -4,25 +4,33 @@ ...@@ -4,25 +4,33 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 28: QUERY: select current_database () on connection second [NO_PID]: ECPGexecute line 28: QUERY: select current_database () with 0 parameter on connection second
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 28: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 28: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 28: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 28: RESULT: regress1 offset: -1 array: Yes [NO_PID]: ECPGget_data line 28: RESULT: regress1 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 29: QUERY: select current_database () on connection first [NO_PID]: ECPGexecute line 29: QUERY: select current_database () with 0 parameter on connection first
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 29: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 29: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 29: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 29: RESULT: connectdb offset: -1 array: Yes [NO_PID]: ECPGget_data line 29: RESULT: connectdb offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 30: QUERY: select current_database () on connection second [NO_PID]: ECPGexecute line 30: QUERY: select current_database () with 0 parameter on connection second
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 30: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 30: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 30: RESULT: regress1 offset: -1 array: Yes [NO_PID]: ECPGget_data line 30: RESULT: regress1 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 33: QUERY: select current_database () on connection first [NO_PID]: ECPGexecute line 33: QUERY: select current_database () with 0 parameter on connection first
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 33: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 33: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 33: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -30,7 +38,9 @@ ...@@ -30,7 +38,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection first closed. [NO_PID]: ecpg_finish: Connection first closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: QUERY: select current_database () on connection second [NO_PID]: ECPGexecute line 37: QUERY: select current_database () with 0 parameter on connection second
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 37: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -55,7 +55,7 @@ main(void) ...@@ -55,7 +55,7 @@ main(void)
/* this selects from "second" which was opened last */ /* this selects from "second" which was opened last */
{ ECPGdo(__LINE__, 0, 1, NULL, "select current_database () ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select current_database () ", ECPGt_EOIT,
ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char), ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 27 "test3.pgc" #line 27 "test3.pgc"
...@@ -65,7 +65,7 @@ main(void) ...@@ -65,7 +65,7 @@ main(void)
{ ECPGdisconnect(__LINE__, "CURRENT");} { ECPGdisconnect(__LINE__, "CURRENT");}
#line 30 "test3.pgc" #line 30 "test3.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select current_database () ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select current_database () ", ECPGt_EOIT,
ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char), ECPGt_char,(res),(long)200,(long)1,(200)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 31 "test3.pgc" #line 31 "test3.pgc"
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27: QUERY: select current_database () on connection second [NO_PID]: ECPGexecute line 27: QUERY: select current_database () with 0 parameter on connection second
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 27: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 27: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -12,7 +14,9 @@ ...@@ -12,7 +14,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection second closed. [NO_PID]: ecpg_finish: Connection second closed.
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31: QUERY: select current_database () on connection first [NO_PID]: ECPGexecute line 31: QUERY: select current_database () with 0 parameter on connection first
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 31: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 31: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -40,7 +40,7 @@ main(void) ...@@ -40,7 +40,7 @@ main(void)
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); } { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); }
#line 22 "test5.pgc" #line 22 "test5.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "alter user connectuser encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);} { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "alter user connectuser encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);}
#line 23 "test5.pgc" #line 23 "test5.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");} { ECPGdisconnect(__LINE__, "CURRENT");}
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23: QUERY: alter user connectuser encrypted password 'connectpw' on connection main [NO_PID]: ECPGexecute line 23: QUERY: alter user connectuser encrypted password 'connectpw' with 0 parameter on connection main
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 23 Ok: ALTER ROLE [NO_PID]: ECPGexecute line 23 Ok: ALTER ROLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -66,13 +66,13 @@ main(void) ...@@ -66,13 +66,13 @@ main(void)
if (sqlca.sqlcode < 0) sqlprint ( );} if (sqlca.sqlcode < 0) sqlprint ( );}
#line 28 "dt_test.pgc" #line 28 "dt_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "create table date_test ( d date , ts timestamp ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "create table date_test ( d date , ts timestamp ) ", ECPGt_EOIT, ECPGt_EORT);
#line 29 "dt_test.pgc" #line 29 "dt_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );} if (sqlca.sqlcode < 0) sqlprint ( );}
#line 29 "dt_test.pgc" #line 29 "dt_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
#line 30 "dt_test.pgc" #line 30 "dt_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );} if (sqlca.sqlcode < 0) sqlprint ( );}
...@@ -82,7 +82,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -82,7 +82,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
date1 = PGTYPESdate_from_asc(d1, NULL); date1 = PGTYPESdate_from_asc(d1, NULL);
ts1 = PGTYPEStimestamp_from_asc(t1, NULL); ts1 = PGTYPEStimestamp_from_asc(t1, NULL);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into date_test ( d , ts ) values ( ? , ? ) ", { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into date_test ( d , ts ) values ( $1 , $2 ) ",
ECPGt_date,&(date1),(long)1,(long)1,sizeof(date), ECPGt_date,&(date1),(long)1,(long)1,sizeof(date),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_timestamp,&(ts1),(long)1,(long)1,sizeof(timestamp), ECPGt_timestamp,&(ts1),(long)1,(long)1,sizeof(timestamp),
...@@ -93,7 +93,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -93,7 +93,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
#line 35 "dt_test.pgc" #line 35 "dt_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select * from date_test where d = ? ", { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select * from date_test where d = $1 ",
ECPGt_date,&(date1),(long)1,(long)1,sizeof(date), ECPGt_date,&(date1),(long)1,(long)1,sizeof(date),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_date,&(date1),(long)1,(long)1,sizeof(date), ECPGt_date,&(date1),(long)1,(long)1,sizeof(date),
......
...@@ -2,19 +2,33 @@ ...@@ -2,19 +2,33 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 29: QUERY: create table date_test ( d date , ts timestamp ) on connection regress1 [NO_PID]: ECPGexecute line 29: QUERY: create table date_test ( d date , ts timestamp ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 29: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 29 Ok: CREATE TABLE [NO_PID]: ECPGexecute line 29 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 30: QUERY: set datestyle to iso on connection regress1 [NO_PID]: ECPGexecute line 30: QUERY: set datestyle to iso with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 30: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 30 Ok: SET [NO_PID]: ECPGexecute line 30 Ok: SET
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: QUERY: insert into date_test ( d , ts ) values ( date '1966-01-17' , timestamp '2000-07-12 17:34:29' ) on connection regress1 [NO_PID]: ECPGexecute line 35: QUERY: insert into date_test ( d , ts ) values ( $1 , $2 ) with 2 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: parameter 1 = 1966-01-17
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: parameter 2 = 2000-07-12 17:34:29
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 35 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: QUERY: select * from date_test where d = date '1966-01-17' on connection regress1 [NO_PID]: ECPGexecute line 37: QUERY: select * from date_test where d = $1 with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: parameter 1 = 1966-01-17
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: Correctly got 1 tuples with 2 fields [NO_PID]: ECPGexecute line 37: Correctly got 1 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -68,7 +68,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -68,7 +68,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
if (sqlca.sqlcode < 0) sqlprint ( );} if (sqlca.sqlcode < 0) sqlprint ( );}
#line 34 "num_test.pgc" #line 34 "num_test.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ) ", ECPGt_EOIT, ECPGt_EORT);
#line 35 "num_test.pgc" #line 35 "num_test.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );} if (sqlca.sqlcode < 0) sqlprint ( );}
...@@ -98,7 +98,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -98,7 +98,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
des = PGTYPESnumeric_new(); des = PGTYPESnumeric_new();
PGTYPESnumeric_copy(res, des); PGTYPESnumeric_copy(res, des);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( text , num ) values ( 'test' , ? ) ", { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into test ( text , num ) values ( 'test' , $1 ) ",
ECPGt_numeric,&(des),(long)1,(long)0,sizeof(numeric), ECPGt_numeric,&(des),(long)1,(long)0,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 60 "num_test.pgc" #line 60 "num_test.pgc"
...@@ -111,7 +111,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );} ...@@ -111,7 +111,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
PGTYPESnumeric_mul(value1, value2, res); PGTYPESnumeric_mul(value1, value2, res);
PGTYPESnumeric_free(value2); PGTYPESnumeric_free(value2);
{ ECPGdo(__LINE__, 0, 1, NULL, "select num from test where text = 'test' ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select num from test where text = 'test' ", ECPGt_EOIT,
ECPGt_numeric,&(des),(long)1,(long)0,sizeof(numeric), ECPGt_numeric,&(des),(long)1,(long)0,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 66 "num_test.pgc" #line 66 "num_test.pgc"
......
...@@ -4,15 +4,23 @@ ...@@ -4,15 +4,23 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGsetcommit line 34 action = off connection = regress1 [NO_PID]: ECPGsetcommit line 34 action = off connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: QUERY: create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ) on connection regress1 [NO_PID]: ECPGexecute line 35: QUERY: create table test ( text char ( 5 ) , num numeric ( 14 , 7 ) ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35 Ok: CREATE TABLE [NO_PID]: ECPGexecute line 35 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 60: QUERY: insert into test ( text , num ) values ( 'test' , 2369.7 ) on connection regress1 [NO_PID]: ECPGexecute line 60: QUERY: insert into test ( text , num ) values ( 'test' , $1 ) with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 60: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 60: parameter 1 = 2369.7
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 60 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 60 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 66: QUERY: select num from test where text = 'test' on connection regress1 [NO_PID]: ECPGexecute line 66: QUERY: select num from test where text = 'test' with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 66: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 66: Correctly got 1 tuples with 1 fields [NO_PID]: ECPGexecute line 66: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
/* Processed by ecpg (regression mode) */
/* These include files are added by the preprocessor */
#include <ecpgtype.h>
#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "array_of_struct.pgc"
#include <stdio.h>
#line 1 "regression.h"
#line 3 "array_of_struct.pgc"
/* exec sql whenever sqlerror sqlprint ; */
#line 5 "array_of_struct.pgc"
/* exec sql whenever sql_warning sqlprint ; */
#line 6 "array_of_struct.pgc"
/* exec sql whenever not found sqlprint ; */
#line 7 "array_of_struct.pgc"
typedef struct {
#line 12 "array_of_struct.pgc"
struct varchar_name_12 { int len; char arr[ 50 ]; } name ;
#line 13 "array_of_struct.pgc"
int phone ;
} customer ;
#line 14 "array_of_struct.pgc"
typedef struct ind {
#line 19 "array_of_struct.pgc"
short name_ind ;
#line 20 "array_of_struct.pgc"
short phone_ind ;
} cust_ind ;
#line 21 "array_of_struct.pgc"
int main( int argc, char * argv[] )
{
/* exec sql begin declare section */
typedef struct {
#line 30 "array_of_struct.pgc"
struct varchar_name_30 { int len; char arr[ 50 ]; } name ;
#line 31 "array_of_struct.pgc"
int phone ;
} customer2 ;
#line 32 "array_of_struct.pgc"
#line 26 "array_of_struct.pgc"
customer custs1 [ 10 ] ;
#line 27 "array_of_struct.pgc"
cust_ind inds [ 10 ] ;
#line 33 "array_of_struct.pgc"
customer2 custs2 [ 10 ] ;
#line 38 "array_of_struct.pgc"
struct customer3 {
#line 36 "array_of_struct.pgc"
struct varchar_name_36 { int len; char arr[ 50 ]; } name ;
#line 37 "array_of_struct.pgc"
int phone ;
} custs3 [ 10 ] ;
#line 43 "array_of_struct.pgc"
struct customer4 {
#line 41 "array_of_struct.pgc"
struct varchar_name_41 { int len; char arr[ 50 ]; } name ;
#line 42 "array_of_struct.pgc"
int phone ;
} custs4 ;
#line 44 "array_of_struct.pgc"
int r ;
/* exec sql end declare section */
#line 45 "array_of_struct.pgc"
ECPGdebug(1, stderr);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
#line 49 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 49 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 49 "array_of_struct.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "create table customers ( c varchar ( 50 ) , p int ) ", ECPGt_EOIT, ECPGt_EORT);
#line 51 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 51 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 51 "array_of_struct.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into customers values ( 'John Doe' , '12345' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 52 "array_of_struct.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
#line 52 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 52 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 52 "array_of_struct.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into customers values ( 'Jane Doe' , '67890' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 53 "array_of_struct.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
#line 53 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 53 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 53 "array_of_struct.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select * from customers limit 2 ", ECPGt_EOIT,
ECPGt_varchar,&(custs1->name),(long)50,(long)10,sizeof( customer ),
ECPGt_short,&(inds->name_ind),(long)1,(long)10,sizeof( struct ind ),
ECPGt_int,&(custs1->phone),(long)1,(long)10,sizeof( customer ),
ECPGt_short,&(inds->phone_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_EORT);
#line 55 "array_of_struct.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
#line 55 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 55 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 55 "array_of_struct.pgc"
printf("custs1:\n");
for (r = 0; r < 2; r++)
{
printf( "name - %s\n", custs1[r].name.arr );
printf( "phone - %d\n", custs1[r].phone );
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select * from customers limit 2 ", ECPGt_EOIT,
ECPGt_varchar,&(custs2->name),(long)50,(long)10,sizeof( customer2 ),
ECPGt_short,&(inds->name_ind),(long)1,(long)10,sizeof( struct ind ),
ECPGt_int,&(custs2->phone),(long)1,(long)10,sizeof( customer2 ),
ECPGt_short,&(inds->phone_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_EORT);
#line 63 "array_of_struct.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
#line 63 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 63 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 63 "array_of_struct.pgc"
printf("\ncusts2:\n");
for (r = 0; r < 2; r++)
{
printf( "name - %s\n", custs2[r].name.arr );
printf( "phone - %d\n", custs2[r].phone );
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select * from customers limit 2 ", ECPGt_EOIT,
ECPGt_varchar,&(custs3->name),(long)50,(long)10,sizeof( struct customer3 ),
ECPGt_short,&(inds->name_ind),(long)1,(long)10,sizeof( struct ind ),
ECPGt_int,&(custs3->phone),(long)1,(long)10,sizeof( struct customer3 ),
ECPGt_short,&(inds->phone_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_EORT);
#line 71 "array_of_struct.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
#line 71 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 71 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 71 "array_of_struct.pgc"
printf("\ncusts3:\n");
for (r = 0; r < 2; r++)
{
printf( "name - %s\n", custs3[r].name.arr );
printf( "phone - %d\n", custs3[r].phone );
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select * from customers limit 1 ", ECPGt_EOIT,
ECPGt_varchar,&(custs4.name),(long)50,(long)1,sizeof(struct varchar_name_41),
ECPGt_short,&(inds[0].name_ind),(long)1,(long)1,sizeof(short),
ECPGt_int,&(custs4.phone),(long)1,(long)1,sizeof(int),
ECPGt_short,&(inds[0].phone_ind),(long)1,(long)1,sizeof(short), ECPGt_EORT);
#line 79 "array_of_struct.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint();
#line 79 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 79 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 79 "array_of_struct.pgc"
printf("\ncusts4:\n");
printf( "name - %s\n", custs4.name.arr );
printf( "phone - %d\n", custs4.phone );
{ ECPGdisconnect(__LINE__, "ALL");
#line 84 "array_of_struct.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 84 "array_of_struct.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 84 "array_of_struct.pgc"
return( 0 );
}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 51: QUERY: create table customers ( c varchar ( 50 ) , p int ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 51: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 51 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: QUERY: insert into customers values ( 'John Doe' , '12345' ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 53: QUERY: insert into customers values ( 'Jane Doe' , '67890' ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 53: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 53 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 55: QUERY: select * from customers limit 2 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 55: Correctly got 2 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 55: RESULT: John Doe offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 55: RESULT: Jane Doe offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 55: RESULT: 12345 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 55: RESULT: 67890 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 63: QUERY: select * from customers limit 2 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 63: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 63: Correctly got 2 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 63: RESULT: John Doe offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 63: RESULT: Jane Doe offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 63: RESULT: 12345 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 63: RESULT: 67890 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 71: QUERY: select * from customers limit 2 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 71: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 71: Correctly got 2 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 71: RESULT: John Doe offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 71: RESULT: Jane Doe offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 71: RESULT: 12345 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 71: RESULT: 67890 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 79: QUERY: select * from customers limit 1 with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 79: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 79: Correctly got 1 tuples with 2 fields
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 79: RESULT: John Doe offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 79: RESULT: 12345 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection regress1 closed.
[NO_PID]: sqlca: code: 0, state: 00000
custs1:
name - John Doe
phone - 12345
name - Jane Doe
phone - 67890
custs2:
name - John Doe
phone - 12345
name - Jane Doe
phone - 67890
custs3:
name - John Doe
phone - 12345
name - Jane Doe
phone - 67890
custs4:
name - John Doe
phone - 12345
/* Processed by ecpg (regression mode) */
/* These include files are added by the preprocessor */
#include <ecpgtype.h>
#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
/* End of automatic include section */
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
#line 1 "autoprep.pgc"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* test automatic prepare for all statements */
#line 1 "regression.h"
#line 6 "autoprep.pgc"
int main(int argc, char* argv[]) {
/* exec sql begin declare section */
#line 10 "autoprep.pgc"
int item [ 4 ] , ind [ 4 ] , i = 1 ;
/* exec sql end declare section */
#line 11 "autoprep.pgc"
ECPGdebug(1, stderr);
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); }
#line 14 "autoprep.pgc"
/* exec sql whenever sql_warning sqlprint ; */
#line 16 "autoprep.pgc"
/* exec sql whenever sqlerror sqlprint ; */
#line 17 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "create table T ( Item1 int , Item2 int ) ", ECPGt_EOIT, ECPGt_EORT);
#line 19 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 19 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 19 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "insert into T values ( 1 , null ) ", ECPGt_EOIT, ECPGt_EORT);
#line 21 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 21 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 21 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "insert into T values ( 1 , $1 ) ",
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 22 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 22 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 22 "autoprep.pgc"
i++;
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "insert into T values ( 1 , $1 ) ",
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 24 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 24 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 24 "autoprep.pgc"
{ ECPGprepare(__LINE__, NULL, 0, "i", " insert into T values ( 1 , 2 ) ");
#line 25 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 25 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 25 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 1, "i", ECPGt_EOIT, ECPGt_EORT);
#line 26 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 26 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 26 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "select Item2 from T order by Item2 nulls last", ECPGt_EOIT,
ECPGt_int,(item),(long)1,(long)4,sizeof(int),
ECPGt_int,(ind),(long)1,(long)4,sizeof(int), ECPGt_EORT);
#line 28 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 28 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 28 "autoprep.pgc"
for (i=0; i<4; i++)
printf("item[%d] = %d\n", i, ind[i] ? -1 : item[i]);
/* declare C cursor for select Item1 from T */
#line 33 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "declare C cursor for select Item1 from T ", ECPGt_EOIT, ECPGt_EORT);
#line 35 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 35 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 35 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "fetch 1 in C", ECPGt_EOIT,
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 37 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 37 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 37 "autoprep.pgc"
printf("i = %d\n", i);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "close C", ECPGt_EOIT, ECPGt_EORT);
#line 40 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 40 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 40 "autoprep.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, 3, "drop table T ", ECPGt_EOIT, ECPGt_EORT);
#line 42 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 42 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 42 "autoprep.pgc"
{ ECPGdisconnect(__LINE__, "ALL");
#line 44 "autoprep.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
#line 44 "autoprep.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 44 "autoprep.pgc"
return 0;
}
[NO_PID]: ECPGdebug: set to 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 19: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 19: NAME: ecpg1 QUERY: create table T ( Item1 int , Item2 int )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 19: QUERY: create table T ( Item1 int , Item2 int ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 19: using PQexecPrepared for create table T ( Item1 int , Item2 int )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 19 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 21: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 21: NAME: ecpg2 QUERY: insert into T values ( 1 , null )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 21: QUERY: insert into T values ( 1 , null ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 21: using PQexecPrepared for insert into T values ( 1 , null )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 21 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 22: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 22: NAME: ecpg3 QUERY: insert into T values ( 1 , $1 )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 22: QUERY: insert into T values ( 1 , $1 ) with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 22: using PQexecPrepared for insert into T values ( 1 , $1 )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 22: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 22 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 24: stmt found in cache, entry 6248
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 24: QUERY: insert into T values ( 1 , $1 ) with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 24: using PQexecPrepared for insert into T values ( 1 , $1 )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 24: parameter 1 = 2
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 24 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 25: NAME: i QUERY: insert into T values ( 1 , 2 )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 26: QUERY: insert into T values ( 1 , 2 ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 26: using PQexecPrepared for insert into T values ( 1 , 2 )
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 26 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 28: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 28: NAME: ecpg4 QUERY: select Item2 from T order by Item2 nulls last
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 28: QUERY: select Item2 from T order by Item2 nulls last with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 28: using PQexecPrepared for select Item2 from T order by Item2 nulls last
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 28: Correctly got 4 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 28: RESULT: 1 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 28: RESULT: 2 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 28: RESULT: 2 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 28: RESULT: offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 35: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 35: NAME: ecpg5 QUERY: declare C cursor for select Item1 from T
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: QUERY: declare C cursor for select Item1 from T with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35: using PQexecPrepared for declare C cursor for select Item1 from T
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 35 Ok: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 37: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 37: NAME: ecpg6 QUERY: fetch 1 in C
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: QUERY: fetch 1 in C with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: using PQexecPrepared for fetch 1 in C
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 37: Correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 37: RESULT: 1 offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 40: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 40: NAME: ecpg7 QUERY: close C
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 40: QUERY: close C with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 40: using PQexecPrepared for close C
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 40 Ok: CLOSE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGauto_prepare line 42: stmt not in cache; inserting
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGprepare line 42: NAME: ecpg8 QUERY: drop table T
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 42: QUERY: drop table T with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 42: using PQexecPrepared for drop table T
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 42 Ok: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection regress1 closed.
[NO_PID]: sqlca: code: 0, state: 00000
item[0] = 1
item[1] = 2
item[2] = 2
item[3] = -1
i = 1
...@@ -78,7 +78,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -78,7 +78,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 34 "define.pgc" #line 34 "define.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ) ", ECPGt_EOIT, ECPGt_EORT);
#line 36 "define.pgc" #line 36 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
...@@ -91,13 +91,13 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -91,13 +91,13 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 37 "define.pgc" #line 37 "define.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 39 "define.pgc" #line 39 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
#line 39 "define.pgc" #line 39 "define.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 40 "define.pgc" #line 40 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
...@@ -110,7 +110,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -110,7 +110,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 41 "define.pgc" #line 41 "define.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select * from test ", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select * from test ", ECPGt_EOIT,
ECPGt_char,(name),(long)8,(long)6,(8)*sizeof(char), ECPGt_char,(name),(long)8,(long)6,(8)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_int,(amount),(long)1,(long)6,sizeof(int), ECPGt_int,(amount),(long)1,(long)6,sizeof(int),
...@@ -142,7 +142,7 @@ if (sqlca.sqlcode < 0) sqlprint();} ...@@ -142,7 +142,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l); printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
} }
{ ECPGdo(__LINE__, 0, 1, NULL, "drop table test ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "drop table test ", ECPGt_EOIT, ECPGt_EORT);
#line 56 "define.pgc" #line 56 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint();} if (sqlca.sqlcode < 0) sqlprint();}
......
...@@ -2,23 +2,31 @@ ...@@ -2,23 +2,31 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: QUERY: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ) on connection regress1 [NO_PID]: ECPGexecute line 36: QUERY: create table test ( name char ( 8 ) , amount int , letter char ( 1 ) ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 36 Ok: CREATE TABLE [NO_PID]: ECPGexecute line 36 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 37 action = commit connection = regress1 [NO_PID]: ECPGtrans line 37 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 39: QUERY: insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ) on connection regress1 [NO_PID]: ECPGexecute line 39: QUERY: insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 39: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 39 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 39 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 40: QUERY: insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ) on connection regress1 [NO_PID]: ECPGexecute line 40: QUERY: insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 40 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 40 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGtrans line 41 action = commit connection = regress1 [NO_PID]: ECPGtrans line 41 action = commit connection = regress1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 43: QUERY: select * from test on connection regress1 [NO_PID]: ECPGexecute line 43: QUERY: select * from test with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 43: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 43: Correctly got 2 tuples with 3 fields [NO_PID]: ECPGexecute line 43: Correctly got 2 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
...@@ -34,7 +42,9 @@ ...@@ -34,7 +42,9 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGget_data line 43: RESULT: t offset: -1 array: Yes [NO_PID]: ECPGget_data line 43: RESULT: t offset: -1 array: Yes
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 56: QUERY: drop table test on connection regress1 [NO_PID]: ECPGexecute line 56: QUERY: drop table test with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 56: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 56 Ok: DROP TABLE [NO_PID]: ECPGexecute line 56 Ok: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -207,7 +207,7 @@ int main(void) ...@@ -207,7 +207,7 @@ int main(void)
/* exec sql whenever sqlerror do fa ( ) ; */ /* exec sql whenever sqlerror do fa ( ) ; */
#line 87 "init.pgc" #line 87 "init.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select now () ", ECPGt_EOIT, ECPGt_EORT);
#line 88 "init.pgc" #line 88 "init.pgc"
if (sqlca.sqlcode < 0) fa ( );} if (sqlca.sqlcode < 0) fa ( );}
...@@ -216,7 +216,7 @@ if (sqlca.sqlcode < 0) fa ( );} ...@@ -216,7 +216,7 @@ if (sqlca.sqlcode < 0) fa ( );}
/* exec sql whenever sqlerror do fb ( 20 ) ; */ /* exec sql whenever sqlerror do fb ( 20 ) ; */
#line 89 "init.pgc" #line 89 "init.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select now () ", ECPGt_EOIT, ECPGt_EORT);
#line 90 "init.pgc" #line 90 "init.pgc"
if (sqlca.sqlcode < 0) fb ( 20 );} if (sqlca.sqlcode < 0) fb ( 20 );}
...@@ -225,7 +225,7 @@ if (sqlca.sqlcode < 0) fb ( 20 );} ...@@ -225,7 +225,7 @@ if (sqlca.sqlcode < 0) fb ( 20 );}
/* exec sql whenever sqlerror do fc ( \"50\" ) ; */ /* exec sql whenever sqlerror do fc ( \"50\" ) ; */
#line 91 "init.pgc" #line 91 "init.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select now () ", ECPGt_EOIT, ECPGt_EORT);
#line 92 "init.pgc" #line 92 "init.pgc"
if (sqlca.sqlcode < 0) fc ( "50" );} if (sqlca.sqlcode < 0) fc ( "50" );}
...@@ -234,7 +234,7 @@ if (sqlca.sqlcode < 0) fc ( "50" );} ...@@ -234,7 +234,7 @@ if (sqlca.sqlcode < 0) fc ( "50" );}
/* exec sql whenever sqlerror do fd ( \"50\" , 1 ) ; */ /* exec sql whenever sqlerror do fd ( \"50\" , 1 ) ; */
#line 93 "init.pgc" #line 93 "init.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select now () ", ECPGt_EOIT, ECPGt_EORT);
#line 94 "init.pgc" #line 94 "init.pgc"
if (sqlca.sqlcode < 0) fd ( "50" , 1 );} if (sqlca.sqlcode < 0) fd ( "50" , 1 );}
...@@ -243,7 +243,7 @@ if (sqlca.sqlcode < 0) fd ( "50" , 1 );} ...@@ -243,7 +243,7 @@ if (sqlca.sqlcode < 0) fd ( "50" , 1 );}
/* exec sql whenever sqlerror do fe ( ENUM0 ) ; */ /* exec sql whenever sqlerror do fe ( ENUM0 ) ; */
#line 95 "init.pgc" #line 95 "init.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select now () ", ECPGt_EOIT, ECPGt_EORT);
#line 96 "init.pgc" #line 96 "init.pgc"
if (sqlca.sqlcode < 0) fe ( ENUM0 );} if (sqlca.sqlcode < 0) fe ( ENUM0 );}
...@@ -252,7 +252,7 @@ if (sqlca.sqlcode < 0) fe ( ENUM0 );} ...@@ -252,7 +252,7 @@ if (sqlca.sqlcode < 0) fe ( ENUM0 );}
/* exec sql whenever sqlerror do sqlnotice ( NULL , 0 ) ; */ /* exec sql whenever sqlerror do sqlnotice ( NULL , 0 ) ; */
#line 97 "init.pgc" #line 97 "init.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select now () ", ECPGt_EOIT, ECPGt_EORT);
#line 98 "init.pgc" #line 98 "init.pgc"
if (sqlca.sqlcode < 0) sqlnotice ( NULL , 0 );} if (sqlca.sqlcode < 0) sqlnotice ( NULL , 0 );}
......
...@@ -120,7 +120,7 @@ main (void) ...@@ -120,7 +120,7 @@ main (void)
exit (sqlca.sqlcode); exit (sqlca.sqlcode);
} }
{ ECPGdo(__LINE__, 0, 1, NULL, "create table empl ( idnum integer , name char ( 20 ) , accs smallint , string1 char ( 10 ) , string2 char ( 10 ) , string3 char ( 10 ) ) ", ECPGt_EOIT, ECPGt_EORT);} { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "create table empl ( idnum integer , name char ( 20 ) , accs smallint , string1 char ( 10 ) , string2 char ( 10 ) , string3 char ( 10 ) ) ", ECPGt_EOIT, ECPGt_EORT);}
#line 51 "type.pgc" #line 51 "type.pgc"
if (sqlca.sqlcode) if (sqlca.sqlcode)
...@@ -129,7 +129,7 @@ main (void) ...@@ -129,7 +129,7 @@ main (void)
exit (sqlca.sqlcode); exit (sqlca.sqlcode);
} }
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into empl values ( 1 , 'user name' , 320 , 'first str' , 'second str' , 'third str' ) ", ECPGt_EOIT, ECPGt_EORT);} { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into empl values ( 1 , 'user name' , 320 , 'first str' , 'second str' , 'third str' ) ", ECPGt_EOIT, ECPGt_EORT);}
#line 58 "type.pgc" #line 58 "type.pgc"
if (sqlca.sqlcode) if (sqlca.sqlcode)
...@@ -138,7 +138,7 @@ main (void) ...@@ -138,7 +138,7 @@ main (void)
exit (sqlca.sqlcode); exit (sqlca.sqlcode);
} }
{ ECPGdo(__LINE__, 0, 1, NULL, "select idnum , name , accs , string1 , string2 , string3 from empl where idnum = ? ", { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "select idnum , name , accs , string1 , string2 , string3 from empl where idnum = $1 ",
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long), ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long), ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
......
...@@ -2,15 +2,23 @@ ...@@ -2,15 +2,23 @@
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 50: QUERY: create table empl ( idnum integer , name char ( 20 ) , accs smallint , string1 char ( 10 ) , string2 char ( 10 ) , string3 char ( 10 ) ) on connection regress1 [NO_PID]: ECPGexecute line 50: QUERY: create table empl ( idnum integer , name char ( 20 ) , accs smallint , string1 char ( 10 ) , string2 char ( 10 ) , string3 char ( 10 ) ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 50: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 50 Ok: CREATE TABLE [NO_PID]: ECPGexecute line 50 Ok: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 58: QUERY: insert into empl values ( 1 , 'user name' , 320 , 'first str' , 'second str' , 'third str' ) on connection regress1 [NO_PID]: ECPGexecute line 58: QUERY: insert into empl values ( 1 , 'user name' , 320 , 'first str' , 'second str' , 'third str' ) with 0 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 58: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 58 Ok: INSERT 0 1 [NO_PID]: ECPGexecute line 58 Ok: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 65: QUERY: select idnum , name , accs , string1 , string2 , string3 from empl where idnum = 1 on connection regress1 [NO_PID]: ECPGexecute line 65: QUERY: select idnum , name , accs , string1 , string2 , string3 from empl where idnum = $1 with 1 parameter on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 65: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 65: parameter 1 = 1
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGexecute line 65: Correctly got 1 tuples with 6 fields [NO_PID]: ECPGexecute line 65: Correctly got 1 tuples with 6 fields
[NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: sqlca: code: 0, state: 00000
......
...@@ -75,7 +75,7 @@ main (void) ...@@ -75,7 +75,7 @@ main (void)
#line 27 "variable.pgc" #line 27 "variable.pgc"
struct personal_struct { struct personal_struct {
#line 25 "variable.pgc" #line 25 "variable.pgc"
struct varchar_name { int len; char arr[ BUFFERSIZ ]; } name ; struct varchar_name_25 { int len; char arr[ BUFFERSIZ ]; } name ;
#line 26 "variable.pgc" #line 26 "variable.pgc"
struct birthinfo birth ; struct birthinfo birth ;
...@@ -128,7 +128,7 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -128,7 +128,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "set"); strcpy(msg, "set");
{ ECPGdo(__LINE__, 0, 1, NULL, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
#line 46 "variable.pgc" #line 46 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
...@@ -136,7 +136,7 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -136,7 +136,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "create"); strcpy(msg, "create");
{ ECPGdo(__LINE__, 0, 1, NULL, "create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer ) ", ECPGt_EOIT, ECPGt_EORT);
#line 49 "variable.pgc" #line 49 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
...@@ -144,31 +144,31 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -144,31 +144,31 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "insert"); strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 52 "variable.pgc" #line 52 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 52 "variable.pgc" #line 52 "variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 53 "variable.pgc" #line 53 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 53 "variable.pgc" #line 53 "variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , age ) values ( 'Child 1' , 16 ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into family ( name , age ) values ( 'Child 1' , 16 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 54 "variable.pgc" #line 54 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 54 "variable.pgc" #line 54 "variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , age ) values ( 'Child 2' , 14 ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into family ( name , age ) values ( 'Child 2' , 14 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 55 "variable.pgc" #line 55 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 55 "variable.pgc" #line 55 "variable.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into family ( name , age ) values ( 'Child 3' , 9 ) ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into family ( name , age ) values ( 'Child 3' , 9 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 56 "variable.pgc" #line 56 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
...@@ -184,7 +184,7 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -184,7 +184,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "open"); strcpy(msg, "open");
{ ECPGdo(__LINE__, 0, 1, NULL, "declare cur cursor for select name , born , age , married , children from family ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "declare cur cursor for select name , born , age , married , children from family ", ECPGt_EOIT, ECPGt_EORT);
#line 62 "variable.pgc" #line 62 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
...@@ -200,8 +200,8 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -200,8 +200,8 @@ if (sqlca.sqlcode < 0) exit (1);}
memset(i, 0, sizeof(ind_personal)); memset(i, 0, sizeof(ind_personal));
while (1) { while (1) {
strcpy(msg, "fetch"); strcpy(msg, "fetch");
{ ECPGdo(__LINE__, 0, 1, NULL, "fetch cur", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "fetch cur", ECPGt_EOIT,
ECPGt_varchar,&(p->name),(long)BUFFERSIZ,(long)1,sizeof(struct varchar_name), ECPGt_varchar,&(p->name),(long)BUFFERSIZ,(long)1,sizeof(struct varchar_name_25),
ECPGt_int,&(i->ind_name),(long)1,(long)1,sizeof(int), ECPGt_int,&(i->ind_name),(long)1,(long)1,sizeof(int),
ECPGt_long,&(p->birth.born),(long)1,(long)1,sizeof(long), ECPGt_long,&(p->birth.born),(long)1,(long)1,sizeof(long),
ECPGt_long,&(i->ind_birth.born),(long)1,(long)1,sizeof(long), ECPGt_long,&(i->ind_birth.born),(long)1,(long)1,sizeof(long),
...@@ -235,7 +235,7 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -235,7 +235,7 @@ if (sqlca.sqlcode < 0) exit (1);}
} }
strcpy(msg, "close"); strcpy(msg, "close");
{ ECPGdo(__LINE__, 0, 1, NULL, "close cur", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "close cur", ECPGt_EOIT, ECPGt_EORT);
#line 88 "variable.pgc" #line 88 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
...@@ -243,7 +243,7 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -243,7 +243,7 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "drop"); strcpy(msg, "drop");
{ ECPGdo(__LINE__, 0, 1, NULL, "drop table family ", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "drop table family ", ECPGt_EOIT, ECPGt_EORT);
#line 91 "variable.pgc" #line 91 "variable.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
......
...@@ -75,7 +75,7 @@ main (void) ...@@ -75,7 +75,7 @@ main (void)
exit (sqlca.sqlcode); exit (sqlca.sqlcode);
} }
{ ECPGdo(__LINE__, 0, 1, NULL, "create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea ) ", ECPGt_EOIT, ECPGt_EORT);} { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "create table empl ( idnum integer , name char ( 20 ) , accs smallint , byte bytea ) ", ECPGt_EOIT, ECPGt_EORT);}
#line 36 "binary.pgc" #line 36 "binary.pgc"
if (sqlca.sqlcode) if (sqlca.sqlcode)
...@@ -84,7 +84,7 @@ main (void) ...@@ -84,7 +84,7 @@ main (void)
exit (sqlca.sqlcode); exit (sqlca.sqlcode);
} }
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into empl values ( 1 , 'first user' , 320 , ? ) ", { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "insert into empl values ( 1 , 'first user' , 320 , $1 ) ",
ECPGt_char,&(data),(long)0,(long)1,(1)*sizeof(char), ECPGt_char,&(data),(long)0,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
#line 43 "binary.pgc" #line 43 "binary.pgc"
...@@ -95,15 +95,15 @@ main (void) ...@@ -95,15 +95,15 @@ main (void)
exit (sqlca.sqlcode); exit (sqlca.sqlcode);
} }
/* declare C cursor for select name , accs , byte from empl where idnum = ? */ /* declare C cursor for select name , accs , byte from empl where idnum = $1 */
#line 50 "binary.pgc" #line 50 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "declare C cursor for select name , accs , byte from empl where idnum = ? ", { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "declare C cursor for select name , accs , byte from empl where idnum = $1 ",
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long), ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
#line 51 "binary.pgc" #line 51 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "fetch C", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "fetch C", ECPGt_EOIT,
ECPGt_char,(empl.name),(long)21,(long)1,(21)*sizeof(char), ECPGt_char,(empl.name),(long)21,(long)1,(21)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_short,&(empl.accs),(long)1,(long)1,sizeof(short), ECPGt_short,&(empl.accs),(long)1,(long)1,sizeof(short),
...@@ -122,15 +122,15 @@ main (void) ...@@ -122,15 +122,15 @@ main (void)
memset(empl.name, 0, 21L); memset(empl.name, 0, 21L);
memset(empl.byte, '#', 20L); memset(empl.byte, '#', 20L);
/* declare B binary cursor for select name , accs , byte from empl where idnum = ? */ /* declare B binary cursor for select name , accs , byte from empl where idnum = $1 */
#line 63 "binary.pgc" #line 63 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "declare B binary cursor for select name , accs , byte from empl where idnum = ? ", { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "declare B binary cursor for select name , accs , byte from empl where idnum = $1 ",
ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long), ECPGt_long,&(empl.idnum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
#line 64 "binary.pgc" #line 64 "binary.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "fetch B", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "fetch B", ECPGt_EOIT,
ECPGt_char,(empl.name),(long)21,(long)1,(21)*sizeof(char), ECPGt_char,(empl.name),(long)21,(long)1,(21)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_short,&(empl.accs),(long)1,(long)1,sizeof(short), ECPGt_short,&(empl.accs),(long)1,(long)1,sizeof(short),
...@@ -145,7 +145,7 @@ main (void) ...@@ -145,7 +145,7 @@ main (void)
exit (sqlca.sqlcode); exit (sqlca.sqlcode);
} }
{ ECPGdo(__LINE__, 0, 1, NULL, "close B", ECPGt_EOIT, ECPGt_EORT);} { ECPGdo(__LINE__, 0, 1, NULL, 0, 0, "close B", ECPGt_EOIT, ECPGt_EORT);}
#line 72 "binary.pgc" #line 72 "binary.pgc"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment