From 803d9c39dd0ed3556f057ebd787de095103819c7 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Thu, 7 Sep 2006 11:18:47 +0000 Subject: [PATCH] Changing a test case also changes the output that is expected. Float/Long aliasing doesn't work on all architecures. --- src/interfaces/ecpg/test/complex/test2.pgc | 8 +- .../ecpg/test/expected/complex-test2.c | 138 ++++++++------- .../ecpg/test/expected/complex-test2.stderr | 158 +++++++++--------- .../ecpg/test/expected/pgtypeslib-dt_test2.c | 3 +- .../test/expected/pgtypeslib-dt_test2.stdout | 1 - 5 files changed, 151 insertions(+), 157 deletions(-) diff --git a/src/interfaces/ecpg/test/complex/test2.pgc b/src/interfaces/ecpg/test/complex/test2.pgc index b36471f10a..282ef96e17 100644 --- a/src/interfaces/ecpg/test/complex/test2.pgc +++ b/src/interfaces/ecpg/test/complex/test2.pgc @@ -32,11 +32,9 @@ exec sql begin declare section; exec sql end declare section; exec sql char *married = NULL; - exec sql float ind_married; + exec sql long ind_married; exec sql ind children; - exec sql var ind_married is long; - char msg[128]; ECPGdebug(1, stderr); @@ -73,7 +71,7 @@ exec sql end declare section; printf(", born %ld", personal.birth.born); if (i->ind_birth.age >= 0) printf(", age = %d", personal.birth.age); - if ((long)ind_married >= 0) + if (ind_married >= 0) printf(", married %s", married); if (ind_children.smallint >= 0) printf(", children = %d", children.integer); @@ -103,7 +101,7 @@ exec sql end declare section; printf(", born %ld", personal.birth.born); if (ind_personal.ind_birth.age >= 0) printf(", age = %d", personal.birth.age); - if ((long)ind_married >= 0) + if (ind_married >= 0) printf(", married %s", married); if (ind_children.smallint >= 0) printf(", children = %d", children.integer); diff --git a/src/interfaces/ecpg/test/expected/complex-test2.c b/src/interfaces/ecpg/test/expected/complex-test2.c index d11a1c3337..eb72606b77 100644 --- a/src/interfaces/ecpg/test/expected/complex-test2.c +++ b/src/interfaces/ecpg/test/expected/complex-test2.c @@ -148,7 +148,7 @@ main (void) #line 35 "test2.pgc" - float ind_married ; + long ind_married ; #line 35 "test2.pgc" @@ -159,107 +159,103 @@ main (void) #line 36 "test2.pgc" - /* exec sql var ind_married is long */ -#line 38 "test2.pgc" - - char msg[128]; ECPGdebug(1, stderr); strcpy(msg, "connect"); { ECPGconnect(__LINE__, 0, "regress1" , NULL,NULL , NULL, 0); -#line 45 "test2.pgc" +#line 43 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 45 "test2.pgc" +#line 43 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 45 "test2.pgc" +#line 43 "test2.pgc" strcpy(msg, "create"); { ECPGdo(__LINE__, 0, 1, NULL, "create table meskes ( name char ( 8 ) , born integer , age smallint , married date , children integer ) ", ECPGt_EOIT, ECPGt_EORT); -#line 48 "test2.pgc" +#line 46 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 48 "test2.pgc" +#line 46 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 48 "test2.pgc" +#line 46 "test2.pgc" strcpy(msg, "insert"); - { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , married , children ) values( 'Petra' , '19900404' , 3 ) ", ECPGt_EOIT, ECPGt_EORT); -#line 51 "test2.pgc" + { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , married , children ) values ( 'Petra' , '19900404' , 3 ) ", ECPGt_EOIT, ECPGt_EORT); +#line 49 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 51 "test2.pgc" +#line 49 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 51 "test2.pgc" +#line 49 "test2.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 ) ", ECPGt_EOIT, ECPGt_EORT); -#line 52 "test2.pgc" + { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age , married , children ) values ( 'Michael' , 19660117 , 35 , '19900404' , 3 ) ", ECPGt_EOIT, ECPGt_EORT); +#line 50 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 52 "test2.pgc" +#line 50 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 52 "test2.pgc" +#line 50 "test2.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 ) ", ECPGt_EOIT, ECPGt_EORT); -#line 53 "test2.pgc" + { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values ( 'Carsten' , 19910103 , 10 ) ", ECPGt_EOIT, ECPGt_EORT); +#line 51 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 53 "test2.pgc" +#line 51 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 53 "test2.pgc" +#line 51 "test2.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 ) ", ECPGt_EOIT, ECPGt_EORT); -#line 54 "test2.pgc" + { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values ( 'Marc' , 19930907 , 8 ) ", ECPGt_EOIT, ECPGt_EORT); +#line 52 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 54 "test2.pgc" +#line 52 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 54 "test2.pgc" +#line 52 "test2.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 ) ", ECPGt_EOIT, ECPGt_EORT); -#line 55 "test2.pgc" + { ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values ( 'Chris' , 19970923 , 4 ) ", ECPGt_EOIT, ECPGt_EORT); +#line 53 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 55 "test2.pgc" +#line 53 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 55 "test2.pgc" +#line 53 "test2.pgc" strcpy(msg, "commit"); { ECPGtrans(__LINE__, NULL, "commit"); -#line 58 "test2.pgc" +#line 56 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 58 "test2.pgc" +#line 56 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 58 "test2.pgc" +#line 56 "test2.pgc" strcpy(msg, "open"); { ECPGdo(__LINE__, 0, 1, NULL, "declare cur cursor for select name , born , age , married , children from meskes ", ECPGt_EOIT, ECPGt_EORT); -#line 61 "test2.pgc" +#line 59 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 61 "test2.pgc" +#line 59 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 61 "test2.pgc" +#line 59 "test2.pgc" /* exec sql whenever not found break ; */ -#line 63 "test2.pgc" +#line 61 "test2.pgc" p=&personal; @@ -278,23 +274,23 @@ if (sqlca.sqlcode < 0) Finish ( msg );} ECPGt_long,&(ind_married),(long)1,(long)1,sizeof(long), ECPGt_int,&(children.integer),(long)1,(long)1,sizeof(int), ECPGt_short,&(ind_children.smallint),(long)1,(long)1,sizeof(short), ECPGt_EORT); -#line 70 "test2.pgc" +#line 68 "test2.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) break; -#line 70 "test2.pgc" +#line 68 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 70 "test2.pgc" +#line 68 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 70 "test2.pgc" +#line 68 "test2.pgc" printf("%8.8s", personal.name.arr); if (i->ind_birth.born >= 0) printf(", born %ld", personal.birth.born); if (i->ind_birth.age >= 0) printf(", age = %d", personal.birth.age); - if ((long)ind_married >= 0) + if (ind_married >= 0) printf(", married %s", married); if (ind_children.smallint >= 0) printf(", children = %d", children.integer); @@ -306,27 +302,27 @@ if (sqlca.sqlcode < 0) Finish ( msg );} strcpy(msg, "close"); { ECPGdo(__LINE__, 0, 1, NULL, "close cur", ECPGt_EOIT, ECPGt_EORT); -#line 87 "test2.pgc" +#line 85 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 87 "test2.pgc" +#line 85 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 87 "test2.pgc" +#line 85 "test2.pgc" /* and now a same query with prepare */ { ECPGprepare(__LINE__, "MM" , query); -#line 90 "test2.pgc" +#line 88 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 90 "test2.pgc" +#line 88 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 90 "test2.pgc" +#line 88 "test2.pgc" /* declare prep cursor for ? */ -#line 91 "test2.pgc" +#line 89 "test2.pgc" strcpy(msg, "open"); @@ -335,17 +331,17 @@ if (sqlca.sqlcode < 0) Finish ( msg );} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_const,"'Petra'",(long)7,(long)1,strlen("'Petra'"), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 94 "test2.pgc" +#line 92 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 94 "test2.pgc" +#line 92 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 94 "test2.pgc" +#line 92 "test2.pgc" /* exec sql whenever not found break ; */ -#line 96 "test2.pgc" +#line 94 "test2.pgc" while (1) { @@ -361,23 +357,23 @@ if (sqlca.sqlcode < 0) Finish ( msg );} ECPGt_long,&(ind_married),(long)1,(long)1,sizeof(long), ECPGt_int,&(children.integer),(long)1,(long)1,sizeof(int), ECPGt_short,&(ind_children.smallint),(long)1,(long)1,sizeof(short), ECPGt_EORT); -#line 100 "test2.pgc" +#line 98 "test2.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) break; -#line 100 "test2.pgc" +#line 98 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 100 "test2.pgc" +#line 98 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 100 "test2.pgc" +#line 98 "test2.pgc" printf("%8.8s", personal.name.arr); if (ind_personal.ind_birth.born >= 0) printf(", born %ld", personal.birth.born); if (ind_personal.ind_birth.age >= 0) printf(", age = %d", personal.birth.age); - if ((long)ind_married >= 0) + if (ind_married >= 0) printf(", married %s", married); if (ind_children.smallint >= 0) printf(", children = %d", children.integer); @@ -388,46 +384,46 @@ if (sqlca.sqlcode < 0) Finish ( msg );} strcpy(msg, "close"); { ECPGdo(__LINE__, 0, 1, NULL, "close prep", ECPGt_EOIT, ECPGt_EORT); -#line 116 "test2.pgc" +#line 114 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 116 "test2.pgc" +#line 114 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 116 "test2.pgc" +#line 114 "test2.pgc" strcpy(msg, "drop"); { ECPGdo(__LINE__, 0, 1, NULL, "drop table meskes ", ECPGt_EOIT, ECPGt_EORT); -#line 119 "test2.pgc" +#line 117 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 119 "test2.pgc" +#line 117 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 119 "test2.pgc" +#line 117 "test2.pgc" strcpy(msg, "commit"); { ECPGtrans(__LINE__, NULL, "commit"); -#line 122 "test2.pgc" +#line 120 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 122 "test2.pgc" +#line 120 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 122 "test2.pgc" +#line 120 "test2.pgc" strcpy(msg, "disconnect"); { ECPGdisconnect(__LINE__, "CURRENT"); -#line 125 "test2.pgc" +#line 123 "test2.pgc" if (sqlca.sqlwarn[0] == 'W') warn ( ); -#line 125 "test2.pgc" +#line 123 "test2.pgc" if (sqlca.sqlcode < 0) Finish ( msg );} -#line 125 "test2.pgc" +#line 123 "test2.pgc" return (0); diff --git a/src/interfaces/ecpg/test/expected/complex-test2.stderr b/src/interfaces/ecpg/test/expected/complex-test2.stderr index 34e45ac139..79c1c836bf 100644 --- a/src/interfaces/ecpg/test/expected/complex-test2.stderr +++ b/src/interfaces/ecpg/test/expected/complex-test2.stderr @@ -2,163 +2,163 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ECPGconnect: opening database regress1 on port [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 48: QUERY: create table meskes ( name char ( 8 ) , born integer , age smallint , married date , children integer ) on connection regress1 +[NO_PID]: ECPGexecute line 46: QUERY: create table meskes ( name char ( 8 ) , born integer , age smallint , married date , children integer ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 48 Ok: CREATE TABLE +[NO_PID]: ECPGexecute line 46 Ok: CREATE TABLE [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 51: QUERY: insert into meskes ( name , married , children ) values( 'Petra' , '19900404' , 3 ) on connection regress1 +[NO_PID]: ECPGexecute line 49: QUERY: insert into meskes ( name , married , children ) values ( 'Petra' , '19900404' , 3 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 51 Ok: INSERT 0 1 +[NO_PID]: ECPGexecute line 49 Ok: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52: QUERY: insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 ) on connection regress1 +[NO_PID]: ECPGexecute line 50: QUERY: insert into meskes ( name , born , age , married , children ) values ( 'Michael' , 19660117 , 35 , '19900404' , 3 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1 +[NO_PID]: ECPGexecute line 50 Ok: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 53: QUERY: insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 ) on connection regress1 +[NO_PID]: ECPGexecute line 51: QUERY: insert into meskes ( name , born , age ) values ( 'Carsten' , 19910103 , 10 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 53 Ok: INSERT 0 1 +[NO_PID]: ECPGexecute line 51 Ok: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 54: QUERY: insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 ) on connection regress1 +[NO_PID]: ECPGexecute line 52: QUERY: insert into meskes ( name , born , age ) values ( 'Marc' , 19930907 , 8 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 54 Ok: INSERT 0 1 +[NO_PID]: ECPGexecute line 52 Ok: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 55: QUERY: insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 ) on connection regress1 +[NO_PID]: ECPGexecute line 53: QUERY: insert into meskes ( name , born , age ) values ( 'Chris' , 19970923 , 4 ) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 55 Ok: INSERT 0 1 +[NO_PID]: ECPGexecute line 53 Ok: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGtrans line 58 action = commit connection = regress1 +[NO_PID]: ECPGtrans line 56 action = commit connection = regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 61: QUERY: declare cur cursor for select name , born , age , married , children from meskes on connection regress1 +[NO_PID]: ECPGexecute line 59: QUERY: declare cur cursor for select name , born , age , married , children from meskes on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 61 Ok: DECLARE CURSOR +[NO_PID]: ECPGexecute line 59 Ok: DECLARE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: QUERY: fetch cur on connection regress1 +[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: Correctly got 1 tuples with 5 fields +[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: Petra offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: Petra offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGstore_result: line 70: allocating memory for 1 tuples +[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 04-04-1990 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 04-04-1990 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 3 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 3 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: QUERY: fetch cur on connection regress1 +[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: Correctly got 1 tuples with 5 fields +[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: Michael offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: Michael offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 19660117 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 19660117 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 35 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 35 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGstore_result: line 70: allocating memory for 1 tuples +[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 04-04-1990 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 04-04-1990 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 3 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 3 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: QUERY: fetch cur on connection regress1 +[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: Correctly got 1 tuples with 5 fields +[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: Carsten offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: Carsten offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 19910103 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 19910103 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 10 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 10 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGstore_result: line 70: allocating memory for 1 tuples +[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: QUERY: fetch cur on connection regress1 +[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: Correctly got 1 tuples with 5 fields +[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: Marc offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: Marc offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 19930907 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 19930907 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 8 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 8 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGstore_result: line 70: allocating memory for 1 tuples +[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: QUERY: fetch cur on connection regress1 +[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: Correctly got 1 tuples with 5 fields +[NO_PID]: ECPGexecute line 68: Correctly got 1 tuples with 5 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: Chris offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: Chris offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 19970923 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 19970923 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: 4 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: 4 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGstore_result: line 70: allocating memory for 1 tuples +[NO_PID]: ECPGstore_result: line 68: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 70: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 68: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: QUERY: fetch cur on connection regress1 +[NO_PID]: ECPGexecute line 68: QUERY: fetch cur on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 70: Correctly got 0 tuples with 5 fields +[NO_PID]: ECPGexecute line 68: Correctly got 0 tuples with 5 fields [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 68, 'No data found in line 68.'. [NO_PID]: sqlca: code: 100, state: 02000 -[NO_PID]: ECPGexecute line 87: QUERY: close cur on connection regress1 +[NO_PID]: ECPGexecute line 85: QUERY: close cur on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 87 Ok: CLOSE CURSOR +[NO_PID]: ECPGexecute line 85 Ok: CLOSE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGprepare line 90: QUERY: select name, born, age, married, children from meskes where name = ? +[NO_PID]: ECPGprepare line 88: QUERY: select name, born, age, married, children from meskes where name = ? [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 94: QUERY: declare prep cursor for select name, born, age, married, children from meskes where name = 'Petra' on connection regress1 +[NO_PID]: ECPGexecute line 92: QUERY: declare prep cursor for select name, born, age, married, children from meskes where name = 'Petra' on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 94 Ok: DECLARE CURSOR +[NO_PID]: ECPGexecute line 92 Ok: DECLARE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 100: QUERY: fetch in prep on connection regress1 +[NO_PID]: ECPGexecute line 98: QUERY: fetch in prep on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 100: Correctly got 1 tuples with 5 fields +[NO_PID]: ECPGexecute line 98: Correctly got 1 tuples with 5 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 100: RESULT: Petra offset: -1 array: Yes +[NO_PID]: ECPGget_data line 98: RESULT: Petra offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 100: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 98: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 100: RESULT: offset: -1 array: Yes +[NO_PID]: ECPGget_data line 98: RESULT: offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGstore_result: line 100: allocating memory for 1 tuples +[NO_PID]: ECPGstore_result: line 98: allocating memory for 1 tuples [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 100: RESULT: 04-04-1990 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 98: RESULT: 04-04-1990 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGget_data line 100: RESULT: 3 offset: -1 array: Yes +[NO_PID]: ECPGget_data line 98: RESULT: 3 offset: -1 array: Yes [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 100: QUERY: fetch in prep on connection regress1 +[NO_PID]: ECPGexecute line 98: QUERY: fetch in prep on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 100: Correctly got 0 tuples with 5 fields +[NO_PID]: ECPGexecute line 98: Correctly got 0 tuples with 5 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: raising sqlcode 100 in line 100, 'No data found in line 100.'. +[NO_PID]: raising sqlcode 100 in line 98, 'No data found in line 98.'. [NO_PID]: sqlca: code: 100, state: 02000 -[NO_PID]: ECPGexecute line 116: QUERY: close prep on connection regress1 +[NO_PID]: ECPGexecute line 114: QUERY: close prep on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 116 Ok: CLOSE CURSOR +[NO_PID]: ECPGexecute line 114 Ok: CLOSE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 119: QUERY: drop table meskes on connection regress1 +[NO_PID]: ECPGexecute line 117: QUERY: drop table meskes on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGexecute line 119 Ok: DROP TABLE +[NO_PID]: ECPGexecute line 117 Ok: DROP TABLE [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGtrans line 122 action = commit connection = regress1 +[NO_PID]: ECPGtrans line 120 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/pgtypeslib-dt_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c index 4a30736e78..c92f354ec4 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c @@ -127,7 +127,8 @@ main(void) sprintf(t, "%s %s", dates[i], times[j]); ts1 = PGTYPEStimestamp_from_asc(t, NULL); text = PGTYPEStimestamp_to_asc(ts1); - printf("TS[%d,%d]: %s\n", + if (i != 19 || j != 3) /* timestamp as integer or double differ for this case */ + printf("TS[%d,%d]: %s\n", i, j, errno ? "-" : text); free(text); } diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout index d52555f510..1a40893aed 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.stdout @@ -87,7 +87,6 @@ Date[19]: 0099-01-08 BC (N - F) TS[19,0]: 0099-01-08 00:04:00 BC TS[19,1]: 0099-01-08 01:59:00 BC TS[19,2]: 0099-01-08 13:24:40 BC -TS[19,3]: 0099-01-08 13:24:40.495 BC interval[0]: @ 1 min interval[1]: @ 1 day 12 hours 59 mins 10 secs interval[2]: @ 2 days 12 hours 59 mins 10 secs -- 2.40.0