mirror of https://github.com/postgres/postgres
ecpg in both native and compatiblity mode.REL9_0_ALPHA4_BRANCH
parent
af322a8a3e
commit
6d4a351fcb
@ -0,0 +1,617 @@ |
||||
/*
|
||||
* SQLDA support routines |
||||
* |
||||
* The allocated memory area pointed by an sqlda pointer |
||||
* contains both the metadata and the data, so freeing up |
||||
* is a simple free(sqlda) as expected by the ESQL/C examples. |
||||
*/ |
||||
|
||||
#define POSTGRES_ECPG_INTERNAL |
||||
#include "postgres_fe.h" |
||||
#include "pg_type.h" |
||||
|
||||
#include <inttypes.h> |
||||
#include <dlfcn.h> |
||||
|
||||
#include "ecpg-pthread-win32.h" |
||||
#include "decimal.h" |
||||
#include "ecpgtype.h" |
||||
#include "ecpglib.h" |
||||
#include "ecpgerrno.h" |
||||
#include "extern.h" |
||||
#include "sqlca.h" |
||||
#include "sqlda-native.h" |
||||
#include "sqlda-compat.h" |
||||
|
||||
/*
|
||||
* Compute the next variable's offset with |
||||
* the current variable's size and alignment. |
||||
*
|
||||
* |
||||
* Returns: |
||||
* - the current variable's offset in *current |
||||
* - the next variable's offset in *next |
||||
*/ |
||||
static void |
||||
ecpg_sqlda_align_add_size(long offset, int alignment, int size, long *current, long *next) |
||||
{ |
||||
if (offset % alignment) |
||||
offset += alignment - (offset % alignment); |
||||
if (current) |
||||
*current = offset; |
||||
offset += size; |
||||
if (next) |
||||
*next = offset; |
||||
} |
||||
|
||||
static long |
||||
sqlda_compat_empty_size(const PGresult *res) |
||||
{ |
||||
long offset; |
||||
int i; |
||||
int sqld = PQnfields(res); |
||||
|
||||
/* Initial size to store main structure and field structures */ |
||||
offset = sizeof(struct sqlda_compat) + sqld * sizeof(struct sqlvar_compat); |
||||
|
||||
/* Add space for field names */ |
||||
for (i = 0; i < sqld; i++) |
||||
offset += strlen(PQfname(res, i)) + 1; |
||||
|
||||
/* Add padding to the first field value */ |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), 0, &offset, NULL); |
||||
|
||||
return offset; |
||||
} |
||||
|
||||
static long |
||||
sqlda_common_total_size(const PGresult *res, int row, enum COMPAT_MODE compat, long offset) |
||||
{ |
||||
int sqld = PQnfields(res); |
||||
int i; |
||||
long next_offset; |
||||
|
||||
/* Add space for the field values */ |
||||
for (i = 0; i < sqld; i++) |
||||
{ |
||||
enum ECPGttype type = sqlda_dynamic_type(PQftype(res, i), compat); |
||||
switch (type) |
||||
{ |
||||
case ECPGt_short: |
||||
case ECPGt_unsigned_short: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(short), sizeof(short), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_int: |
||||
case ECPGt_unsigned_int: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(int), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_long: |
||||
case ECPGt_unsigned_long: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(long), sizeof(long), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_long_long: |
||||
case ECPGt_unsigned_long_long: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(long long), sizeof(long long), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_bool: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(bool), sizeof(bool), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_float: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(float), sizeof(float), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_double: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(double), sizeof(double), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_decimal: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(decimal), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_numeric: |
||||
/*
|
||||
* Let's align both the numeric struct and the digits array to int |
||||
* Unfortunately we need to do double work here to compute the size |
||||
* of the space needed for the numeric structure. |
||||
*/ |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(numeric), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset1 %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
if (!PQgetisnull(res, row, i)) |
||||
{ |
||||
char *val = PQgetvalue(res, row, i); |
||||
numeric *num; |
||||
|
||||
num = PGTYPESnumeric_from_asc(val, NULL); |
||||
if (!num) |
||||
break; |
||||
ecpg_sqlda_align_add_size(next_offset, sizeof(int), num->ndigits + 1, &offset, &next_offset); |
||||
ecpg_log("%s type %s offset2 %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
PGTYPESnumeric_free(num); |
||||
} |
||||
break; |
||||
case ECPGt_date: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(date), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_timestamp: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(timestamp), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_interval: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(interval), &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
case ECPGt_char: |
||||
case ECPGt_unsigned_char: |
||||
case ECPGt_string: |
||||
default: |
||||
{ |
||||
long datalen = strlen(PQgetvalue(res, row, i)) + 1; |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), datalen, &offset, &next_offset); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(type), offset); |
||||
break; |
||||
} |
||||
} |
||||
offset = next_offset; |
||||
} |
||||
return offset; |
||||
} |
||||
|
||||
|
||||
static long |
||||
sqlda_compat_total_size(const PGresult *res, int row, enum COMPAT_MODE compat) |
||||
{ |
||||
long offset; |
||||
|
||||
offset = sqlda_compat_empty_size(res); |
||||
|
||||
if (row < 0) |
||||
return offset; |
||||
|
||||
offset = sqlda_common_total_size(res, row, compat, offset); |
||||
return offset; |
||||
} |
||||
|
||||
static long |
||||
sqlda_native_empty_size(const PGresult *res) |
||||
{ |
||||
long offset; |
||||
int sqld = PQnfields(res); |
||||
|
||||
/* Initial size to store main structure and field structures */ |
||||
offset = sizeof(struct sqlda_struct) + (sqld - 1) * sizeof(struct sqlvar_struct); |
||||
|
||||
/* Add padding to the first field value */ |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), 0, &offset, NULL); |
||||
|
||||
return offset; |
||||
} |
||||
|
||||
static long |
||||
sqlda_native_total_size(const PGresult *res, int row, enum COMPAT_MODE compat) |
||||
{ |
||||
long offset; |
||||
|
||||
offset = sqlda_native_empty_size(res); |
||||
|
||||
if (row < 0) |
||||
return offset; |
||||
|
||||
offset = sqlda_common_total_size(res, row, compat, offset); |
||||
return offset; |
||||
} |
||||
|
||||
/*
|
||||
* Build "struct sqlda_compat" (metadata only) from PGresult |
||||
* leaving enough space for the field values in |
||||
* the given row number |
||||
*/ |
||||
struct sqlda_compat * |
||||
ecpg_build_compat_sqlda(int line, PGresult *res, int row, enum COMPAT_MODE compat) |
||||
{ |
||||
struct sqlda_compat *sqlda; |
||||
struct sqlvar_compat *sqlvar; |
||||
char *fname; |
||||
long size; |
||||
int sqld; |
||||
int i; |
||||
|
||||
size = sqlda_compat_total_size(res, row, compat); |
||||
sqlda = (struct sqlda_compat *)ecpg_alloc(size, line); |
||||
if (!sqlda) |
||||
return NULL; |
||||
|
||||
memset(sqlda, 0, size); |
||||
sqlvar = (struct sqlvar_compat *)(sqlda + 1); |
||||
sqld = PQnfields(res); |
||||
fname = (char *)(sqlvar + sqld); |
||||
|
||||
sqlda->sqld = sqld; |
||||
ecpg_log("%s sqld = %d\n", __FUNCTION__, sqld); |
||||
sqlda->desc_occ = size; /* cheat here, keep the full allocated size */ |
||||
sqlda->sqlvar = sqlvar; |
||||
|
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
sqlda->sqlvar[i].sqltype = sqlda_dynamic_type(PQftype(res, i), compat); |
||||
strcpy(fname, PQfname(res, i)); |
||||
sqlda->sqlvar[i].sqlname = fname; |
||||
fname += strlen(sqlda->sqlvar[i].sqlname) + 1; |
||||
sqlda->sqlvar[i].sqlformat = (char *)(long)PQfformat(res, i); |
||||
sqlda->sqlvar[i].sqlxid = PQftype(res, i); |
||||
sqlda->sqlvar[i].sqltypelen = PQfsize(res, i); |
||||
} |
||||
|
||||
return sqlda; |
||||
} |
||||
|
||||
/*
|
||||
* Sets values from PGresult. |
||||
*/ |
||||
static int2 value_is_null = -1; |
||||
static int2 value_is_not_null = 0; |
||||
|
||||
void |
||||
ecpg_set_compat_sqlda(int lineno, struct sqlda_compat **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat) |
||||
{ |
||||
struct sqlda_compat *sqlda = (*_sqlda); |
||||
int i; |
||||
long offset, next_offset; |
||||
|
||||
if (row < 0) |
||||
return; |
||||
|
||||
/* Offset for the first field value */ |
||||
offset = sqlda_compat_empty_size(res); |
||||
|
||||
/*
|
||||
* Set sqlvar[i]->sqldata pointers and convert values to correct format |
||||
*/ |
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
int isnull; |
||||
int datalen; |
||||
bool set_data = true; |
||||
|
||||
switch (sqlda->sqlvar[i].sqltype) |
||||
{ |
||||
case ECPGt_short: |
||||
case ECPGt_unsigned_short: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(short), sizeof(short), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(short); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_int: |
||||
case ECPGt_unsigned_int: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(int), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(int); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_long: |
||||
case ECPGt_unsigned_long: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(long), sizeof(long), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(long); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_long_long: |
||||
case ECPGt_unsigned_long_long: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(long long), sizeof(long long), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(long long); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_bool: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(bool), sizeof(bool), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(bool); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_float: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(float), sizeof(float), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(float); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_double: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(double), sizeof(double), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(double); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_decimal: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(decimal), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(decimal); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_numeric: |
||||
{ |
||||
numeric *num; |
||||
char *val; |
||||
|
||||
set_data = false; |
||||
|
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(numeric), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(numeric); |
||||
ecpg_log("%s type %s offset1 %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
|
||||
if (PQgetisnull(res, row, i)) |
||||
{ |
||||
ECPGset_noind_null(ECPGt_numeric, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
} |
||||
|
||||
val = PQgetvalue(res, row, i); |
||||
num = PGTYPESnumeric_from_asc(val, NULL); |
||||
if (!num) |
||||
{ |
||||
ECPGset_noind_null(ECPGt_numeric, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
} |
||||
|
||||
memcpy(sqlda->sqlvar[i].sqldata, num, sizeof(numeric)); |
||||
|
||||
ecpg_sqlda_align_add_size(next_offset, sizeof(int), num->ndigits + 1, &offset, &next_offset); |
||||
memcpy((char *)sqlda + offset, num->buf, num->ndigits + 1); |
||||
ecpg_log("%s type %s offset2 %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
|
||||
((numeric *)sqlda->sqlvar[i].sqldata)->buf = (NumericDigit *)sqlda + offset; |
||||
((numeric *)sqlda->sqlvar[i].sqldata)->digits = (NumericDigit *)sqlda + offset + (num->digits - num->buf); |
||||
|
||||
PGTYPESnumeric_free(num); |
||||
|
||||
break; |
||||
} |
||||
case ECPGt_date: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(date), sizeof(date), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(date); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_timestamp: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(timestamp), sizeof(timestamp), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(timestamp); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_interval: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int64_t), sizeof(interval), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(interval); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_char: |
||||
case ECPGt_unsigned_char: |
||||
case ECPGt_string: |
||||
default: |
||||
datalen = strlen(PQgetvalue(res, row, i)) + 1; |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), datalen, &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = datalen; |
||||
if (datalen > 32768) |
||||
sqlda->sqlvar[i].sqlilongdata = sqlda->sqlvar[i].sqldata; |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
} |
||||
|
||||
isnull = PQgetisnull(res, row, i); |
||||
ecpg_log("%s row %d col %d %s\n", __FUNCTION__, row, i, isnull ? "IS NULL" : "IS NOT NULL"); |
||||
sqlda->sqlvar[i].sqlind = isnull ? &value_is_null : &value_is_not_null; |
||||
sqlda->sqlvar[i].sqlitype = ECPGt_short; |
||||
sqlda->sqlvar[i].sqlilen = sizeof(short); |
||||
if (!isnull) |
||||
{ |
||||
if (set_data) |
||||
ecpg_get_data(res, row, i, lineno, |
||||
sqlda->sqlvar[i].sqltype, ECPGt_NO_INDICATOR, |
||||
sqlda->sqlvar[i].sqldata, NULL, 0, 0, 0, |
||||
ECPG_ARRAY_NONE, compat, false); |
||||
} |
||||
else |
||||
ECPGset_noind_null(sqlda->sqlvar[i].sqltype, sqlda->sqlvar[i].sqldata); |
||||
|
||||
offset = next_offset; |
||||
} |
||||
} |
||||
|
||||
struct sqlda_struct * |
||||
ecpg_build_native_sqlda(int line, PGresult *res, int row, enum COMPAT_MODE compat) |
||||
{ |
||||
struct sqlda_struct *sqlda; |
||||
long size; |
||||
int i; |
||||
|
||||
size = sqlda_native_total_size(res, row, compat); |
||||
sqlda = (struct sqlda_struct *)ecpg_alloc(size, line); |
||||
if (!sqlda) |
||||
return NULL; |
||||
|
||||
memset(sqlda, 0, size); |
||||
|
||||
sprintf(sqlda->sqldaid, "SQLDA "); |
||||
sqlda->sqld = sqlda->sqln = PQnfields(res); |
||||
ecpg_log("%s sqld = %d\n", __FUNCTION__, sqlda->sqld); |
||||
sqlda->sqldabc = sizeof(struct sqlda_struct) + (sqlda->sqld - 1) * sizeof(struct sqlvar_struct); |
||||
|
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
char *fname; |
||||
|
||||
sqlda->sqlvar[i].sqltype = sqlda_dynamic_type(PQftype(res, i), compat); |
||||
fname = PQfname(res, i); |
||||
sqlda->sqlvar[i].sqlname.length = strlen(fname); |
||||
strcpy(sqlda->sqlvar[i].sqlname.data, fname); |
||||
} |
||||
|
||||
return sqlda; |
||||
} |
||||
|
||||
void |
||||
ecpg_set_native_sqlda(int lineno, struct sqlda_struct **_sqlda, const PGresult *res, int row, enum COMPAT_MODE compat) |
||||
{ |
||||
struct sqlda_struct *sqlda = (*_sqlda); |
||||
int i; |
||||
long offset, next_offset; |
||||
|
||||
if (row < 0) |
||||
return; |
||||
|
||||
/* Offset for the first field value */ |
||||
offset = sqlda_native_empty_size(res); |
||||
|
||||
/*
|
||||
* Set sqlvar[i]->sqldata pointers and convert values to correct format |
||||
*/ |
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
int isnull; |
||||
int datalen; |
||||
bool set_data = true; |
||||
|
||||
switch (sqlda->sqlvar[i].sqltype) |
||||
{ |
||||
case ECPGt_short: |
||||
case ECPGt_unsigned_short: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(short), sizeof(short), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(short); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_int: |
||||
case ECPGt_unsigned_int: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(int), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(int); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_long: |
||||
case ECPGt_unsigned_long: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(long), sizeof(long), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(long); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_long_long: |
||||
case ECPGt_unsigned_long_long: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(long long), sizeof(long long), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(long long); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_bool: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(bool), sizeof(bool), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(bool); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_float: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(float), sizeof(float), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(float); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_double: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(double), sizeof(double), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(double); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_decimal: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(decimal), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(decimal); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_numeric: |
||||
{ |
||||
numeric *num; |
||||
char *val; |
||||
|
||||
set_data = false; |
||||
|
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), sizeof(numeric), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(numeric); |
||||
ecpg_log("%s type %s offset1 %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
|
||||
if (PQgetisnull(res, row, i)) |
||||
{ |
||||
ECPGset_noind_null(ECPGt_numeric, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
} |
||||
|
||||
val = PQgetvalue(res, row, i); |
||||
num = PGTYPESnumeric_from_asc(val, NULL); |
||||
if (!num) |
||||
{ |
||||
ECPGset_noind_null(ECPGt_numeric, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
} |
||||
|
||||
memcpy(sqlda->sqlvar[i].sqldata, num, sizeof(numeric)); |
||||
|
||||
ecpg_sqlda_align_add_size(next_offset, sizeof(int), num->ndigits + 1, &offset, &next_offset); |
||||
memcpy((char *)sqlda + offset, num->buf, num->ndigits + 1); |
||||
ecpg_log("%s type %s offset2 %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
|
||||
((numeric *)sqlda->sqlvar[i].sqldata)->buf = (NumericDigit *)sqlda + offset; |
||||
((numeric *)sqlda->sqlvar[i].sqldata)->digits = (NumericDigit *)sqlda + offset + (num->digits - num->buf); |
||||
|
||||
PGTYPESnumeric_free(num); |
||||
|
||||
break; |
||||
} |
||||
case ECPGt_date: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(date), sizeof(date), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(date); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_timestamp: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(timestamp), sizeof(timestamp), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(timestamp); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_interval: |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int64_t), sizeof(interval), &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = sizeof(interval); |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
case ECPGt_char: |
||||
case ECPGt_unsigned_char: |
||||
case ECPGt_string: |
||||
default: |
||||
datalen = strlen(PQgetvalue(res, row, i)) + 1; |
||||
ecpg_sqlda_align_add_size(offset, sizeof(int), datalen, &offset, &next_offset); |
||||
sqlda->sqlvar[i].sqldata = (char *)sqlda + offset; |
||||
sqlda->sqlvar[i].sqllen = datalen; |
||||
ecpg_log("%s type %s offset %d\n", __FUNCTION__, ecpg_type_name(sqlda->sqlvar[i].sqltype), offset); |
||||
break; |
||||
} |
||||
|
||||
isnull = PQgetisnull(res, row, i); |
||||
ecpg_log("%s row %d col %d %s\n", __FUNCTION__, row, i, isnull ? "IS NULL" : "IS NOT NULL"); |
||||
sqlda->sqlvar[i].sqlind = isnull ? &value_is_null : &value_is_not_null; |
||||
if (!isnull) |
||||
{ |
||||
if (set_data) |
||||
ecpg_get_data(res, row, i, lineno, |
||||
sqlda->sqlvar[i].sqltype, ECPGt_NO_INDICATOR, |
||||
sqlda->sqlvar[i].sqldata, NULL, 0, 0, 0, |
||||
ECPG_ARRAY_NONE, compat, false); |
||||
} |
||||
|
||||
offset = next_offset; |
||||
} |
||||
} |
@ -0,0 +1,47 @@ |
||||
/*
|
||||
* pgsql/src/interfaces/ecpg/include/sqlda-infx-compat.h |
||||
*/ |
||||
|
||||
#ifndef ECPG_SQLDA_COMPAT_H |
||||
#define ECPG_SQLDA_COMPAT_H |
||||
|
||||
struct sqlvar_compat |
||||
{ |
||||
short sqltype; /* variable type */ |
||||
int sqllen; /* length in bytes */ |
||||
char *sqldata; /* pointer to data */ |
||||
short *sqlind; /* pointer to indicator */ |
||||
char *sqlname; /* variable name */ |
||||
char *sqlformat; /* reserved for future use */ |
||||
short sqlitype; /* ind variable type */ |
||||
short sqlilen; /* ind length in bytes */ |
||||
char *sqlidata; /* ind data pointer */ |
||||
int sqlxid; /* extended id type */ |
||||
char *sqltypename; /* extended type name */ |
||||
short sqltypelen; /* length of extended type name */ |
||||
short sqlownerlen; /* length of owner name */ |
||||
short sqlsourcetype; /* source type for distinct of built-ins */ |
||||
char *sqlownername; /* owner name */ |
||||
int sqlsourceid; /* extended id of source type */ |
||||
|
||||
/*
|
||||
* sqlilongdata is new. It supports data that exceeds the 32k |
||||
* limit. sqlilen and sqlidata are for backward compatibility |
||||
* and they have maximum value of <32K. |
||||
*/ |
||||
char *sqlilongdata; /* for data field beyond 32K */ |
||||
int sqlflags; /* for internal use only */ |
||||
void *sqlreserved; /* reserved for future use */ |
||||
}; |
||||
|
||||
struct sqlda_compat |
||||
{ |
||||
short sqld; |
||||
struct sqlvar_compat *sqlvar; |
||||
char desc_name[19]; /* descriptor name */ |
||||
short desc_occ; /* size of sqlda structure */ |
||||
struct sqlda_compat *desc_next; /* pointer to next sqlda struct */ |
||||
void *reserved; /* reserved for future use */ |
||||
}; |
||||
|
||||
#endif /* ECPG_SQLDA_COMPAT_H */ |
@ -0,0 +1,35 @@ |
||||
/*
|
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/sqlda-native.h,v 1.1 2010/01/05 16:38:23 meskes Exp $ |
||||
*/ |
||||
|
||||
#ifndef ECPG_SQLDA_NATIVE_H |
||||
#define ECPG_SQLDA_NATIVE_H |
||||
|
||||
#include "postgres_fe.h" |
||||
|
||||
struct sqlname |
||||
{ |
||||
short length; |
||||
char data[NAMEDATALEN]; |
||||
}; |
||||
|
||||
struct sqlvar_struct |
||||
{ |
||||
short sqltype; |
||||
short sqllen; |
||||
char *sqldata; |
||||
short *sqlind; |
||||
struct sqlname sqlname; |
||||
}; |
||||
|
||||
struct sqlda_struct |
||||
{ |
||||
char sqldaid[8]; |
||||
long sqldabc; |
||||
short sqln; |
||||
short sqld; |
||||
struct sqlda_struct *desc_next; |
||||
struct sqlvar_struct sqlvar[1]; |
||||
}; |
||||
|
||||
#endif /* ECPG_SQLDA_NATIVE_H */ |
@ -1,3 +1,22 @@ |
||||
/*
|
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/sqlda.h,v 1.4 2009/06/11 14:49:13 momjian Exp $ |
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/include/sqlda.h,v 1.5 2010/01/05 16:38:23 meskes Exp $ |
||||
*/ |
||||
|
||||
#ifndef ECPG_SQLDA_H |
||||
#define ECPG_SQLDA_H |
||||
|
||||
#ifdef _ECPG_INFORMIX_H |
||||
|
||||
#include "sqlda-compat.h" |
||||
typedef struct sqlvar_compat sqlvar_t; |
||||
typedef struct sqlda_compat sqlda_t; |
||||
|
||||
#else |
||||
|
||||
#include "sqlda-native.h" |
||||
typedef struct sqlvar_struct sqlvar_t; |
||||
typedef struct sqlda_struct sqlda_t; |
||||
|
||||
#endif |
||||
|
||||
#endif /* ECPG_SQLDA_H */ |
||||
|
@ -0,0 +1,254 @@ |
||||
#include <stdlib.h> |
||||
#include <string.h> |
||||
#include <inttypes.h> |
||||
|
||||
exec sql include ../regression; |
||||
|
||||
exec sql include sqlda.h; |
||||
exec sql include sqltypes.h; |
||||
|
||||
exec sql whenever sqlerror stop; |
||||
|
||||
/* These shouldn't be under DECLARE SECTION */ |
||||
sqlda_t *inp_sqlda, *outp_sqlda; |
||||
|
||||
static void |
||||
dump_sqlda(sqlda_t *sqlda) |
||||
{ |
||||
int i; |
||||
|
||||
if (sqlda == NULL) |
||||
{ |
||||
printf("dump_sqlda called with NULL sqlda\n"); |
||||
return; |
||||
} |
||||
|
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
if (sqlda->sqlvar[i].sqlind && *(sqlda->sqlvar[i].sqlind) == -1) |
||||
printf("name sqlda descriptor: '%s' value NULL'\n", sqlda->sqlvar[i].sqlname); |
||||
else |
||||
switch (sqlda->sqlvar[i].sqltype) |
||||
{ |
||||
case SQLCHAR: |
||||
printf("name sqlda descriptor: '%s' value '%s'\n", sqlda->sqlvar[i].sqlname, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLINT: |
||||
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLINT8: |
||||
printf("name sqlda descriptor: '%s' value %" PRId64 "\n", sqlda->sqlvar[i].sqlname, *(int64_t *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLFLOAT: |
||||
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLDECIMAL: |
||||
{ |
||||
char val[64]; |
||||
dectoasc((dec_t *)sqlda->sqlvar[i].sqldata, val, 64, -1); |
||||
printf("name sqlda descriptor: '%s' value DECIMAL '%s'\n", sqlda->sqlvar[i].sqlname, val); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
int |
||||
main (void) |
||||
{ |
||||
exec sql begin declare section; |
||||
char *stmt1 = "SELECT * FROM t1"; |
||||
char *stmt2 = "SELECT * FROM t1 WHERE id = ?"; |
||||
int rec; |
||||
int id; |
||||
exec sql end declare section; |
||||
|
||||
char msg[128]; |
||||
|
||||
ECPGdebug(1, stderr); |
||||
|
||||
strcpy(msg, "connect"); |
||||
exec sql connect to REGRESSDB1 as regress1; |
||||
|
||||
strcpy(msg, "set"); |
||||
exec sql set datestyle to iso; |
||||
|
||||
strcpy(msg, "create"); |
||||
exec sql create table t1( |
||||
id integer, |
||||
t text, |
||||
d1 numeric, |
||||
d2 float8, |
||||
c char(10)); |
||||
|
||||
strcpy(msg, "insert"); |
||||
exec sql insert into t1 values |
||||
(1, 'a', 1.0, 1, 'a'), |
||||
(2, null, null, null, null), |
||||
(3, '"c"', -3, 'nan'::float8, 'c'), |
||||
(4, 'd', 4.0, 4, 'd'); |
||||
|
||||
strcpy(msg, "commit"); |
||||
exec sql commit; |
||||
|
||||
/* SQLDA test for getting all records from a table */ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql prepare st_id1 from :stmt1; |
||||
|
||||
strcpy(msg, "declare"); |
||||
exec sql declare mycur1 cursor for st_id1; |
||||
|
||||
strcpy(msg, "open"); |
||||
exec sql open mycur1; |
||||
|
||||
exec sql whenever not found do break; |
||||
|
||||
rec = 0; |
||||
while (1) |
||||
{ |
||||
strcpy(msg, "fetch"); |
||||
exec sql fetch 1 from mycur1 into descriptor outp_sqlda; |
||||
|
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda); |
||||
} |
||||
|
||||
exec sql whenever not found continue; |
||||
|
||||
strcpy(msg, "close"); |
||||
exec sql close mycur1; |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id1; |
||||
|
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting all records from a table |
||||
using the Informix-specific FETCH ... USING DESCRIPTOR |
||||
*/ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql prepare st_id2 from :stmt1; |
||||
|
||||
strcpy(msg, "declare"); |
||||
exec sql declare mycur2 cursor for st_id2; |
||||
|
||||
strcpy(msg, "open"); |
||||
exec sql open mycur2; |
||||
|
||||
exec sql whenever not found do break; |
||||
|
||||
rec = 0; |
||||
while (1) |
||||
{ |
||||
strcpy(msg, "fetch"); |
||||
exec sql fetch from mycur2 using descriptor outp_sqlda; |
||||
|
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda); |
||||
} |
||||
|
||||
exec sql whenever not found continue; |
||||
|
||||
strcpy(msg, "close"); |
||||
exec sql close mycur2; |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id2; |
||||
|
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting one record using an input descriptor */ |
||||
|
||||
/* Input sqlda has to be built manually */ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqld = 1; |
||||
inp_sqlda->sqlvar = malloc(sizeof(sqlvar_t)); |
||||
memset(inp_sqlda->sqlvar, 0, sizeof(sqlvar_t)); |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = SQLINT; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql prepare st_id3 FROM :stmt2; |
||||
|
||||
strcpy(msg, "execute"); |
||||
exec sql execute st_id3 using descriptor inp_sqlda into descriptor outp_sqlda; |
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id3; |
||||
|
||||
free(inp_sqlda->sqlvar); |
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting one record using an input descriptor |
||||
* on a named connection |
||||
*/ |
||||
|
||||
exec sql connect to REGRESSDB1 as con2; |
||||
|
||||
/* Input sqlda has to be built manually */ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqld = 1; |
||||
inp_sqlda->sqlvar = malloc(sizeof(sqlvar_t)); |
||||
memset(inp_sqlda->sqlvar, 0, sizeof(sqlvar_t)); |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = SQLINT; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql at con2 prepare st_id4 FROM :stmt2; |
||||
|
||||
strcpy(msg, "execute"); |
||||
exec sql at con2 execute st_id4 using descriptor inp_sqlda into descriptor outp_sqlda; |
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "commit"); |
||||
exec sql at con2 commit; |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id4; |
||||
|
||||
free(inp_sqlda->sqlvar); |
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
strcpy(msg, "disconnect"); |
||||
exec sql disconnect con2; |
||||
|
||||
/* End test */ |
||||
|
||||
strcpy(msg, "drop"); |
||||
exec sql drop table t1; |
||||
|
||||
strcpy(msg, "commit"); |
||||
exec sql commit; |
||||
|
||||
strcpy(msg, "disconnect"); |
||||
exec sql disconnect; |
||||
|
||||
return (0); |
||||
} |
@ -0,0 +1,540 @@ |
||||
/* Processed by ecpg (regression mode) */ |
||||
/* These include files are added by the preprocessor */ |
||||
#include <ecpglib.h> |
||||
#include <ecpgerrno.h> |
||||
#include <sqlca.h> |
||||
/* Needed for informix compatibility */ |
||||
#include <ecpg_informix.h> |
||||
/* End of automatic include section */ |
||||
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y)) |
||||
|
||||
#line 1 "sqlda.pgc" |
||||
#include <stdlib.h> |
||||
#include <string.h> |
||||
#include <inttypes.h> |
||||
|
||||
|
||||
#line 1 "regression.h" |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 5 "sqlda.pgc" |
||||
|
||||
|
||||
|
||||
#line 1 "sqlda.h" |
||||
/*
|
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c,v 1.1 2010/01/05 16:38:23 meskes Exp $ |
||||
*/ |
||||
|
||||
#ifndef ECPG_SQLDA_H |
||||
#define ECPG_SQLDA_H |
||||
|
||||
#ifdef _ECPG_INFORMIX_H |
||||
|
||||
#include "sqlda-compat.h" |
||||
typedef struct sqlvar_compat sqlvar_t; |
||||
typedef struct sqlda_compat sqlda_t; |
||||
|
||||
#else |
||||
|
||||
#include "sqlda-native.h" |
||||
typedef struct sqlvar_struct sqlvar_t; |
||||
typedef struct sqlda_struct sqlda_t; |
||||
|
||||
#endif |
||||
|
||||
#endif /* ECPG_SQLDA_H */ |
||||
|
||||
#line 7 "sqlda.pgc" |
||||
|
||||
|
||||
#line 1 "sqltypes.h" |
||||
/*
|
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c,v 1.1 2010/01/05 16:38:23 meskes Exp $ |
||||
*/ |
||||
#ifndef ECPG_SQLTYPES_H |
||||
#define ECPG_SQLTYPES_H |
||||
|
||||
#include <limits.h> |
||||
|
||||
#define CCHARTYPE ECPGt_char |
||||
#define CSHORTTYPE ECPGt_short |
||||
#define CINTTYPE ECPGt_int |
||||
#define CLONGTYPE ECPGt_long |
||||
#define CFLOATTYPE ECPGt_float |
||||
#define CDOUBLETYPE ECPGt_double |
||||
#define CDECIMALTYPE ECPGt_decimal |
||||
#define CFIXCHARTYPE 108 |
||||
#define CSTRINGTYPE ECPGt_char |
||||
#define CDATETYPE ECPGt_date |
||||
#define CMONEYTYPE 111 |
||||
#define CDTIMETYPE ECPGt_timestamp |
||||
#define CLOCATORTYPE 113 |
||||
#define CVCHARTYPE ECPGt_varchar |
||||
#define CINVTYPE 115 |
||||
#define CFILETYPE 116 |
||||
#define CINT8TYPE ECPGt_long_long |
||||
#define CCOLLTYPE 118 |
||||
#define CLVCHARTYPE 119 |
||||
#define CFIXBINTYPE 120 |
||||
#define CVARBINTYPE 121 |
||||
#define CBOOLTYPE ECPGt_bool |
||||
#define CROWTYPE 123 |
||||
#define CLVCHARPTRTYPE 124 |
||||
#define CTYPEMAX 25 |
||||
|
||||
/*
|
||||
* Values used in sqlda->sqlvar[i]->sqltype |
||||
*/ |
||||
#define SQLCHAR ECPGt_char |
||||
#define SQLSMINT ECPGt_short |
||||
#define SQLINT ECPGt_int |
||||
#define SQLFLOAT ECPGt_double |
||||
#define SQLSMFLOAT ECPGt_float |
||||
#define SQLDECIMAL ECPGt_decimal |
||||
#define SQLSERIAL ECPGt_int |
||||
#define SQLDATE ECPGt_date |
||||
#define SQLDTIME ECPGt_timestamp |
||||
#define SQLTEXT ECPGt_char |
||||
#define SQLVCHAR ECPGt_char |
||||
#define SQLINTERVAL ECPGt_interval |
||||
#define SQLNCHAR ECPGt_char |
||||
#define SQLNVCHAR ECPGt_char |
||||
#ifdef HAVE_LONG_LONG_INT_64 |
||||
#define SQLINT8 ECPGt_long_long |
||||
#define SQLSERIAL8 ECPGt_long_long |
||||
#else |
||||
#define SQLINT8 ECPGt_long |
||||
#define SQLSERIAL8 ECPGt_long |
||||
#endif |
||||
|
||||
#endif /* ndef ECPG_SQLTYPES_H */ |
||||
|
||||
#line 8 "sqlda.pgc" |
||||
|
||||
|
||||
/* exec sql whenever sqlerror stop ; */ |
||||
#line 10 "sqlda.pgc" |
||||
|
||||
|
||||
/* These shouldn't be under DECLARE SECTION */ |
||||
sqlda_t *inp_sqlda, *outp_sqlda; |
||||
|
||||
static void |
||||
dump_sqlda(sqlda_t *sqlda) |
||||
{ |
||||
int i; |
||||
|
||||
if (sqlda == NULL) |
||||
{ |
||||
printf("dump_sqlda called with NULL sqlda\n"); |
||||
return; |
||||
} |
||||
|
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
if (sqlda->sqlvar[i].sqlind && *(sqlda->sqlvar[i].sqlind) == -1) |
||||
printf("name sqlda descriptor: '%s' value NULL'\n", sqlda->sqlvar[i].sqlname); |
||||
else |
||||
switch (sqlda->sqlvar[i].sqltype) |
||||
{ |
||||
case SQLCHAR: |
||||
printf("name sqlda descriptor: '%s' value '%s'\n", sqlda->sqlvar[i].sqlname, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLINT: |
||||
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLINT8: |
||||
printf("name sqlda descriptor: '%s' value %" PRId64 "\n", sqlda->sqlvar[i].sqlname, *(int64_t *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLFLOAT: |
||||
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case SQLDECIMAL: |
||||
{ |
||||
char val[64]; |
||||
dectoasc((decimal *)sqlda->sqlvar[i].sqldata, val, 64, -1); |
||||
printf("name sqlda descriptor: '%s' value DECIMAL '%s'\n", sqlda->sqlvar[i].sqlname, val); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
int |
||||
main (void) |
||||
{ |
||||
/* exec sql begin declare section */ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 60 "sqlda.pgc" |
||||
char * stmt1 = "SELECT * FROM t1" ; |
||||
|
||||
#line 61 "sqlda.pgc" |
||||
char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ; |
||||
|
||||
#line 62 "sqlda.pgc" |
||||
int rec ; |
||||
|
||||
#line 63 "sqlda.pgc" |
||||
int id ; |
||||
/* exec sql end declare section */ |
||||
#line 64 "sqlda.pgc" |
||||
|
||||
|
||||
char msg[128]; |
||||
|
||||
ECPGdebug(1, stderr); |
||||
|
||||
strcpy(msg, "connect"); |
||||
{ ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "regress1", 0);
|
||||
#line 71 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 71 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "set"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 74 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 74 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "create"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) )", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 82 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 82 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "insert"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '\"c\"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' )", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 89 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 89 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "commit"); |
||||
{ ECPGtrans(__LINE__, NULL, "commit"); |
||||
#line 92 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 92 "sqlda.pgc" |
||||
|
||||
|
||||
/* SQLDA test for getting all records from a table */ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1); |
||||
#line 99 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 99 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "declare"); |
||||
ECPG_informix_reset_sqlca(); /* declare mycur1 cursor for $1 */ |
||||
#line 102 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "open"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1",
|
||||
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); |
||||
#line 105 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 105 "sqlda.pgc" |
||||
|
||||
|
||||
/* exec sql whenever not found break ; */ |
||||
#line 107 "sqlda.pgc" |
||||
|
||||
|
||||
rec = 0; |
||||
while (1) |
||||
{ |
||||
strcpy(msg, "fetch"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 113 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode == ECPG_NOT_FOUND) break; |
||||
#line 113 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 113 "sqlda.pgc" |
||||
|
||||
|
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda); |
||||
} |
||||
|
||||
/* exec sql whenever not found continue ; */ |
||||
#line 119 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "close"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 122 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 122 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id1"); |
||||
#line 125 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 125 "sqlda.pgc" |
||||
|
||||
|
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting all records from a table
|
||||
using the Informix-specific FETCH ... USING DESCRIPTOR |
||||
*/ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1); |
||||
#line 136 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 136 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "declare"); |
||||
ECPG_informix_reset_sqlca(); /* declare mycur2 cursor for $1 */ |
||||
#line 139 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "open"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1",
|
||||
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); |
||||
#line 142 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 142 "sqlda.pgc" |
||||
|
||||
|
||||
/* exec sql whenever not found break ; */ |
||||
#line 144 "sqlda.pgc" |
||||
|
||||
|
||||
rec = 0; |
||||
while (1) |
||||
{ |
||||
strcpy(msg, "fetch"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch from mycur2", ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 150 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode == ECPG_NOT_FOUND) break; |
||||
#line 150 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 150 "sqlda.pgc" |
||||
|
||||
|
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda); |
||||
} |
||||
|
||||
/* exec sql whenever not found continue ; */ |
||||
#line 156 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "close"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 159 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 159 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id2"); |
||||
#line 162 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 162 "sqlda.pgc" |
||||
|
||||
|
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting one record using an input descriptor */ |
||||
|
||||
/* Input sqlda has to be built manually */ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqld = 1; |
||||
inp_sqlda->sqlvar = malloc(sizeof(sqlvar_t)); |
||||
memset(inp_sqlda->sqlvar, 0, sizeof(sqlvar_t)); |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = SQLINT; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2); |
||||
#line 185 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 185 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "execute"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_execute, "st_id3",
|
||||
ECPGt_sqlda, &inp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 188 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 188 "sqlda.pgc" |
||||
|
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id3"); |
||||
#line 193 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 193 "sqlda.pgc" |
||||
|
||||
|
||||
free(inp_sqlda->sqlvar); |
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting one record using an input descriptor
|
||||
* on a named connection |
||||
*/ |
||||
|
||||
{ ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "con2", 0);
|
||||
#line 203 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 203 "sqlda.pgc" |
||||
|
||||
|
||||
/* Input sqlda has to be built manually */ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqld = 1; |
||||
inp_sqlda->sqlvar = malloc(sizeof(sqlvar_t)); |
||||
memset(inp_sqlda->sqlvar, 0, sizeof(sqlvar_t)); |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = SQLINT; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2); |
||||
#line 222 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 222 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "execute"); |
||||
{ ECPGdo(__LINE__, 1, 1, "con2", 0, ECPGst_execute, "st_id4",
|
||||
ECPGt_sqlda, &inp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 225 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 225 "sqlda.pgc" |
||||
|
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "commit"); |
||||
{ ECPGtrans(__LINE__, "con2", "commit"); |
||||
#line 230 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 230 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id4"); |
||||
#line 233 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 233 "sqlda.pgc" |
||||
|
||||
|
||||
free(inp_sqlda->sqlvar); |
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
strcpy(msg, "disconnect"); |
||||
{ ECPGdisconnect(__LINE__, "con2"); |
||||
#line 240 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 240 "sqlda.pgc" |
||||
|
||||
|
||||
/* End test */ |
||||
|
||||
strcpy(msg, "drop"); |
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 245 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 245 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "commit"); |
||||
{ ECPGtrans(__LINE__, NULL, "commit"); |
||||
#line 248 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 248 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "disconnect"); |
||||
{ ECPGdisconnect(__LINE__, "CURRENT"); |
||||
#line 251 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 251 "sqlda.pgc" |
||||
|
||||
|
||||
return (0); |
||||
} |
@ -0,0 +1,604 @@ |
||||
[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]: ecpg_execute on line 74: query: set datestyle to iso; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 74: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 74: OK: SET |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 77: query: create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) ); with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 77: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 77: OK: CREATE TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 85: query: insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '"c"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' ); with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 85: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 85: OK: INSERT 0 4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans on line 92: action "commit"; connection "regress1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGprepare on line 99: name st_id1; query: "SELECT * FROM t1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 105: query: declare mycur1 cursor for SELECT * FROM t1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 105: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 105: OK: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 1.0 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 2 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 3 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: "c" offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: -3 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: NaN offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: c offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 4.0 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 113: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 113: correctly got 0 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: raising sqlcode 100 on line 113: no data found on line 113 |
||||
[NO_PID]: sqlca: code: 100, state: 02000 |
||||
[NO_PID]: ecpg_execute on line 122: query: close mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 122: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 122: OK: CLOSE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 125: name st_id1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGprepare on line 136: name st_id2; query: "SELECT * FROM t1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 142: query: declare mycur2 cursor for SELECT * FROM t1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 142: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 142: OK: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: query: fetch from mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 1.0 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: query: fetch from mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 2 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: query: fetch from mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 3 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: "c" offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: -3 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: NaN offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: c offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: query: fetch from mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 4.0 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: query: fetch from mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: correctly got 0 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: raising sqlcode 100 on line 150: no data found on line 150 |
||||
[NO_PID]: sqlca: code: 100, state: 02000 |
||||
[NO_PID]: ecpg_execute on line 159: query: close mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 159: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 159: OK: CLOSE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 162: name st_id2 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGprepare on line 185: name st_id3; query: "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 188: query: SELECT * FROM t1 WHERE id = $1; with 1 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 188: using PQexecPrepared for "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: free_params on line 188: parameter 1 = 4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 188: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 188: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 188: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 188: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 188: RESULT: 4.0 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 188: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 188: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 188: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 193: name st_id3 |
||||
[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]: ECPGprepare on line 222: name st_id4; query: "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 225: query: SELECT * FROM t1 WHERE id = $1; with 1 parameter(s) on connection con2 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 225: using PQexecPrepared for "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: free_params on line 225: parameter 1 = 4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 225: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_compat_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 225: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type int offset 672 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 225: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 676 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 225: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type decimal offset 680 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 225: RESULT: 4.0 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type double offset 736 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 225: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda type char offset 744 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_compat_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 225: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 225: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans on line 230: action "commit"; connection "con2" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 233: name st_id4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: connection con2 closed |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 245: query: drop table t1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 245: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 245: OK: DROP TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans on line 248: action "commit"; connection "regress1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: connection regress1 closed |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
@ -0,0 +1,60 @@ |
||||
FETCH RECORD 1 |
||||
name sqlda descriptor: 'id' value 1 |
||||
name sqlda descriptor: 't' value 'a' |
||||
name sqlda descriptor: 'd1' value DECIMAL '1.0' |
||||
name sqlda descriptor: 'd2' value 1.000000 |
||||
name sqlda descriptor: 'c' value 'a ' |
||||
FETCH RECORD 2 |
||||
name sqlda descriptor: 'id' value 2 |
||||
name sqlda descriptor: 't' value NULL' |
||||
name sqlda descriptor: 'd1' value NULL' |
||||
name sqlda descriptor: 'd2' value NULL' |
||||
name sqlda descriptor: 'c' value NULL' |
||||
FETCH RECORD 3 |
||||
name sqlda descriptor: 'id' value 3 |
||||
name sqlda descriptor: 't' value '"c"' |
||||
name sqlda descriptor: 'd1' value DECIMAL '-3' |
||||
name sqlda descriptor: 'd2' value nan |
||||
name sqlda descriptor: 'c' value 'c ' |
||||
FETCH RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value DECIMAL '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
||||
FETCH RECORD 1 |
||||
name sqlda descriptor: 'id' value 1 |
||||
name sqlda descriptor: 't' value 'a' |
||||
name sqlda descriptor: 'd1' value DECIMAL '1.0' |
||||
name sqlda descriptor: 'd2' value 1.000000 |
||||
name sqlda descriptor: 'c' value 'a ' |
||||
FETCH RECORD 2 |
||||
name sqlda descriptor: 'id' value 2 |
||||
name sqlda descriptor: 't' value NULL' |
||||
name sqlda descriptor: 'd1' value NULL' |
||||
name sqlda descriptor: 'd2' value NULL' |
||||
name sqlda descriptor: 'c' value NULL' |
||||
FETCH RECORD 3 |
||||
name sqlda descriptor: 'id' value 3 |
||||
name sqlda descriptor: 't' value '"c"' |
||||
name sqlda descriptor: 'd1' value DECIMAL '-3' |
||||
name sqlda descriptor: 'd2' value nan |
||||
name sqlda descriptor: 'c' value 'c ' |
||||
FETCH RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value DECIMAL '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
||||
EXECUTE RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value DECIMAL '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
||||
EXECUTE RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value DECIMAL '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
@ -0,0 +1,544 @@ |
||||
/* Processed by ecpg (regression mode) */ |
||||
/* These include files are added by the preprocessor */ |
||||
#include <ecpglib.h> |
||||
#include <ecpgerrno.h> |
||||
#include <sqlca.h> |
||||
/* End of automatic include section */ |
||||
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y)) |
||||
|
||||
#line 1 "sqlda.pgc" |
||||
#include <stdlib.h> |
||||
#include <string.h> |
||||
#include <inttypes.h> |
||||
#include <limits.h> |
||||
|
||||
|
||||
#line 1 "regression.h" |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 6 "sqlda.pgc" |
||||
|
||||
|
||||
|
||||
#line 1 "sqlda.h" |
||||
/*
|
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c,v 1.1 2010/01/05 16:38:23 meskes Exp $ |
||||
*/ |
||||
|
||||
#ifndef ECPG_SQLDA_H |
||||
#define ECPG_SQLDA_H |
||||
|
||||
#ifdef _ECPG_INFORMIX_H |
||||
|
||||
#include "sqlda-compat.h" |
||||
typedef struct sqlvar_compat sqlvar_t; |
||||
typedef struct sqlda_compat sqlda_t; |
||||
|
||||
#else |
||||
|
||||
#include "sqlda-native.h" |
||||
typedef struct sqlvar_struct sqlvar_t; |
||||
typedef struct sqlda_struct sqlda_t; |
||||
|
||||
#endif |
||||
|
||||
#endif /* ECPG_SQLDA_H */ |
||||
|
||||
#line 8 "sqlda.pgc" |
||||
|
||||
|
||||
#line 1 "pgtypes_numeric.h" |
||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/test/expected/sql-sqlda.c,v 1.1 2010/01/05 16:38:23 meskes Exp $ */ |
||||
|
||||
#ifndef PGTYPES_NUMERIC |
||||
#define PGTYPES_NUMERIC |
||||
|
||||
#define NUMERIC_POS 0x0000 |
||||
#define NUMERIC_NEG 0x4000 |
||||
#define NUMERIC_NAN 0xC000 |
||||
#define NUMERIC_MAX_PRECISION 1000 |
||||
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION |
||||
#define NUMERIC_MIN_DISPLAY_SCALE 0 |
||||
#define NUMERIC_MIN_SIG_DIGITS 16 |
||||
|
||||
#define DECSIZE 30 |
||||
|
||||
typedef unsigned char NumericDigit; |
||||
typedef struct |
||||
{ |
||||
int ndigits; /* number of digits in digits[] - can be 0! */ |
||||
int weight; /* weight of first digit */ |
||||
int rscale; /* result scale */ |
||||
int dscale; /* display scale */ |
||||
int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */ |
||||
NumericDigit *buf; /* start of alloc'd space for digits[] */ |
||||
NumericDigit *digits; /* decimal digits */ |
||||
} numeric; |
||||
|
||||
typedef struct |
||||
{ |
||||
int ndigits; /* number of digits in digits[] - can be 0! */ |
||||
int weight; /* weight of first digit */ |
||||
int rscale; /* result scale */ |
||||
int dscale; /* display scale */ |
||||
int sign; /* NUMERIC_POS, NUMERIC_NEG, or NUMERIC_NAN */ |
||||
NumericDigit digits[DECSIZE]; /* decimal digits */ |
||||
} decimal; |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" |
||||
{ |
||||
#endif |
||||
|
||||
numeric *PGTYPESnumeric_new(void); |
||||
decimal *PGTYPESdecimal_new(void); |
||||
void PGTYPESnumeric_free(numeric *); |
||||
void PGTYPESdecimal_free(decimal *); |
||||
numeric *PGTYPESnumeric_from_asc(char *, char **); |
||||
char *PGTYPESnumeric_to_asc(numeric *, int); |
||||
int PGTYPESnumeric_add(numeric *, numeric *, numeric *); |
||||
int PGTYPESnumeric_sub(numeric *, numeric *, numeric *); |
||||
int PGTYPESnumeric_mul(numeric *, numeric *, numeric *); |
||||
int PGTYPESnumeric_div(numeric *, numeric *, numeric *); |
||||
int PGTYPESnumeric_cmp(numeric *, numeric *); |
||||
int PGTYPESnumeric_from_int(signed int, numeric *); |
||||
int PGTYPESnumeric_from_long(signed long int, numeric *); |
||||
int PGTYPESnumeric_copy(numeric *, numeric *); |
||||
int PGTYPESnumeric_from_double(double, numeric *); |
||||
int PGTYPESnumeric_to_double(numeric *, double *); |
||||
int PGTYPESnumeric_to_int(numeric *, int *); |
||||
int PGTYPESnumeric_to_long(numeric *, long *); |
||||
int PGTYPESnumeric_to_decimal(numeric *, decimal *); |
||||
int PGTYPESnumeric_from_decimal(decimal *, numeric *); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* PGTYPES_NUMERIC */ |
||||
|
||||
#line 9 "sqlda.pgc" |
||||
|
||||
|
||||
/* exec sql whenever sqlerror stop ; */ |
||||
#line 11 "sqlda.pgc" |
||||
|
||||
|
||||
/* These shouldn't be under DECLARE SECTION */ |
||||
sqlda_t *inp_sqlda, *outp_sqlda, *outp_sqlda1; |
||||
|
||||
static void |
||||
dump_sqlda(sqlda_t *sqlda) |
||||
{ |
||||
int i; |
||||
|
||||
if (sqlda == NULL) |
||||
{ |
||||
printf("dump_sqlda called with NULL sqlda\n"); |
||||
return; |
||||
} |
||||
|
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
if (sqlda->sqlvar[i].sqlind && *(sqlda->sqlvar[i].sqlind) == -1) |
||||
printf("name sqlda descriptor: '%s' value NULL'\n", sqlda->sqlvar[i].sqlname.data); |
||||
else |
||||
switch (sqlda->sqlvar[i].sqltype) |
||||
{ |
||||
case ECPGt_char: |
||||
printf("name sqlda descriptor: '%s' value '%s'\n", sqlda->sqlvar[i].sqlname.data, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case ECPGt_int: |
||||
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname.data, *(int *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
#ifdef HAVE_LONG_LONG_INT_64 |
||||
case ECPGt_long_long: |
||||
#else |
||||
case ECPGt_long: |
||||
#endif |
||||
printf("name sqlda descriptor: '%s' value " INT64_FORMAT "\n", sqlda->sqlvar[i].sqlname.data, *(int64_t *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case ECPGt_double: |
||||
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case ECPGt_numeric: |
||||
{ |
||||
char *val; |
||||
|
||||
val = PGTYPESnumeric_to_asc((numeric*)sqlda->sqlvar[i].sqldata, -1); |
||||
printf("name sqlda descriptor: '%s' value NUMERIC '%s'\n", sqlda->sqlvar[i].sqlname.data, val); |
||||
free(val); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
int |
||||
main (void) |
||||
{ |
||||
/* exec sql begin declare section */ |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#line 67 "sqlda.pgc" |
||||
char * stmt1 = "SELECT * FROM t1" ; |
||||
|
||||
#line 68 "sqlda.pgc" |
||||
char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ; |
||||
|
||||
#line 69 "sqlda.pgc" |
||||
int rec ; |
||||
|
||||
#line 70 "sqlda.pgc" |
||||
int id ; |
||||
/* exec sql end declare section */ |
||||
#line 71 "sqlda.pgc" |
||||
|
||||
|
||||
char msg[128]; |
||||
|
||||
ECPGdebug(1, stderr); |
||||
|
||||
strcpy(msg, "connect"); |
||||
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "regress1", 0);
|
||||
#line 78 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 78 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "set"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 81 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 81 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "create"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) )", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 89 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 89 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "insert"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '\"c\"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' )", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 96 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 96 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "commit"); |
||||
{ ECPGtrans(__LINE__, NULL, "commit"); |
||||
#line 99 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 99 "sqlda.pgc" |
||||
|
||||
|
||||
/* SQLDA test for getting all records from a table */ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1); |
||||
#line 106 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 106 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "declare"); |
||||
/* declare mycur1 cursor for $1 */ |
||||
#line 109 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "open"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1",
|
||||
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); |
||||
#line 112 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 112 "sqlda.pgc" |
||||
|
||||
|
||||
/* exec sql whenever not found break ; */ |
||||
#line 114 "sqlda.pgc" |
||||
|
||||
|
||||
rec = 0; |
||||
while (1) |
||||
{ |
||||
strcpy(msg, "fetch"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 120 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode == ECPG_NOT_FOUND) break; |
||||
#line 120 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 120 "sqlda.pgc" |
||||
|
||||
|
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda); |
||||
} |
||||
|
||||
/* exec sql whenever not found continue ; */ |
||||
#line 126 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "close"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 129 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 129 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id1"); |
||||
#line 132 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 132 "sqlda.pgc" |
||||
|
||||
|
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting ALL records into the sqlda list */ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1); |
||||
#line 141 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 141 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "declare"); |
||||
/* declare mycur2 cursor for $1 */ |
||||
#line 144 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "open"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1",
|
||||
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); |
||||
#line 147 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 147 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "fetch"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch all from mycur2", ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 150 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 150 "sqlda.pgc" |
||||
|
||||
|
||||
outp_sqlda1 = outp_sqlda; |
||||
rec = 0; |
||||
while (outp_sqlda1) |
||||
{ |
||||
sqlda_t *ptr; |
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda1); |
||||
|
||||
ptr = outp_sqlda1; |
||||
outp_sqlda1 = outp_sqlda1->desc_next; |
||||
free(ptr); |
||||
} |
||||
|
||||
strcpy(msg, "close"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 166 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 166 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id2"); |
||||
#line 169 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 169 "sqlda.pgc" |
||||
|
||||
|
||||
/* SQLDA test for getting one record using an input descriptor */ |
||||
|
||||
/*
|
||||
* Input sqlda has to be built manually |
||||
* sqlda_t contains 1 sqlvar_t structure already. |
||||
*/ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqln = 1; |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = ECPGt_int; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2); |
||||
#line 191 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 191 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "execute"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "st_id3",
|
||||
ECPGt_sqlda, &inp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 194 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 194 "sqlda.pgc" |
||||
|
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id3"); |
||||
#line 199 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 199 "sqlda.pgc" |
||||
|
||||
|
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting one record using an input descriptor
|
||||
* on a named connection |
||||
*/ |
||||
|
||||
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "con2", 0);
|
||||
#line 208 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 208 "sqlda.pgc" |
||||
|
||||
|
||||
/*
|
||||
* Input sqlda has to be built manually |
||||
* sqlda_t contains 1 sqlvar_t structure already. |
||||
*/ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqln = 1; |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = ECPGt_int; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
{ ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2); |
||||
#line 228 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 228 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "execute"); |
||||
{ ECPGdo(__LINE__, 0, 1, "con2", 0, ECPGst_execute, "st_id4",
|
||||
ECPGt_sqlda, &inp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
|
||||
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); |
||||
#line 231 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 231 "sqlda.pgc" |
||||
|
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "commit"); |
||||
{ ECPGtrans(__LINE__, "con2", "commit"); |
||||
#line 236 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 236 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "deallocate"); |
||||
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id4"); |
||||
#line 239 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 239 "sqlda.pgc" |
||||
|
||||
|
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
strcpy(msg, "disconnect"); |
||||
{ ECPGdisconnect(__LINE__, "con2"); |
||||
#line 245 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 245 "sqlda.pgc" |
||||
|
||||
|
||||
/* End test */ |
||||
|
||||
strcpy(msg, "drop"); |
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT); |
||||
#line 250 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 250 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "commit"); |
||||
{ ECPGtrans(__LINE__, NULL, "commit"); |
||||
#line 253 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 253 "sqlda.pgc" |
||||
|
||||
|
||||
strcpy(msg, "disconnect"); |
||||
{ ECPGdisconnect(__LINE__, "CURRENT"); |
||||
#line 256 "sqlda.pgc" |
||||
|
||||
if (sqlca.sqlcode < 0) exit (1);} |
||||
#line 256 "sqlda.pgc" |
||||
|
||||
|
||||
return (0); |
||||
} |
@ -0,0 +1,594 @@ |
||||
[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]: ecpg_execute on line 81: query: set datestyle to iso; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 81: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 81: OK: SET |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 84: query: create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) ); with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 84: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 84: OK: CREATE TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 92: query: insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '"c"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' ); with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 92: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 92: OK: INSERT 0 4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans on line 99: action "commit"; connection "regress1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGprepare on line 106: name st_id1; query: "SELECT * FROM t1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 112: query: declare mycur1 cursor for SELECT * FROM t1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 112: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 112: OK: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: 2 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 1 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 2 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 3 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 4 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: 3 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: "c" offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: NaN offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: c offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 120: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: query: fetch 1 from mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 120: correctly got 0 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: raising sqlcode 100 on line 120: no data found on line 120 |
||||
[NO_PID]: sqlca: code: 100, state: 02000 |
||||
[NO_PID]: ecpg_execute on line 129: query: close mycur1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 129: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 129: OK: CLOSE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 132: name st_id1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGprepare on line 141: name st_id2; query: "SELECT * FROM t1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 147: query: declare mycur2 cursor for SELECT * FROM t1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 147: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 147: OK: DECLARE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: query: fetch all from mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: correctly got 4 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 3 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 3 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 3 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 3 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 3 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 2 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 3 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 2 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: "c" offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 2 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 2 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: NaN offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 2 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: c offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 1 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 2 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 1 col 1 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 1 col 2 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 1 col 3 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 1 col 4 IS NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: 1 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 150: RESULT: a offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 150: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 166: query: close mycur2; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 166: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 166: OK: CLOSE CURSOR |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 169: name st_id2 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGprepare on line 191: name st_id3; query: "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 194: query: SELECT * FROM t1 WHERE id = $1; with 1 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 194: using PQexecPrepared for "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: free_params on line 194: parameter 1 = 4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 194: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 194: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 194: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 194: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 194: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 194: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 194: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 199: name st_id3 |
||||
[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]: ECPGprepare on line 228: name st_id4; query: "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 231: query: SELECT * FROM t1 WHERE id = $1; with 1 parameter(s) on connection con2 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 231: using PQexecPrepared for "SELECT * FROM t1 WHERE id = $1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: free_params on line 231: parameter 1 = 4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 231: correctly got 1 tuples with 5 fields |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: sqlda_common_total_size type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_build_native_sqlda sqld = 5 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 231: new sqlda was built |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type int offset 512 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 0 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 231: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 516 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 1 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 231: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset1 520 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type numeric offset2 560 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 2 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type double offset 568 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 3 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 231: RESULT: 4 offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda type char offset 576 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_set_native_sqlda row 0 col 4 IS NOT NULL |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_get_data on line 231: RESULT: d offset: -1; array: yes |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 231: putting result (1 tuple 5 fields) into sqlda descriptor |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans on line 236: action "commit"; connection "con2" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGdeallocate on line 239: name st_id4 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: connection con2 closed |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 250: query: drop table t1; with 0 parameter(s) on connection regress1 |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 250: using PQexec |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_execute on line 250: OK: DROP TABLE |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ECPGtrans on line 253: action "commit"; connection "regress1" |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
||||
[NO_PID]: ecpg_finish: connection regress1 closed |
||||
[NO_PID]: sqlca: code: 0, state: 00000 |
@ -0,0 +1,60 @@ |
||||
FETCH RECORD 1 |
||||
name sqlda descriptor: 'id' value 1 |
||||
name sqlda descriptor: 't' value 'a' |
||||
name sqlda descriptor: 'd1' value NUMERIC '1.0' |
||||
name sqlda descriptor: 'd2' value 1.000000 |
||||
name sqlda descriptor: 'c' value 'a ' |
||||
FETCH RECORD 2 |
||||
name sqlda descriptor: 'id' value 2 |
||||
name sqlda descriptor: 't' value NULL' |
||||
name sqlda descriptor: 'd1' value NULL' |
||||
name sqlda descriptor: 'd2' value NULL' |
||||
name sqlda descriptor: 'c' value NULL' |
||||
FETCH RECORD 3 |
||||
name sqlda descriptor: 'id' value 3 |
||||
name sqlda descriptor: 't' value '"c"' |
||||
name sqlda descriptor: 'd1' value NUMERIC '-3' |
||||
name sqlda descriptor: 'd2' value nan |
||||
name sqlda descriptor: 'c' value 'c ' |
||||
FETCH RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value NUMERIC '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
||||
FETCH RECORD 1 |
||||
name sqlda descriptor: 'id' value 1 |
||||
name sqlda descriptor: 't' value 'a' |
||||
name sqlda descriptor: 'd1' value NUMERIC '1.0' |
||||
name sqlda descriptor: 'd2' value 1.000000 |
||||
name sqlda descriptor: 'c' value 'a ' |
||||
FETCH RECORD 2 |
||||
name sqlda descriptor: 'id' value 2 |
||||
name sqlda descriptor: 't' value NULL' |
||||
name sqlda descriptor: 'd1' value NULL' |
||||
name sqlda descriptor: 'd2' value NULL' |
||||
name sqlda descriptor: 'c' value NULL' |
||||
FETCH RECORD 3 |
||||
name sqlda descriptor: 'id' value 3 |
||||
name sqlda descriptor: 't' value '"c"' |
||||
name sqlda descriptor: 'd1' value NUMERIC '-3' |
||||
name sqlda descriptor: 'd2' value nan |
||||
name sqlda descriptor: 'c' value 'c ' |
||||
FETCH RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value NUMERIC '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
||||
EXECUTE RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value NUMERIC '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
||||
EXECUTE RECORD 4 |
||||
name sqlda descriptor: 'id' value 4 |
||||
name sqlda descriptor: 't' value 'd' |
||||
name sqlda descriptor: 'd1' value NUMERIC '4.0' |
||||
name sqlda descriptor: 'd2' value 4.000000 |
||||
name sqlda descriptor: 'c' value 'd ' |
@ -0,0 +1,259 @@ |
||||
#include <stdlib.h> |
||||
#include <string.h> |
||||
#include <inttypes.h> |
||||
#include <limits.h> |
||||
|
||||
exec sql include ../regression; |
||||
|
||||
exec sql include sqlda.h; |
||||
exec sql include pgtypes_numeric.h; |
||||
|
||||
exec sql whenever sqlerror stop; |
||||
|
||||
/* These shouldn't be under DECLARE SECTION */ |
||||
sqlda_t *inp_sqlda, *outp_sqlda, *outp_sqlda1; |
||||
|
||||
static void |
||||
dump_sqlda(sqlda_t *sqlda) |
||||
{ |
||||
int i; |
||||
|
||||
if (sqlda == NULL) |
||||
{ |
||||
printf("dump_sqlda called with NULL sqlda\n"); |
||||
return; |
||||
} |
||||
|
||||
for (i = 0; i < sqlda->sqld; i++) |
||||
{ |
||||
if (sqlda->sqlvar[i].sqlind && *(sqlda->sqlvar[i].sqlind) == -1) |
||||
printf("name sqlda descriptor: '%s' value NULL'\n", sqlda->sqlvar[i].sqlname.data); |
||||
else |
||||
switch (sqlda->sqlvar[i].sqltype) |
||||
{ |
||||
case ECPGt_char: |
||||
printf("name sqlda descriptor: '%s' value '%s'\n", sqlda->sqlvar[i].sqlname.data, sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case ECPGt_int: |
||||
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname.data, *(int *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
#ifdef HAVE_LONG_LONG_INT_64 |
||||
case ECPGt_long_long: |
||||
#else |
||||
case ECPGt_long: |
||||
#endif |
||||
printf("name sqlda descriptor: '%s' value " INT64_FORMAT "\n", sqlda->sqlvar[i].sqlname.data, *(int64_t *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case ECPGt_double: |
||||
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata); |
||||
break; |
||||
case ECPGt_numeric: |
||||
{ |
||||
char *val; |
||||
|
||||
val = PGTYPESnumeric_to_asc((numeric*)sqlda->sqlvar[i].sqldata, -1); |
||||
printf("name sqlda descriptor: '%s' value NUMERIC '%s'\n", sqlda->sqlvar[i].sqlname.data, val); |
||||
free(val); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
int |
||||
main (void) |
||||
{ |
||||
exec sql begin declare section; |
||||
char *stmt1 = "SELECT * FROM t1"; |
||||
char *stmt2 = "SELECT * FROM t1 WHERE id = ?"; |
||||
int rec; |
||||
int id; |
||||
exec sql end declare section; |
||||
|
||||
char msg[128]; |
||||
|
||||
ECPGdebug(1, stderr); |
||||
|
||||
strcpy(msg, "connect"); |
||||
exec sql connect to REGRESSDB1 as regress1; |
||||
|
||||
strcpy(msg, "set"); |
||||
exec sql set datestyle to iso; |
||||
|
||||
strcpy(msg, "create"); |
||||
exec sql create table t1( |
||||
id integer, |
||||
t text, |
||||
d1 numeric, |
||||
d2 float8, |
||||
c char(10)); |
||||
|
||||
strcpy(msg, "insert"); |
||||
exec sql insert into t1 values |
||||
(1, 'a', 1.0, 1, 'a'), |
||||
(2, null, null, null, null), |
||||
(3, '"c"', -3, 'nan'::float8, 'c'), |
||||
(4, 'd', 4.0, 4, 'd'); |
||||
|
||||
strcpy(msg, "commit"); |
||||
exec sql commit; |
||||
|
||||
/* SQLDA test for getting all records from a table */ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql prepare st_id1 from :stmt1; |
||||
|
||||
strcpy(msg, "declare"); |
||||
exec sql declare mycur1 cursor for st_id1; |
||||
|
||||
strcpy(msg, "open"); |
||||
exec sql open mycur1; |
||||
|
||||
exec sql whenever not found do break; |
||||
|
||||
rec = 0; |
||||
while (1) |
||||
{ |
||||
strcpy(msg, "fetch"); |
||||
exec sql fetch 1 from mycur1 into descriptor outp_sqlda; |
||||
|
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda); |
||||
} |
||||
|
||||
exec sql whenever not found continue; |
||||
|
||||
strcpy(msg, "close"); |
||||
exec sql close mycur1; |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id1; |
||||
|
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting ALL records into the sqlda list */ |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql prepare st_id2 from :stmt1; |
||||
|
||||
strcpy(msg, "declare"); |
||||
exec sql declare mycur2 cursor for st_id2; |
||||
|
||||
strcpy(msg, "open"); |
||||
exec sql open mycur2; |
||||
|
||||
strcpy(msg, "fetch"); |
||||
exec sql fetch all from mycur2 into descriptor outp_sqlda; |
||||
|
||||
outp_sqlda1 = outp_sqlda; |
||||
rec = 0; |
||||
while (outp_sqlda1) |
||||
{ |
||||
sqlda_t *ptr; |
||||
printf("FETCH RECORD %d\n", ++rec); |
||||
dump_sqlda(outp_sqlda1); |
||||
|
||||
ptr = outp_sqlda1; |
||||
outp_sqlda1 = outp_sqlda1->desc_next; |
||||
free(ptr); |
||||
} |
||||
|
||||
strcpy(msg, "close"); |
||||
exec sql close mycur2; |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id2; |
||||
|
||||
/* SQLDA test for getting one record using an input descriptor */ |
||||
|
||||
/* |
||||
* Input sqlda has to be built manually |
||||
* sqlda_t contains 1 sqlvar_t structure already. |
||||
*/ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqln = 1; |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = ECPGt_int; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql prepare st_id3 FROM :stmt2; |
||||
|
||||
strcpy(msg, "execute"); |
||||
exec sql execute st_id3 using descriptor inp_sqlda into descriptor outp_sqlda; |
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id3; |
||||
|
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
/* SQLDA test for getting one record using an input descriptor |
||||
* on a named connection |
||||
*/ |
||||
|
||||
exec sql connect to REGRESSDB1 as con2; |
||||
|
||||
/* |
||||
* Input sqlda has to be built manually |
||||
* sqlda_t contains 1 sqlvar_t structure already. |
||||
*/ |
||||
inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t)); |
||||
memset(inp_sqlda, 0, sizeof(sqlda_t)); |
||||
inp_sqlda->sqln = 1; |
||||
|
||||
inp_sqlda->sqlvar[0].sqltype = ECPGt_int; |
||||
inp_sqlda->sqlvar[0].sqldata = (char *)&id; |
||||
|
||||
printf("EXECUTE RECORD 4\n"); |
||||
|
||||
id = 4; |
||||
|
||||
outp_sqlda = NULL; |
||||
|
||||
strcpy(msg, "prepare"); |
||||
exec sql at con2 prepare st_id4 FROM :stmt2; |
||||
|
||||
strcpy(msg, "execute"); |
||||
exec sql at con2 execute st_id4 using descriptor inp_sqlda into descriptor outp_sqlda; |
||||
|
||||
dump_sqlda(outp_sqlda); |
||||
|
||||
strcpy(msg, "commit"); |
||||
exec sql at con2 commit; |
||||
|
||||
strcpy(msg, "deallocate"); |
||||
exec sql deallocate prepare st_id4; |
||||
|
||||
free(inp_sqlda); |
||||
free(outp_sqlda); |
||||
|
||||
strcpy(msg, "disconnect"); |
||||
exec sql disconnect con2; |
||||
|
||||
/* End test */ |
||||
|
||||
strcpy(msg, "drop"); |
||||
exec sql drop table t1; |
||||
|
||||
strcpy(msg, "commit"); |
||||
exec sql commit; |
||||
|
||||
strcpy(msg, "disconnect"); |
||||
exec sql disconnect; |
||||
|
||||
return (0); |
||||
} |
Loading…
Reference in new issue