based on a patch send in by Böszörményi Zoltán <zb@cybertec.at>.
- Fixed auto allocation for binary data types.
- Set pgtypes library version to 3.1.
- Set compat library version to 3.1.
- - Set ecpg library version to 6.2.
+ - Set ecpg library version to 6.1.
- Set ecpg version to 4.5.
+Fri, 07 Aug 2009 10:41:28 +0200
+
+ - Added STRING datatype for Informix compatibility mode. This work is
+ based on a patch send in by Böszörményi Zoltán <zb@cybertec.at>.
+ - Set ecpg library version to 6.2.
+ - Set ecpg version to 4.6.
# Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.43 2009/07/13 01:37:05 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.44 2009/08/07 10:51:20 meskes Exp $
#
#-------------------------------------------------------------------------
NAME= ecpg_compat
SO_MAJOR_VERSION= 3
-SO_MINOR_VERSION= 2
+SO_MINOR_VERSION= 1
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.42 2009/01/15 11:52:55 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/data.c,v 1.43 2009/08/07 10:51:20 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
case ECPGt_char:
case ECPGt_unsigned_char:
case ECPGt_varchar:
+ case ECPGt_string:
break;
default:
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
if (pval)
{
+ char *str = (char *) ((long) var + offset * act_tuple);
if (varcharsize == 0 || varcharsize > size)
- strncpy((char *) ((long) var + offset * act_tuple), pval, size + 1);
+ {
+ char *last;
+
+ strncpy(str, pval, size + 1);
+ /* do the rtrim() */
+ if (type == ECPGt_string)
+ {
+ char *last = str + size;
+ while (last > str && (*last == ' ' || *last == '\0'))
+ {
+ *last = '\0';
+ last--;
+ }
+ }
+ }
else
{
- strncpy((char *) ((long) var + offset * act_tuple), pval, varcharsize);
+ strncpy(str, pval, varcharsize);
if (varcharsize < size)
{
/* dynamic SQL support routines
*
- * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.32 2009/06/11 14:49:13 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/descriptor.c,v 1.33 2009/08/07 10:51:20 meskes Exp $
*/
#define POSTGRES_ECPG_INTERNAL
{
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
strncpy((char *) var, value, varcharsize);
break;
case ECPGt_varchar:
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.85 2009/06/11 14:49:13 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.86 2009/08/07 10:51:20 meskes Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
{
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
if (!var->varcharsize && !var->arrsize)
{
/* special mode for handling char**foo=0 */
/* fill the variable with the tuple(s) */
if (!var->varcharsize && !var->arrsize &&
- (var->type == ECPGt_char || var->type == ECPGt_unsigned_char))
+ (var->type == ECPGt_char || var->type == ECPGt_unsigned_char || var->type == ECPGt_string))
{
/* special mode for handling char**foo=0 */
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
{
/* set slen to string length if type is char * */
int slen = (var->varcharsize == 0) ? strlen((char *) var->value) : (unsigned int) var->varcharsize;
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.49 2009/06/11 14:49:13 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.50 2009/08/07 10:51:20 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
{
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
*((char *) ptr) = '\0';
break;
case ECPGt_short:
{
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
if (*((char *) ptr) == '\0')
return true;
break;
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.14 2007/11/15 21:14:45 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/typename.c,v 1.15 2009/08/07 10:51:20 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
switch (typ)
{
case ECPGt_char:
+ case ECPGt_string:
return "char";
case ECPGt_unsigned_char:
return "unsigned char";
* All types that can be handled for host variable declarations has to
* be handled eventually.
*
- * $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpgtype.h,v 1.37 2007/08/14 10:01:52 meskes Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/include/ecpgtype.h,v 1.38 2009/08/07 10:51:20 meskes Exp $
*/
/*
ECPGt_const, /* a constant is needed sometimes */
ECPGt_EOIT, /* End of insert types. */
ECPGt_EORT, /* End of result types. */
- ECPGt_NO_INDICATOR /* no indicator */
+ ECPGt_NO_INDICATOR, /* no indicator */
+ ECPGt_string /* trimmed (char *) type */
};
/* descriptor items */
ECPGd_cardinality
};
-#define IS_SIMPLE_TYPE(type) ((type) >= ECPGt_char && (type) <= ECPGt_interval)
+#define IS_SIMPLE_TYPE(type) (((type) >= ECPGt_char && (type) <= ECPGt_interval) || ((type) == ECPGt_string))
/* we also have to handle different statement types */
enum ECPG_statement_type
# Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.44 2009/07/13 01:37:05 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.45 2009/08/07 10:51:20 meskes Exp $
#
#-------------------------------------------------------------------------
NAME= pgtypes
SO_MAJOR_VERSION= 3
-SO_MINOR_VERSION= 2
+SO_MINOR_VERSION= 1
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS)
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.7 2009/06/10 23:11:52 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.header,v 1.8 2009/08/07 10:51:20 meskes Exp $ */
/* Copyright comment */
%{
original_var = ptr->variable->name;
sprintf(temp, "%d))", ecpg_informix_var);
- if ((ptr->variable->type->type != ECPGt_varchar && ptr->variable->type->type != ECPGt_char && ptr->variable->type->type != ECPGt_unsigned_char) && atoi(ptr->variable->type->size) > 1)
+ if ((ptr->variable->type->type != ECPGt_varchar && ptr->variable->type->type != ECPGt_char && ptr->variable->type->type != ECPGt_unsigned_char && ptr->variable->type->type != ECPGt_string) && atoi(ptr->variable->type->size) > 1)
{
ptr->variable = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->u.element->type)), make_str(" *)(ECPG_informix_get_var("), mm_strdup(temp)), ECPGmake_array_type(ECPGmake_simple_type(ptr->variable->type->u.element->type, make_str("1"), ptr->variable->type->u.element->lineno), ptr->variable->type->size), 0);
sprintf(temp, "%d, (", ecpg_informix_var++);
}
- else if ((ptr->variable->type->type == ECPGt_varchar || ptr->variable->type->type == ECPGt_char || ptr->variable->type->type == ECPGt_unsigned_char) && atoi(ptr->variable->type->size) > 1)
+ else if ((ptr->variable->type->type == ECPGt_varchar || ptr->variable->type->type == ECPGt_char || ptr->variable->type->type == ECPGt_unsigned_char || ptr->variable->type->type == ECPGt_string) && atoi(ptr->variable->type->size) > 1)
{
ptr->variable = new_variable(cat_str(4, make_str("("), mm_strdup(ecpg_type_name(ptr->variable->type->type)), make_str(" *)(ECPG_informix_get_var("), mm_strdup(temp)), ECPGmake_simple_type(ptr->variable->type->type, ptr->variable->type->size, ptr->variable->type->lineno), 0);
sprintf(temp, "%d, (", ecpg_informix_var++);
type_enum == ECPGt_union) &&
initializer == 1)
mmerror(PARSE_ERROR, ET_ERROR, "initializer not allowed in type definition");
+ else if (INFORMIX_MODE && strcmp(name, "string") == 0)
+ mmerror(PARSE_ERROR, ET_ERROR, "type name \"string\" is reserved in Informix mode");
else
{
for (ptr = types; ptr != NULL; ptr = ptr->next)
if (type_enum != ECPGt_varchar &&
type_enum != ECPGt_char &&
type_enum != ECPGt_unsigned_char &&
+ type_enum != ECPGt_string &&
atoi(this->type->type_index) >= 0)
mmerror(PARSE_ERROR, ET_ERROR, "multidimensional arrays for simple data types are not supported");
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.9 2009/06/10 23:11:52 petere Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.trailer,v 1.10 2009/08/07 10:51:20 meskes Exp $ */
statements: /*EMPTY*/
| statements statement
{
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
$$ = $1;
break;
case ECPGt_varchar:
$$.type_index = make_str("-1");
$$.type_sizeof = NULL;
}
+ else if ((strcmp($1, "string") == 0) && INFORMIX_MODE)
+ {
+ $$.type_enum = ECPGt_string;
+ $$.type_str = make_str("char");
+ $$.type_dimension = make_str("-1");
+ $$.type_index = make_str("-1");
+ $$.type_sizeof = NULL;
+ }
else
{
/* this is for typedef'ed types */
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
if (atoi(dimension) == -1)
{
int i = strlen($5);
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
if (atoi(dimension) == -1)
type = ECPGmake_simple_type($5.type_enum, length, 0);
else
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.83 2009/06/11 14:49:13 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/type.c,v 1.84 2009/08/07 10:51:20 meskes Exp $ */
#include "postgres_fe.h"
case ECPGt_timestamp:
return ("ECPGt_timestamp");
break;
+ case ECPGt_string:
+ return ("ECPGt_string");
+ break;
default:
mmerror(PARSE_ERROR, ET_ERROR, "unrecognized variable type code %d", type);
}
case ECPGt_char:
case ECPGt_unsigned_char:
case ECPGt_char_variable:
+ case ECPGt_string:
/*
* we have to use the pointer except for arrays with given
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.49 2009/06/11 14:49:13 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.50 2009/08/07 10:51:20 meskes Exp $ */
#include "postgres_fe.h"
"multilevel pointers (more than 2 levels) are not supported; found %d levels", pointer_len),
pointer_len);
- if (pointer_len > 1 && type_enum != ECPGt_char && type_enum != ECPGt_unsigned_char)
+ if (pointer_len > 1 && type_enum != ECPGt_char && type_enum != ECPGt_unsigned_char && type_enum != ECPGt_string)
mmerror(PARSE_ERROR, ET_FATAL, "pointer to pointer is not supported for this data type");
if (pointer_len > 1 && (atoi(*length) >= 0 || atoi(*dimension) >= 0))
break;
case ECPGt_char:
case ECPGt_unsigned_char:
+ case ECPGt_string:
/* char ** */
if (pointer_len == 2)
{
{
$int i = 14;
$decimal j, m, n;
+ $string c[10];
ECPGdebug(1, stderr);
$whenever sqlerror do dosqlprint();
$connect to REGRESSDB1;
if (sqlca.sqlcode != 0) exit(1);
- $create table test(i int primary key, j int);
+ $create table test(i int primary key, j int, c text);
/* this INSERT works */
rsetnull(CDECIMALTYPE, (char *)&j);
- $insert into test (i, j) values (7, :j);
+ $insert into test (i, j, c) values (7, :j, 'test ');
$commit;
/* this INSERT should fail because i is a unique column */
- $insert into test (i, j) values (7, NUMBER);
+ $insert into test (i, j, c) values (7, NUMBER, 'a');
printf("INSERT: %ld=%s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
if (sqlca.sqlcode != 0) $rollback;
- $insert into test (i, j) values (:i, 1);
+ $insert into test (i, j, c) values (:i, 1, 'a ');
$commit;
/* this will fail (more than one row in subquery) */
while (1)
{
- $fetch forward c into :i, :j;
+ $fetch forward c into :i, :j, :c;
if (sqlca.sqlcode == 100) break;
else if (sqlca.sqlcode != 0) printf ("Error: %ld\n", sqlca.sqlcode);
int a;
dectoint(&j, &a);
- printf("%d %d\n", i, a);
+ printf("%d %d \"%s\"\n", i, a, c);
}
}
#line 15 "test_informix.pgc"
+
+#line 16 "test_informix.pgc"
+ char c [ 10 ] ;
+
+#line 16 "test_informix.pgc"
+
ECPGdebug(1, stderr);
/* exec sql whenever sqlerror do dosqlprint ( ) ; */
-#line 18 "test_informix.pgc"
+#line 19 "test_informix.pgc"
{ ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , NULL, 0);
-#line 20 "test_informix.pgc"
+#line 21 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 20 "test_informix.pgc"
+#line 21 "test_informix.pgc"
if (sqlca.sqlcode != 0) exit(1);
- { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "create table test ( i int primary key , j int )", ECPGt_EOIT, ECPGt_EORT);
-#line 23 "test_informix.pgc"
+ { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "create table test ( i int primary key , j int , c text )", ECPGt_EOIT, ECPGt_EORT);
+#line 24 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 23 "test_informix.pgc"
+#line 24 "test_informix.pgc"
/* this INSERT works */
rsetnull(CDECIMALTYPE, (char *)&j);
- { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into test ( i , j ) values ( 7 , $1 )",
+ { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into test ( i , j , c ) values ( 7 , $1 , 'test ' )",
ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 27 "test_informix.pgc"
+#line 28 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 27 "test_informix.pgc"
+#line 28 "test_informix.pgc"
{ ECPGtrans(__LINE__, NULL, "commit");
-#line 28 "test_informix.pgc"
+#line 29 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 28 "test_informix.pgc"
+#line 29 "test_informix.pgc"
/* this INSERT should fail because i is a unique column */
- { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into test ( i , j ) values ( 7 , 12 )", ECPGt_EOIT, ECPGt_EORT);
-#line 31 "test_informix.pgc"
+ { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into test ( i , j , c ) values ( 7 , 12 , 'a' )", ECPGt_EOIT, ECPGt_EORT);
+#line 32 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 31 "test_informix.pgc"
+#line 32 "test_informix.pgc"
printf("INSERT: %ld=%s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
if (sqlca.sqlcode != 0) { ECPGtrans(__LINE__, NULL, "rollback");
-#line 33 "test_informix.pgc"
+#line 34 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 33 "test_informix.pgc"
+#line 34 "test_informix.pgc"
- { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into test ( i , j ) values ( $1 , 1 )",
+ { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into test ( i , j , c ) values ( $1 , 1 , 'a ' )",
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 35 "test_informix.pgc"
+#line 36 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 35 "test_informix.pgc"
+#line 36 "test_informix.pgc"
{ ECPGtrans(__LINE__, NULL, "commit");
-#line 36 "test_informix.pgc"
+#line 37 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 36 "test_informix.pgc"
+#line 37 "test_informix.pgc"
/* this will fail (more than one row in subquery) */
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "select i from test where j = ( select j from test )", ECPGt_EOIT, ECPGt_EORT);
-#line 39 "test_informix.pgc"
+#line 40 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 39 "test_informix.pgc"
+#line 40 "test_informix.pgc"
{ ECPGtrans(__LINE__, NULL, "rollback");
-#line 40 "test_informix.pgc"
+#line 41 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 40 "test_informix.pgc"
+#line 41 "test_informix.pgc"
/* this however should be ok */
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "select i from test where j = ( select j from test order by i limit 1 )", ECPGt_EOIT, ECPGt_EORT);
-#line 43 "test_informix.pgc"
+#line 44 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 43 "test_informix.pgc"
+#line 44 "test_informix.pgc"
printf("SELECT: %ld=%s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);
if (sqlca.sqlcode != 0) { ECPGtrans(__LINE__, NULL, "rollback");
-#line 45 "test_informix.pgc"
+#line 46 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 45 "test_informix.pgc"
+#line 46 "test_informix.pgc"
ECPG_informix_set_var( 0, &( i ), __LINE__);\
/* declare c cursor for select * from test where i <= $1 */
-#line 47 "test_informix.pgc"
+#line 48 "test_informix.pgc"
openit();
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal),
+ ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
+ ECPGt_string,(c),(long)10,(long)1,(10)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
-#line 54 "test_informix.pgc"
+#line 55 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 54 "test_informix.pgc"
+#line 55 "test_informix.pgc"
if (sqlca.sqlcode == 100) break;
else if (sqlca.sqlcode != 0) printf ("Error: %ld\n", sqlca.sqlcode);
int a;
dectoint(&j, &a);
- printf("%d %d\n", i, a);
+ printf("%d %d \"%s\"\n", i, a, c);
}
}
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "delete from test where i = $1 :: decimal",
ECPGt_decimal,&(n),(long)1,(long)1,sizeof(decimal),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 72 "test_informix.pgc"
+#line 73 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 72 "test_informix.pgc"
+#line 73 "test_informix.pgc"
printf("DELETE: %ld\n", sqlca.sqlcode);
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "select 1 from test where i = 14", ECPGt_EOIT, ECPGt_EORT);
-#line 75 "test_informix.pgc"
+#line 76 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 75 "test_informix.pgc"
+#line 76 "test_informix.pgc"
printf("Exists: %ld\n", sqlca.sqlcode);
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "select 1 from test where i = 147", ECPGt_EOIT, ECPGt_EORT);
-#line 78 "test_informix.pgc"
+#line 79 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 78 "test_informix.pgc"
+#line 79 "test_informix.pgc"
printf("Does not exist: %ld\n", sqlca.sqlcode);
{ ECPGtrans(__LINE__, NULL, "commit");
-#line 81 "test_informix.pgc"
+#line 82 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 81 "test_informix.pgc"
+#line 82 "test_informix.pgc"
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "drop table test", ECPGt_EOIT, ECPGt_EORT);
-#line 82 "test_informix.pgc"
+#line 83 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 82 "test_informix.pgc"
+#line 83 "test_informix.pgc"
{ ECPGtrans(__LINE__, NULL, "commit");
-#line 83 "test_informix.pgc"
+#line 84 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 83 "test_informix.pgc"
+#line 84 "test_informix.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");
-#line 85 "test_informix.pgc"
+#line 86 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 85 "test_informix.pgc"
+#line 86 "test_informix.pgc"
return 0;
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare c cursor for select * from test where i <= $1 ",
ECPGt_int,&(*( int *)(ECPG_informix_get_var( 0))),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
-#line 92 "test_informix.pgc"
+#line 93 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
-#line 92 "test_informix.pgc"
+#line 93 "test_informix.pgc"
}
[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 23: query: create table test ( i int primary key , j int ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 24: query: create table test ( i int primary key , j int , c text ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: using PQexec
+[NO_PID]: ecpg_execute on line 24: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 23: OK: CREATE TABLE
+[NO_PID]: ecpg_execute on line 24: OK: CREATE TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 27: query: insert into test ( i , j ) values ( 7 , $1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 28: query: insert into test ( i , j , c ) values ( 7 , $1 , 'test ' ); with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 27: using PQexecParams
+[NO_PID]: ecpg_execute on line 28: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: free_params on line 27: parameter 1 = 0
+[NO_PID]: free_params on line 28: parameter 1 = 0
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 27: OK: INSERT 0 1
+[NO_PID]: ecpg_execute on line 28: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 28: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 29: action "commit"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: query: insert into test ( i , j ) values ( 7 , 12 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 32: query: insert into test ( i , j , c ) values ( 7 , 12 , 'a' ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 31: using PQexec
+[NO_PID]: ecpg_execute on line 32: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_check_PQresult on line 31: ERROR: duplicate key value violates unique constraint "test_pkey"
+[NO_PID]: ecpg_check_PQresult on line 32: ERROR: duplicate key value violates unique constraint "test_pkey"
DETAIL: Key (i)=(7) already exists.
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlstate 23505 (sqlcode -239) on line 31: duplicate key value violates unique constraint "test_pkey" on line 31
+[NO_PID]: raising sqlstate 23505 (sqlcode -239) on line 32: duplicate key value violates unique constraint "test_pkey" on line 32
[NO_PID]: sqlca: code: -239, state: 23505
-[NO_PID]: ECPGtrans on line 33: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 34: action "rollback"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: query: insert into test ( i , j ) values ( $1 , 1 ); with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 36: query: insert into test ( i , j , c ) values ( $1 , 1 , 'a ' ); with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: using PQexecParams
+[NO_PID]: ecpg_execute on line 36: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: free_params on line 35: parameter 1 = 14
+[NO_PID]: free_params on line 36: parameter 1 = 14
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 35: OK: INSERT 0 1
+[NO_PID]: ecpg_execute on line 36: OK: INSERT 0 1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 36: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 37: action "commit"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: query: select i from test where j = ( select j from test ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 40: query: select i from test where j = ( select j from test ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 39: using PQexec
+[NO_PID]: ecpg_execute on line 40: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_check_PQresult on line 39: ERROR: more than one row returned by a subquery used as an expression
+[NO_PID]: ecpg_check_PQresult on line 40: ERROR: more than one row returned by a subquery used as an expression
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlstate 21000 (sqlcode -284) on line 39: more than one row returned by a subquery used as an expression on line 39
+[NO_PID]: raising sqlstate 21000 (sqlcode -284) on line 40: more than one row returned by a subquery used as an expression on line 40
[NO_PID]: sqlca: code: -284, state: 21000
-[NO_PID]: ECPGtrans on line 40: action "rollback"; connection "regress1"
+[NO_PID]: ECPGtrans on line 41: action "rollback"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 43: query: select i from test where j = ( select j from test order by i limit 1 ); with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 44: query: select i from test where j = ( select j from test order by i limit 1 ); with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 43: using PQexec
+[NO_PID]: ecpg_execute on line 44: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 43: correctly got 1 tuples with 1 fields
+[NO_PID]: ecpg_execute on line 44: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 92: query: declare c cursor for select * from test where i <= $1 ; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 93: query: declare c cursor for select * from test where i <= $1 ; with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 92: using PQexecParams
+[NO_PID]: ecpg_execute on line 93: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: free_params on line 92: parameter 1 = 14
+[NO_PID]: free_params on line 93: parameter 1 = 14
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 92: OK: DECLARE CURSOR
+[NO_PID]: ecpg_execute on line 93: OK: DECLARE CURSOR
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: query: fetch forward from c; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 55: query: fetch forward from c; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: using PQexec
+[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: correctly got 1 tuples with 2 fields
+[NO_PID]: ecpg_execute on line 55: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 54: RESULT: 7 offset: -1; array: yes
+[NO_PID]: ecpg_get_data on line 55: RESULT: 7 offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 54: RESULT: 0 offset: -1; array: yes
+[NO_PID]: ecpg_get_data on line 55: RESULT: 0 offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: query: fetch forward from c; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_get_data on line 55: RESULT: test offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: using PQexec
+[NO_PID]: ecpg_execute on line 55: query: fetch forward from c; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: correctly got 1 tuples with 2 fields
+[NO_PID]: ecpg_execute on line 55: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 54: RESULT: 14 offset: -1; array: yes
+[NO_PID]: ecpg_execute on line 55: correctly got 1 tuples with 3 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 54: RESULT: 1 offset: -1; array: yes
+[NO_PID]: ecpg_get_data on line 55: RESULT: 14 offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: query: fetch forward from c; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_get_data on line 55: RESULT: 1 offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: using PQexec
+[NO_PID]: ecpg_get_data on line 55: RESULT: a offset: -1; array: yes
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 54: correctly got 0 tuples with 2 fields
+[NO_PID]: ecpg_execute on line 55: query: fetch forward from c; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlcode 100 on line 54: no data found on line 54
+[NO_PID]: ecpg_execute on line 55: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 55: correctly got 0 tuples with 3 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode 100 on line 55: no data found on line 55
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 72: query: delete from test where i = $1 :: decimal; with 1 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 73: query: delete from test where i = $1 :: decimal; with 1 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: using PQexecParams
+[NO_PID]: ecpg_execute on line 73: using PQexecParams
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: free_params on line 72: parameter 1 = 21.0
+[NO_PID]: free_params on line 73: parameter 1 = 21.0
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 72: OK: DELETE 0
+[NO_PID]: ecpg_execute on line 73: OK: DELETE 0
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlcode 100 on line 72: no data found on line 72
+[NO_PID]: raising sqlcode 100 on line 73: no data found on line 73
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ecpg_execute on line 75: query: select 1 from test where i = 14; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 76: query: select 1 from test where i = 14; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 75: using PQexec
+[NO_PID]: ecpg_execute on line 76: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 75: correctly got 1 tuples with 1 fields
+[NO_PID]: ecpg_execute on line 76: correctly got 1 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 78: query: select 1 from test where i = 147; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 79: query: select 1 from test where i = 147; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 78: using PQexec
+[NO_PID]: ecpg_execute on line 79: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 78: correctly got 0 tuples with 1 fields
+[NO_PID]: ecpg_execute on line 79: correctly got 0 tuples with 1 fields
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: raising sqlcode 100 on line 78: no data found on line 78
+[NO_PID]: raising sqlcode 100 on line 79: no data found on line 79
[NO_PID]: sqlca: code: 100, state: 02000
-[NO_PID]: ECPGtrans on line 81: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 82: action "commit"; connection "regress1"
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 82: query: drop table test; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 83: query: drop table test; with 0 parameter(s) on connection regress1
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 82: using PQexec
+[NO_PID]: ecpg_execute on line 83: using PQexec
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 82: OK: DROP TABLE
+[NO_PID]: ecpg_execute on line 83: OK: DROP TABLE
[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ECPGtrans on line 83: action "commit"; connection "regress1"
+[NO_PID]: ECPGtrans on line 84: 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
-doSQLprint: Error: duplicate key value violates unique constraint "test_pkey" on line 31
-INSERT: -239=duplicate key value violates unique constraint "test_pkey" on line 31
-doSQLprint: Error: more than one row returned by a subquery used as an expression on line 39
+doSQLprint: Error: duplicate key value violates unique constraint "test_pkey" on line 32
+INSERT: -239=duplicate key value violates unique constraint "test_pkey" on line 32
+doSQLprint: Error: more than one row returned by a subquery used as an expression on line 40
SELECT: 0=
-7 0
-14 1
+7 0 "test"
+14 1 "a"
DELETE: 100
Exists: 0
Does not exist: 100