diff --git a/src/interfaces/ecpg/test/compat_informix/test_informix.pgc b/src/interfaces/ecpg/test/compat_informix/test_informix.pgc index 8f916e47518c1051b56c3f68e53221b7fc2393ea..2a78396abdb8a27d62d1b4610494434cba70b92a 100644 --- a/src/interfaces/ecpg/test/compat_informix/test_informix.pgc +++ b/src/interfaces/ecpg/test/compat_informix/test_informix.pgc @@ -1,5 +1,6 @@ #include "sqltypes.h" - +#include <stdlib.h> +# $include ../regression; $define NUMBER 12; diff --git a/src/interfaces/ecpg/test/errors/init.pgc b/src/interfaces/ecpg/test/errors/init.pgc index 5a6b200f537564a20d80e36c767515f958ac68aa..483f1157bafc5aaae36c205c602b99ec0c32a8f3 100644 --- a/src/interfaces/ecpg/test/errors/init.pgc +++ b/src/interfaces/ecpg/test/errors/init.pgc @@ -3,40 +3,39 @@ exec sql include sqlca; enum e { ENUM0, ENUM1 }; struct sa { int member; }; -int -fa(void) +static int fa(void) { printf("in fa\n"); return 2; } -int +static int fb(int x) { printf("in fb (%d)\n", x); return x; } -int +static int fc(const char *x) { printf("in fc (%s)\n", x); return *x; } -int fd(const char *x,int i) +static int fd(const char *x,int i) { printf("in fd (%s, %d)\n", x, i); return (*x)*i; } -int fe(enum e x) +static int fe(enum e x) { printf("in fe (%d)\n", (int) x); return (int)x; } -void sqlnotice(char *notice, short trans) +static void sqlnotice(char *notice, short trans) { if (!notice) notice = "-empty-"; @@ -56,7 +55,7 @@ namespace N int main(void) { - struct sa x,*y; + struct sa x = { 14 },*y = &x; exec sql begin declare section; int a=(int)2; int b=2+2; @@ -83,6 +82,9 @@ int main(void) ECPGdebug(1, stderr); + printf("%d %d %d %d %d %d %d %d %d %d %d\n", a, b, b2, c, d, e, f, g, h, i, j); + iax = iay = 0; + printf("%ld %lld\n", iay, iax); exec sql whenever sqlerror do fa(); exec sql select now(); exec sql whenever sqlerror do fb(20); 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 15643fca3e0386ae99e43cd7f7758fb528059761..cb42a40479582495e9f7f322dc5399679539cce6 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c @@ -10,7 +10,8 @@ #line 1 "test_informix.pgc" #include "sqltypes.h" - +#include <stdlib.h> +# #line 1 "./../regression.h" @@ -19,7 +20,7 @@ -#line 3 "test_informix.pgc" +#line 4 "test_informix.pgc" @@ -31,36 +32,36 @@ static void dosqlprint(void) { int main(void) { -#line 13 "test_informix.pgc" +#line 14 "test_informix.pgc" int i = 14 ; -#line 13 "test_informix.pgc" +#line 14 "test_informix.pgc" -#line 14 "test_informix.pgc" +#line 15 "test_informix.pgc" decimal j , m , n ; -#line 14 "test_informix.pgc" +#line 15 "test_informix.pgc" ECPGdebug(1, stderr); /* exec sql whenever sqlerror do dosqlprint ( ) ; */ -#line 17 "test_informix.pgc" +#line 18 "test_informix.pgc" { ECPGconnect(__LINE__, 1, "regress1" , NULL,NULL , NULL, 0); -#line 19 "test_informix.pgc" +#line 20 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 19 "test_informix.pgc" +#line 20 "test_informix.pgc" if (sqlca.sqlcode != 0) exit(1); { ECPGdo(__LINE__, 1, 1, NULL, "create table test ( i int primary key , j int ) ", ECPGt_EOIT, ECPGt_EORT); -#line 22 "test_informix.pgc" +#line 23 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 22 "test_informix.pgc" +#line 23 "test_informix.pgc" /* this INSERT works */ @@ -68,74 +69,74 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} { ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( 7 , ? )", ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 26 "test_informix.pgc" +#line 27 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 26 "test_informix.pgc" +#line 27 "test_informix.pgc" { ECPGtrans(__LINE__, NULL, "commit"); -#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" /* this INSERT should fail because i is a unique column */ { ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( 7 , 12 )", ECPGt_EOIT, ECPGt_EORT); -#line 30 "test_informix.pgc" +#line 31 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 30 "test_informix.pgc" +#line 31 "test_informix.pgc" printf("INSERT: %ld=%s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); if (sqlca.sqlcode != 0) { ECPGtrans(__LINE__, NULL, "rollback"); -#line 32 "test_informix.pgc" +#line 33 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 32 "test_informix.pgc" +#line 33 "test_informix.pgc" { ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( ? , 1 )", ECPGt_int,&(i),(long)1,(long)1,sizeof(int), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 34 "test_informix.pgc" +#line 35 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 34 "test_informix.pgc" +#line 35 "test_informix.pgc" { ECPGtrans(__LINE__, NULL, "commit"); -#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" /* this will fail (more than one row in subquery) */ { ECPGdo(__LINE__, 1, 1, NULL, "select i from test where j = ( select j from test ) ", ECPGt_EOIT, ECPGt_EORT); -#line 38 "test_informix.pgc" +#line 39 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 38 "test_informix.pgc" +#line 39 "test_informix.pgc" /* this however should be ok */ { ECPGdo(__LINE__, 1, 1, NULL, "select i from test where j = ( select j from test limit 1 ) ", ECPGt_EOIT, ECPGt_EORT); -#line 41 "test_informix.pgc" +#line 42 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 41 "test_informix.pgc" +#line 42 "test_informix.pgc" printf("SELECT: %ld=%s\n", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc); if (sqlca.sqlcode != 0) { ECPGtrans(__LINE__, NULL, "rollback"); -#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" ECPG_informix_set_var( 0, &( i ), __LINE__);\ /* declare c cursor for select * from test where i <= ? */ -#line 45 "test_informix.pgc" +#line 46 "test_informix.pgc" openit(); @@ -148,10 +149,10 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); -#line 52 "test_informix.pgc" +#line 53 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 52 "test_informix.pgc" +#line 53 "test_informix.pgc" if (sqlca.sqlcode == 100) break; else if (sqlca.sqlcode != 0) printf ("Error: %ld\n", sqlca.sqlcode); @@ -173,53 +174,53 @@ if (sqlca.sqlcode < 0) dosqlprint ( );} { ECPGdo(__LINE__, 1, 1, NULL, "delete from test where i = ?", ECPGt_decimal,&(n),(long)1,(long)1,sizeof(decimal), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 70 "test_informix.pgc" +#line 71 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 70 "test_informix.pgc" +#line 71 "test_informix.pgc" printf("DELETE: %ld\n", sqlca.sqlcode); { ECPGdo(__LINE__, 1, 1, NULL, "select 1 from test where i = 14 ", ECPGt_EOIT, ECPGt_EORT); -#line 73 "test_informix.pgc" +#line 74 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 73 "test_informix.pgc" +#line 74 "test_informix.pgc" printf("Exists: %ld\n", sqlca.sqlcode); { ECPGdo(__LINE__, 1, 1, NULL, "select 1 from test where i = 147 ", ECPGt_EOIT, ECPGt_EORT); -#line 76 "test_informix.pgc" +#line 77 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 76 "test_informix.pgc" +#line 77 "test_informix.pgc" printf("Does not exist: %ld\n", sqlca.sqlcode); { ECPGtrans(__LINE__, NULL, "commit"); -#line 79 "test_informix.pgc" +#line 80 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 79 "test_informix.pgc" +#line 80 "test_informix.pgc" { ECPGdo(__LINE__, 1, 1, NULL, "drop table test ", ECPGt_EOIT, ECPGt_EORT); -#line 80 "test_informix.pgc" +#line 81 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 80 "test_informix.pgc" +#line 81 "test_informix.pgc" { 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" { ECPGdisconnect(__LINE__, "CURRENT"); -#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" return 0; @@ -230,10 +231,10 @@ static void openit(void) { ECPGdo(__LINE__, 1, 1, NULL, "declare c cursor for select * from test where i <= ? ", 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 90 "test_informix.pgc" +#line 91 "test_informix.pgc" if (sqlca.sqlcode < 0) dosqlprint ( );} -#line 90 "test_informix.pgc" +#line 91 "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 f6a850e2bce9a7f4582ba4ca1abe016ef206de90..2ec0c149d688d1a35209e166f5ed46321106d19c 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stderr @@ -2,93 +2,93 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ECPGconnect: opening database regress1 on <DEFAULT> port <DEFAULT> [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 22: QUERY: create table test ( i int primary key , j int ) on connection regress1 +[NO_PID]: ECPGexecute line 23: QUERY: create table test ( i int primary key , j int ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 22 Ok: CREATE TABLE +[NO_PID]: ECPGexecute line 23 Ok: CREATE TABLE [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 26: QUERY: insert into test ( i , j ) values( 7 , 0 ) on connection regress1 +[NO_PID]: ECPGexecute line 27: QUERY: insert into test ( i , j ) values( 7 , 0 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 26 Ok: INSERT 0 1 +[NO_PID]: ECPGexecute line 27 Ok: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGtrans line 27 action = commit connection = regress1 +[NO_PID]: ECPGtrans line 28 action = commit connection = regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 30: QUERY: insert into test ( i , j ) values( 7 , 12 ) on connection regress1 +[NO_PID]: ECPGexecute line 31: QUERY: insert into test ( i , j ) values( 7 , 12 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 30: Error: ERROR: duplicate key violates unique constraint "test_pkey" +[NO_PID]: ECPGexecute line 31: Error: ERROR: duplicate key violates unique constraint "test_pkey" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlstate 23505 (sqlcode: -239) in line 30, ''duplicate key violates unique constraint "test_pkey"' in line 30.'. +[NO_PID]: raising sqlstate 23505 (sqlcode: -239) in line 31, ''duplicate key violates unique constraint "test_pkey"' in line 31.'. [NO_PID]: sqlca: code: -239, state: 23505 -[NO_PID]: ECPGtrans line 32 action = rollback connection = regress1 +[NO_PID]: ECPGtrans line 33 action = rollback connection = regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 34: QUERY: insert into test ( i , j ) values( 14 , 1 ) on connection regress1 +[NO_PID]: ECPGexecute line 35: QUERY: insert into test ( i , j ) values( 14 , 1 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 34 Ok: INSERT 0 1 +[NO_PID]: ECPGexecute line 35 Ok: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGtrans line 35 action = commit connection = regress1 +[NO_PID]: ECPGtrans line 36 action = commit connection = regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 38: QUERY: select i from test where j = ( select j from test ) on connection regress1 +[NO_PID]: ECPGexecute line 39: QUERY: select i from test where j = ( select j from test ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 38: Error: ERROR: more than one row returned by a subquery used as an expression +[NO_PID]: ECPGexecute line 39: Error: ERROR: more than one row returned by a subquery used as an expression [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlstate 21000 (sqlcode: -284) in line 38, ''more than one row returned by a subquery used as an expression' in line 38.'. +[NO_PID]: raising sqlstate 21000 (sqlcode: -284) in line 39, ''more than one row returned by a subquery used as an expression' in line 39.'. [NO_PID]: sqlca: code: -284, state: 21000 -[NO_PID]: ECPGexecute line 41: QUERY: select i from test where j = ( select j from test limit 1 ) on connection regress1 +[NO_PID]: ECPGexecute line 42: QUERY: select i from test where j = ( select j from test limit 1 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 41: Error: ERROR: current transaction is aborted, commands ignored until end of transaction block +[NO_PID]: ECPGexecute line 42: Error: ERROR: current transaction is aborted, commands ignored until end of transaction block [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlstate 25P02 (sqlcode: -400) in line 41, ''current transaction is aborted, commands ignored until end of transaction block' in line 41.'. +[NO_PID]: raising sqlstate 25P02 (sqlcode: -400) in line 42, ''current transaction is aborted, commands ignored until end of transaction block' in line 42.'. [NO_PID]: sqlca: code: -400, state: 25P02 -[NO_PID]: ECPGtrans line 43 action = rollback connection = regress1 +[NO_PID]: ECPGtrans line 44 action = rollback connection = regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 90: QUERY: declare c cursor for select * from test where i <= 14 on connection regress1 +[NO_PID]: ECPGexecute line 91: QUERY: declare c cursor for select * from test where i <= 14 on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 90 Ok: DECLARE CURSOR +[NO_PID]: ECPGexecute line 91 Ok: DECLARE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52: QUERY: fetch forward from c on connection regress1 +[NO_PID]: ECPGexecute line 53: QUERY: fetch forward from c on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52: Correctly got 1 tuples with 2 fields +[NO_PID]: ECPGexecute line 53: Correctly got 1 tuples with 2 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 52: RESULT: 7 offset: 4 array: Yes +[NO_PID]: ECPGget_data line 53: RESULT: 7 offset: 4 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 52: RESULT: 0 offset: 52 array: Yes +[NO_PID]: ECPGget_data line 53: RESULT: 0 offset: 52 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52: QUERY: fetch forward from c on connection regress1 +[NO_PID]: ECPGexecute line 53: QUERY: fetch forward from c on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52: Correctly got 1 tuples with 2 fields +[NO_PID]: ECPGexecute line 53: Correctly got 1 tuples with 2 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 52: RESULT: 14 offset: 4 array: Yes +[NO_PID]: ECPGget_data line 53: RESULT: 14 offset: 4 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 52: RESULT: 1 offset: 52 array: Yes +[NO_PID]: ECPGget_data line 53: RESULT: 1 offset: 52 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52: QUERY: fetch forward from c on connection regress1 +[NO_PID]: ECPGexecute line 53: QUERY: fetch forward from c on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52: Correctly got 0 tuples with 2 fields +[NO_PID]: ECPGexecute line 53: Correctly got 0 tuples with 2 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode 100 in line 52, 'No data found in line 52.'. +[NO_PID]: raising sqlcode 100 in line 53, 'No data found in line 53.'. [NO_PID]: sqlca: code: 100, state: 02000 -[NO_PID]: ECPGexecute line 70: QUERY: delete from test where i = 21.0 on connection regress1 +[NO_PID]: ECPGexecute line 71: QUERY: delete from test where i = 21.0 on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70 Ok: DELETE 0 +[NO_PID]: ECPGexecute line 71 Ok: DELETE 0 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode 100 in line 70, 'No data found in line 70.'. +[NO_PID]: raising sqlcode 100 in line 71, 'No data found in line 71.'. [NO_PID]: sqlca: code: 100, state: 02000 -[NO_PID]: ECPGexecute line 73: QUERY: select 1 from test where i = 14 on connection regress1 +[NO_PID]: ECPGexecute line 74: QUERY: select 1 from test where i = 14 on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 73: Correctly got 1 tuples with 1 fields +[NO_PID]: ECPGexecute line 74: Correctly got 1 tuples with 1 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 76: QUERY: select 1 from test where i = 147 on connection regress1 +[NO_PID]: ECPGexecute line 77: QUERY: select 1 from test where i = 147 on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 76: Correctly got 0 tuples with 1 fields +[NO_PID]: ECPGexecute line 77: Correctly got 0 tuples with 1 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode 100 in line 76, 'No data found in line 76.'. +[NO_PID]: raising sqlcode 100 in line 77, 'No data found in line 77.'. [NO_PID]: sqlca: code: 100, state: 02000 -[NO_PID]: ECPGtrans line 79 action = commit connection = regress1 +[NO_PID]: ECPGtrans line 80 action = commit connection = regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 80: QUERY: drop table test on connection regress1 +[NO_PID]: ECPGexecute line 81: QUERY: drop table test on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 80 Ok: DROP TABLE +[NO_PID]: ECPGexecute line 81 Ok: DROP TABLE [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGtrans line 81 action = commit connection = regress1 +[NO_PID]: ECPGtrans line 82 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 141ccd43edf40a727848620dd5b4f8273b6a2d6d..d589abe09d0812147c85176e95a3ce0a7576a7e7 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stdout +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.stdout @@ -1,8 +1,8 @@ -doSQLprint: Error: 'duplicate key violates unique constraint "test_pkey"' in line 30. -INSERT: -239='duplicate key violates unique constraint "test_pkey"' in line 30. -doSQLprint: Error: 'more than one row returned by a subquery used as an expression' in line 38. -doSQLprint: Error: 'current transaction is aborted, commands ignored until end of transaction block' in line 41. -SELECT: -400='current transaction is aborted, commands ignored until end of transaction block' in line 41. +doSQLprint: Error: 'duplicate key violates unique constraint "test_pkey"' in line 31. +INSERT: -239='duplicate key violates unique constraint "test_pkey"' in line 31. +doSQLprint: Error: 'more than one row returned by a subquery used as an expression' in line 39. +doSQLprint: Error: 'current transaction is aborted, commands ignored until end of transaction block' in line 42. +SELECT: -400='current transaction is aborted, commands ignored until end of transaction block' in line 42. 7 0 14 1 DELETE: 100 diff --git a/src/interfaces/ecpg/test/expected/errors-init.c b/src/interfaces/ecpg/test/expected/errors-init.c index 2907a040256c650b750dab9078c5cc74408fcd10..f77aaf024f3f945d5e7b73f0b0d54f76ad6b62f8 100644 --- a/src/interfaces/ecpg/test/expected/errors-init.c +++ b/src/interfaces/ecpg/test/expected/errors-init.c @@ -82,40 +82,39 @@ struct sqlca_t *ECPGget_sqlca(void); enum e { ENUM0, ENUM1 }; struct sa { int member; }; -int -fa(void) +static int fa(void) { printf("in fa\n"); return 2; } -int +static int fb(int x) { printf("in fb (%d)\n", x); return x; } -int +static int fc(const char *x) { printf("in fc (%s)\n", x); return *x; } -int fd(const char *x,int i) +static int fd(const char *x,int i) { printf("in fd (%s, %d)\n", x, i); return (*x)*i; } -int fe(enum e x) +static int fe(enum e x) { printf("in fe (%d)\n", (int) x); return (int)x; } -void sqlnotice(char *notice, short trans) +static void sqlnotice(char *notice, short trans) { if (!notice) notice = "-empty-"; @@ -135,7 +134,7 @@ namespace N int main(void) { - struct sa x,*y; + struct sa x = { 14 },*y = &x; /* exec sql begin declare section */ @@ -151,43 +150,43 @@ int main(void) /* = 1L */ /* = 40000000000LL */ -#line 61 "init.pgc" +#line 60 "init.pgc" int a = ( int ) 2 ; -#line 62 "init.pgc" +#line 61 "init.pgc" int b = 2 + 2 ; -#line 63 "init.pgc" +#line 62 "init.pgc" int b2 = ( 14 * 7 ) ; -#line 64 "init.pgc" +#line 63 "init.pgc" int d = x . member ; -#line 65 "init.pgc" +#line 64 "init.pgc" int g = fb ( 2 ) ; -#line 66 "init.pgc" +#line 65 "init.pgc" int i = 3 ^ 1 ; -#line 67 "init.pgc" +#line 66 "init.pgc" int j = 1 ? 1 : 2 ; -#line 69 "init.pgc" +#line 68 "init.pgc" int e = y -> member ; -#line 70 "init.pgc" +#line 69 "init.pgc" int c = 10 >> 2 ; -#line 71 "init.pgc" +#line 70 "init.pgc" bool h = 2 || 1 ; -#line 72 "init.pgc" +#line 71 "init.pgc" long iay ; -#line 73 "init.pgc" +#line 72 "init.pgc" long long iax ; /* exec sql end declare section */ -#line 74 "init.pgc" +#line 73 "init.pgc" int f=fa(); @@ -196,68 +195,71 @@ int main(void) /* exec sql begin declare section */ /* compile error */ -#line 80 "init.pgc" +#line 79 "init.pgc" int k = N : : i ; /* exec sql end declare section */ -#line 81 "init.pgc" +#line 80 "init.pgc" #endif ECPGdebug(1, stderr); + printf("%d %d %d %d %d %d %d %d %d %d %d\n", a, b, b2, c, d, e, f, g, h, i, j); + iax = iay = 0; + printf("%ld %lld\n", iay, iax); /* exec sql whenever sqlerror do fa ( ) ; */ -#line 86 "init.pgc" +#line 88 "init.pgc" { ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); -#line 87 "init.pgc" +#line 89 "init.pgc" if (sqlca.sqlcode < 0) fa ( );} -#line 87 "init.pgc" +#line 89 "init.pgc" /* exec sql whenever sqlerror do fb ( 20 ) ; */ -#line 88 "init.pgc" +#line 90 "init.pgc" { ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); -#line 89 "init.pgc" +#line 91 "init.pgc" if (sqlca.sqlcode < 0) fb ( 20 );} -#line 89 "init.pgc" +#line 91 "init.pgc" /* exec sql whenever sqlerror do fc ( \"50\" ) ; */ -#line 90 "init.pgc" +#line 92 "init.pgc" { ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); -#line 91 "init.pgc" +#line 93 "init.pgc" if (sqlca.sqlcode < 0) fc ( "50" );} -#line 91 "init.pgc" +#line 93 "init.pgc" /* exec sql whenever sqlerror do fd ( \"50\" , 1 ) ; */ -#line 92 "init.pgc" +#line 94 "init.pgc" { ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); -#line 93 "init.pgc" +#line 95 "init.pgc" if (sqlca.sqlcode < 0) fd ( "50" , 1 );} -#line 93 "init.pgc" +#line 95 "init.pgc" /* exec sql whenever sqlerror do fe ( ENUM0 ) ; */ -#line 94 "init.pgc" +#line 96 "init.pgc" { ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); -#line 95 "init.pgc" +#line 97 "init.pgc" if (sqlca.sqlcode < 0) fe ( ENUM0 );} -#line 95 "init.pgc" +#line 97 "init.pgc" /* exec sql whenever sqlerror do sqlnotice ( NULL , 0 ) ; */ -#line 96 "init.pgc" +#line 98 "init.pgc" { ECPGdo(__LINE__, 0, 1, NULL, "select now () ", ECPGt_EOIT, ECPGt_EORT); -#line 97 "init.pgc" +#line 99 "init.pgc" if (sqlca.sqlcode < 0) sqlnotice ( NULL , 0 );} -#line 97 "init.pgc" +#line 99 "init.pgc" return 0; } diff --git a/src/interfaces/ecpg/test/expected/errors-init.stderr b/src/interfaces/ecpg/test/expected/errors-init.stderr index d42d8f062a1219df0d75dc2fc0a70ec1c91d388f..8db9bdaccc59e3d5fdd88692e0ce44a69696312c 100644 --- a/src/interfaces/ecpg/test/expected/errors-init.stderr +++ b/src/interfaces/ecpg/test/expected/errors-init.stderr @@ -1,7 +1,5 @@ [NO_PID]: ECPGdebug: set to 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode -220 in line 87, 'No such connection NULL in line 87.'. -[NO_PID]: sqlca: code: -220, state: 08003 [NO_PID]: raising sqlcode -220 in line 89, 'No such connection NULL in line 89.'. [NO_PID]: sqlca: code: -220, state: 08003 [NO_PID]: raising sqlcode -220 in line 91, 'No such connection NULL in line 91.'. @@ -12,3 +10,5 @@ [NO_PID]: sqlca: code: -220, state: 08003 [NO_PID]: raising sqlcode -220 in line 97, 'No such connection NULL in line 97.'. [NO_PID]: sqlca: code: -220, state: 08003 +[NO_PID]: raising sqlcode -220 in line 99, 'No such connection NULL in line 99.'. +[NO_PID]: sqlca: code: -220, state: 08003 diff --git a/src/interfaces/ecpg/test/expected/errors-init.stdout b/src/interfaces/ecpg/test/expected/errors-init.stdout index dc98d831671240ae8b13d267f26ac9e34d534938..358e64bf2e65754f5c84c8757a8c0cf38ac707b0 100644 --- a/src/interfaces/ecpg/test/expected/errors-init.stdout +++ b/src/interfaces/ecpg/test/expected/errors-init.stdout @@ -1,5 +1,7 @@ in fb (2) in fa +2 4 98 2 14 14 2 2 1 2 1 +0 0 in fa in fb (20) in fc (50) diff --git a/src/interfaces/ecpg/test/pg_regress.sh b/src/interfaces/ecpg/test/pg_regress.sh index 58726313e8ec0ef8d3fd5f1921b1e269e6f64753..34bd3965fbc72311f9816b4b815e813b09a54735 100644 --- a/src/interfaces/ecpg/test/pg_regress.sh +++ b/src/interfaces/ecpg/test/pg_regress.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.2 2006/08/03 13:11:03 meskes Exp $ +# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.3 2006/08/03 14:50:11 meskes Exp $ me=`basename $0` @@ -106,9 +106,9 @@ for i in \ # echo "$runprg > $outfile_stdout 2> $outfile_stderr" $runprg > "$outfile_stdout" 2> "$outfile_stderr" DIFFER="" - diff -c3 expected/$outprg.stderr "$outputdir"/$outprg.stderr >/dev/null 2>&1 || DIFFER="$DIFFER, log" - diff -c3 expected/$outprg.stdout "$outputdir"/$outprg.stdout >/dev/null 2>&1 || DIFFER="$DIFFER, output" - diff -c3 expected/$outprg.c "$outputdir"/$outprg.c >/dev/null 2>&1 || DIFFER="$DIFFER, source" + diff -C3 expected/$outprg.stderr "$outputdir"/$outprg.stderr >/dev/null 2>&1 || DIFFER="$DIFFER, log" + diff -C3 expected/$outprg.stdout "$outputdir"/$outprg.stdout >/dev/null 2>&1 || DIFFER="$DIFFER, output" + diff -C3 expected/$outprg.c "$outputdir"/$outprg.c >/dev/null 2>&1 || DIFFER="$DIFFER, source" DIFFER=${DIFFER#, } if [ "x$DIFFER" = "x" ]; then echo ok @@ -117,7 +117,7 @@ for i in \ fi done -diff -c3 -r expected/ $outputdir > regression.diff && rm regression.diff +diff -C3 -r expected/ $outputdir > regression.diff && rm regression.diff [ $? -ne 0 ] && exit