diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index ea40d4c4a35cda8a67c416a734b756e8df5cbb7a..657339442bc0e4f7218c86dd7d57ceaf6213d97e 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -2412,6 +2412,12 @@ Mon, 02 Feb 2009 16:34:53 +0100 - 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. diff --git a/src/interfaces/ecpg/compatlib/Makefile b/src/interfaces/ecpg/compatlib/Makefile index eb23c18e8022bcf5e1cc5b5b3ef6dfb532ff2faa..d6d4923ec045626ee26d250b1df92e2917b11181 100644 --- a/src/interfaces/ecpg/compatlib/Makefile +++ b/src/interfaces/ecpg/compatlib/Makefile @@ -5,7 +5,7 @@ # 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 $ # #------------------------------------------------------------------------- @@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global 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) diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index 9ec78a599dcfbf42c1e16b6e577b4f4f03334b62..3fef207017ef369284d2b3b8eb30e7cb5686900d 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -1,4 +1,4 @@ -/* $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" @@ -138,6 +138,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, case ECPGt_char: case ECPGt_unsigned_char: case ECPGt_varchar: + case ECPGt_string: break; default: @@ -389,13 +390,29 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno, 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) { diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c index 1a0640663a166b6ba17a5bd770a3cf0c8a5a354e..0712e0ba9b6ed3eb91ce6d7058c770c4faa3032d 100644 --- a/src/interfaces/ecpg/ecpglib/descriptor.c +++ b/src/interfaces/ecpg/ecpglib/descriptor.c @@ -1,6 +1,6 @@ /* 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 @@ -200,6 +200,7 @@ get_char_item(int lineno, void *var, enum ECPGttype vartype, char *value, int va { case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: strncpy((char *) var, value, varcharsize); break; case ECPGt_varchar: diff --git a/src/interfaces/ecpg/ecpglib/execute.c b/src/interfaces/ecpg/ecpglib/execute.c index 96aa96c464518d5f35e6c08b50ee2f2cc461201a..7df1606947676ac96491d68ca12bd2479a5f9e3b 100644 --- a/src/interfaces/ecpg/ecpglib/execute.c +++ b/src/interfaces/ecpg/ecpglib/execute.c @@ -1,4 +1,4 @@ -/* $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. @@ -359,6 +359,7 @@ ecpg_store_result(const PGresult *results, int act_field, { case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: if (!var->varcharsize && !var->arrsize) { /* special mode for handling char**foo=0 */ @@ -418,7 +419,7 @@ ecpg_store_result(const PGresult *results, int act_field, /* 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 */ @@ -757,6 +758,7 @@ ecpg_store_input(const int lineno, const bool force_indicator, const struct vari 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; diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index d7a80d5f25bb298c3401a582ad451364fd1c54dd..1a261252538d03d18e1ae496a4df4fed76e3e78d 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -1,4 +1,4 @@ -/* $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" @@ -295,6 +295,7 @@ ECPGset_noind_null(enum ECPGttype type, void *ptr) { case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: *((char *) ptr) = '\0'; break; case ECPGt_short: @@ -361,6 +362,7 @@ ECPGis_noind_null(enum ECPGttype type, void *ptr) { case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: if (*((char *) ptr) == '\0') return true; break; diff --git a/src/interfaces/ecpg/ecpglib/typename.c b/src/interfaces/ecpg/ecpglib/typename.c index e20c73cf75830da5ed600622943a4c2ca23eb342..0d670ce0c5069e6f62222b504d8088da5b71bc0b 100644 --- a/src/interfaces/ecpg/ecpglib/typename.c +++ b/src/interfaces/ecpg/ecpglib/typename.c @@ -1,4 +1,4 @@ -/* $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" @@ -19,6 +19,7 @@ ecpg_type_name(enum ECPGttype typ) switch (typ) { case ECPGt_char: + case ECPGt_string: return "char"; case ECPGt_unsigned_char: return "unsigned char"; diff --git a/src/interfaces/ecpg/include/ecpgtype.h b/src/interfaces/ecpg/include/ecpgtype.h index 62cf255ceff0765531edeb843c695250392b4240..b8f286de75e42695e59efd6aad3fe20cb11f7fb6 100644 --- a/src/interfaces/ecpg/include/ecpgtype.h +++ b/src/interfaces/ecpg/include/ecpgtype.h @@ -5,7 +5,7 @@ * 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 $ */ /* @@ -61,7 +61,8 @@ enum ECPGttype 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 */ @@ -86,7 +87,7 @@ enum ECPGdtype 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 diff --git a/src/interfaces/ecpg/pgtypeslib/Makefile b/src/interfaces/ecpg/pgtypeslib/Makefile index f91ce407805097145a5d75121bb1a9e9143c2995..6d18aadd806551075dff4db57baed21314b99f06 100644 --- a/src/interfaces/ecpg/pgtypeslib/Makefile +++ b/src/interfaces/ecpg/pgtypeslib/Makefile @@ -5,7 +5,7 @@ # 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 $ # #------------------------------------------------------------------------- @@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global 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) diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header index c2091d28293c12feea9439a6118ac8fb06dedb11..fae9e76e0a849ffad87161c0fe0f048d787cd167 100644 --- a/src/interfaces/ecpg/preproc/ecpg.header +++ b/src/interfaces/ecpg/preproc/ecpg.header @@ -1,4 +1,4 @@ -/* $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 */ %{ @@ -256,12 +256,12 @@ adjust_informix(struct arguments *list) 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++); @@ -343,6 +343,8 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu 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) @@ -371,6 +373,7 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu 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"); diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index 1b287e4c65d694e4fd4fa78bed8ad14f73c4fc02..3b5d660fc413008a1ab7b584707d514c66253bae 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -1,4 +1,4 @@ -/* $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 @@ -213,6 +213,7 @@ char_variable: cvariable { case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: $$ = $1; break; case ECPGt_varchar: @@ -587,6 +588,14 @@ var_type: simple_type $$.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 */ @@ -849,6 +858,7 @@ variable: opt_pointer ECPGColLabel opt_array_bounds opt_bit_field opt_initialize case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: if (atoi(dimension) == -1) { int i = strlen($5); @@ -1269,6 +1279,7 @@ ECPGVar: SQL_VAR case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: if (atoi(dimension) == -1) type = ECPGmake_simple_type($5.type_enum, length, 0); else diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c index 49caa32f26cadcf31f046e6a87f0dc29f00c7f80..0465762f8d15913828480138bf7a60fd23160141 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -1,4 +1,4 @@ -/* $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" @@ -200,6 +200,9 @@ get_type(enum ECPGttype type) 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); } @@ -366,6 +369,7 @@ ECPGdump_a_simple(FILE *o, const char *name, enum ECPGttype 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 diff --git a/src/interfaces/ecpg/preproc/variable.c b/src/interfaces/ecpg/preproc/variable.c index 307490465ed0f624d5f1aa9d46dd7737d5c7d238..9d29f340b6360ef26859ce9b02d329144405d7e3 100644 --- a/src/interfaces/ecpg/preproc/variable.c +++ b/src/interfaces/ecpg/preproc/variable.c @@ -1,4 +1,4 @@ -/* $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" @@ -500,7 +500,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty "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)) @@ -539,6 +539,7 @@ adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *ty break; case ECPGt_char: case ECPGt_unsigned_char: + case ECPGt_string: /* char ** */ if (pointer_len == 2) { diff --git a/src/interfaces/ecpg/test/compat_informix/test_informix.pgc b/src/interfaces/ecpg/test/compat_informix/test_informix.pgc index 51ac48eda11a22d790453ac42e7d09186a78aff7..ce921a6cc69a98464e43dffab18b27426f7bbf91 100644 --- a/src/interfaces/ecpg/test/compat_informix/test_informix.pgc +++ b/src/interfaces/ecpg/test/compat_informix/test_informix.pgc @@ -13,6 +13,7 @@ int main(void) { $int i = 14; $decimal j, m, n; + $string c[10]; ECPGdebug(1, stderr); $whenever sqlerror do dosqlprint(); @@ -20,19 +21,19 @@ int main(void) $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) */ @@ -51,7 +52,7 @@ int main(void) 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); @@ -62,7 +63,7 @@ int main(void) int a; dectoint(&j, &a); - printf("%d %d\n", i, a); + printf("%d %d \"%s\"\n", i, a, c); } } diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c index d139a1f422e00aea5bc8007906ec708447999937..efdbd49d9bbec95ff2afbd840adcc8f75713e92a 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c @@ -43,106 +43,112 @@ int main(void) #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(); @@ -154,11 +160,13 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} 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); @@ -170,7 +178,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} int a; dectoint(&j, &a); - printf("%d %d\n", i, a); + printf("%d %d \"%s\"\n", i, a, c); } } @@ -180,53 +188,53 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} { 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; @@ -237,10 +245,10 @@ static void openit(void) { 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" } diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr index f57f88b4812c43c0f578e6efab2a9b25e7f29814..bef7839e90b90f1fc61ffce41e3839775e7c351d 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr @@ -2,128 +2,132 @@ [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 diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stdout b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stdout index b8d22e921d22ba1156964ec06f3491d3464a0dd7..2a2fbc58f023019120aa69fed6015e4325eff6c4 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stdout +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stdout @@ -1,9 +1,9 @@ -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