From: Michael Meskes Date: Thu, 9 Jan 2014 15:18:12 +0000 (+0100) Subject: Changed regression test to ecpg test suite for alignment problem just with last X-Git-Tag: REL9_4_BETA1~712 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=192b4aacad45c16a8a9341644479125977366dab;p=postgresql Changed regression test to ecpg test suite for alignment problem just with last commit. --- diff --git a/src/interfaces/ecpg/test/expected/sql-desc.c b/src/interfaces/ecpg/test/expected/sql-desc.c index 7a384acd0d..b416b2fb87 100644 --- a/src/interfaces/ecpg/test/expected/sql-desc.c +++ b/src/interfaces/ecpg/test/expected/sql-desc.c @@ -34,6 +34,7 @@ main(void) + #line 8 "desc.pgc" char * stmt1 = "INSERT INTO test1 VALUES ($1, $2)" ; @@ -58,167 +59,170 @@ main(void) #line 16 "desc.pgc" int ind1 , ind2 ; -/* exec sql end declare section */ + #line 17 "desc.pgc" + char desc1 [ 8 ] = "outdesc" ; +/* exec sql end declare section */ +#line 18 "desc.pgc" ECPGdebug(1, stderr); ECPGallocate_desc(__LINE__, "indesc"); -#line 21 "desc.pgc" +#line 22 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint(); -#line 21 "desc.pgc" - - ECPGallocate_desc(__LINE__, "outdesc"); #line 22 "desc.pgc" + ECPGallocate_desc(__LINE__, (desc1)); +#line 23 "desc.pgc" + if (sqlca.sqlcode < 0) sqlprint(); -#line 22 "desc.pgc" +#line 23 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 1,ECPGd_data, ECPGt_int,&(val1),(long)1,(long)1,sizeof(int), ECPGd_EODT); -#line 24 "desc.pgc" +#line 25 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 24 "desc.pgc" +#line 25 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 2,ECPGd_data, ECPGt_char,(val2),(long)4,(long)1,(4)*sizeof(char), ECPGd_indicator, ECPGt_int,&(val2i),(long)1,(long)1,sizeof(int), ECPGd_EODT); -#line 25 "desc.pgc" +#line 26 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 25 "desc.pgc" +#line 26 "desc.pgc" { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); -#line 27 "desc.pgc" +#line 28 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 27 "desc.pgc" +#line 28 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test1 ( a int , b text )", ECPGt_EOIT, ECPGt_EORT); -#line 29 "desc.pgc" - -if (sqlca.sqlcode < 0) sqlprint();} -#line 29 "desc.pgc" - - { ECPGprepare(__LINE__, NULL, 0, "foo1", stmt1); #line 30 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} #line 30 "desc.pgc" - { ECPGprepare(__LINE__, NULL, 0, "Foo-1", stmt1); + { ECPGprepare(__LINE__, NULL, 0, "foo1", stmt1); #line 31 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} #line 31 "desc.pgc" - { ECPGprepare(__LINE__, NULL, 0, "foo2", stmt2); + { ECPGprepare(__LINE__, NULL, 0, "Foo-1", stmt1); #line 32 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} #line 32 "desc.pgc" - { ECPGprepare(__LINE__, NULL, 0, "foo3", stmt3); + { ECPGprepare(__LINE__, NULL, 0, "foo2", stmt2); #line 33 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} #line 33 "desc.pgc" + { ECPGprepare(__LINE__, NULL, 0, "foo3", stmt3); +#line 34 "desc.pgc" + +if (sqlca.sqlcode < 0) sqlprint();} +#line 34 "desc.pgc" + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo1", ECPGt_descriptor, "indesc", 1L, 1L, 1L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 35 "desc.pgc" +#line 36 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 35 "desc.pgc" +#line 36 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 1,ECPGd_data, ECPGt_const,"2",(long)1,(long)1,strlen("2"), ECPGd_EODT); -#line 37 "desc.pgc" +#line 38 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 37 "desc.pgc" +#line 38 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 2,ECPGd_data, ECPGt_char,(val2),(long)4,(long)1,(4)*sizeof(char), ECPGd_indicator, ECPGt_int,&(val2null),(long)1,(long)1,sizeof(int), ECPGd_EODT); -#line 38 "desc.pgc" +#line 39 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 38 "desc.pgc" +#line 39 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo1", ECPGt_descriptor, "indesc", 1L, 1L, 1L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 40 "desc.pgc" +#line 41 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 40 "desc.pgc" +#line 41 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 1,ECPGd_data, ECPGt_const,"3",(long)1,(long)1,strlen("3"), ECPGd_EODT); -#line 42 "desc.pgc" +#line 43 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 42 "desc.pgc" +#line 43 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 2,ECPGd_data, ECPGt_const,"this is a long test",(long)19,(long)1,strlen("this is a long test"), ECPGd_indicator, ECPGt_int,&(val1),(long)1,(long)1,sizeof(int), ECPGd_EODT); -#line 43 "desc.pgc" +#line 44 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 43 "desc.pgc" +#line 44 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "Foo-1", ECPGt_descriptor, "indesc", 1L, 1L, 1L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 45 "desc.pgc" +#line 46 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 45 "desc.pgc" +#line 46 "desc.pgc" { ECPGdeallocate(__LINE__, 0, NULL, "Foo-1"); -#line 47 "desc.pgc" +#line 48 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 47 "desc.pgc" +#line 48 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 1,ECPGd_data, ECPGt_int,&(val1),(long)1,(long)1,sizeof(int), ECPGd_EODT); -#line 49 "desc.pgc" +#line 50 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 49 "desc.pgc" +#line 50 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 2,ECPGd_data, ECPGt_char,(val2),(long)4,(long)1,(4)*sizeof(char), ECPGd_indicator, ECPGt_int,&(val2i),(long)1,(long)1,sizeof(int), ECPGd_EODT); -#line 50 "desc.pgc" +#line 51 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 50 "desc.pgc" +#line 51 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo2", @@ -226,34 +230,34 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_descriptor, "outdesc", 1L, 1L, 1L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); -#line 52 "desc.pgc" +#line 53 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 52 "desc.pgc" +#line 53 "desc.pgc" { ECPGget_desc(__LINE__, "outdesc", 1,ECPGd_data, ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), ECPGd_EODT); -#line 54 "desc.pgc" +#line 55 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 54 "desc.pgc" +#line 55 "desc.pgc" printf("output = %s\n", val2output); /* declare c1 cursor for $1 */ -#line 57 "desc.pgc" +#line 58 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c1 cursor for $1", ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_descriptor, "indesc", 1L, 1L, 1L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 58 "desc.pgc" +#line 59 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 58 "desc.pgc" +#line 59 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch next from c1", ECPGt_EOIT, @@ -261,49 +265,49 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_int,&(ind1),(long)1,(long)1,sizeof(int), ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), ECPGt_int,&(ind2),(long)1,(long)1,sizeof(int), ECPGt_EORT); -#line 60 "desc.pgc" +#line 61 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 60 "desc.pgc" +#line 61 "desc.pgc" printf("val1=%d (ind1: %d) val2=%s (ind2: %d)\n", val1output, ind1, val2output, ind2); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close c1", ECPGt_EOIT, ECPGt_EORT); -#line 64 "desc.pgc" +#line 65 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 64 "desc.pgc" +#line 65 "desc.pgc" { ECPGset_desc_header(__LINE__, "indesc", (int)(1)); -#line 66 "desc.pgc" +#line 67 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 66 "desc.pgc" +#line 67 "desc.pgc" { ECPGset_desc(__LINE__, "indesc", 1,ECPGd_data, ECPGt_const,"2",(long)1,(long)1,strlen("2"), ECPGd_EODT); -#line 67 "desc.pgc" +#line 68 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 67 "desc.pgc" +#line 68 "desc.pgc" /* declare c2 cursor for $1 */ -#line 69 "desc.pgc" +#line 70 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare c2 cursor for $1", ECPGt_char_variable,(ECPGprepared_statement(NULL, "foo3", __LINE__)),(long)1,(long)1,(1)*sizeof(char), ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_descriptor, "indesc", 1L, 1L, 1L, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); -#line 70 "desc.pgc" +#line 71 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 70 "desc.pgc" +#line 71 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch next from c2", ECPGt_EOIT, @@ -311,18 +315,18 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), ECPGt_int,&(val2i),(long)1,(long)1,sizeof(int), ECPGt_EORT); -#line 72 "desc.pgc" +#line 73 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 72 "desc.pgc" +#line 73 "desc.pgc" printf("val1=%d val2=%s\n", val1output, val2i ? "null" : val2output); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close c2", ECPGt_EOIT, ECPGt_EORT); -#line 75 "desc.pgc" +#line 76 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 75 "desc.pgc" +#line 76 "desc.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from test1 where a = 3", ECPGt_EOIT, @@ -330,43 +334,43 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_char,(val2output),(long)sizeof("AAA"),(long)1,(sizeof("AAA"))*sizeof(char), ECPGt_int,&(val2i),(long)1,(long)1,sizeof(int), ECPGt_EORT); -#line 77 "desc.pgc" +#line 78 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 77 "desc.pgc" +#line 78 "desc.pgc" printf("val1=%d val2=%c%c%c%c warn=%c truncate=%d\n", val1output, val2output[0], val2output[1], val2output[2], val2output[3], sqlca.sqlwarn[0], val2i); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table test1", ECPGt_EOIT, ECPGt_EORT); -#line 80 "desc.pgc" +#line 81 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 80 "desc.pgc" +#line 81 "desc.pgc" { ECPGdeallocate_all(__LINE__, 0, NULL); -#line 81 "desc.pgc" +#line 82 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 81 "desc.pgc" +#line 82 "desc.pgc" { ECPGdisconnect(__LINE__, "CURRENT"); -#line 82 "desc.pgc" +#line 83 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 82 "desc.pgc" +#line 83 "desc.pgc" ECPGdeallocate_desc(__LINE__, "indesc"); -#line 84 "desc.pgc" +#line 85 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint(); -#line 84 "desc.pgc" +#line 85 "desc.pgc" ECPGdeallocate_desc(__LINE__, "outdesc"); -#line 85 "desc.pgc" +#line 86 "desc.pgc" if (sqlca.sqlcode < 0) sqlprint(); -#line 85 "desc.pgc" +#line 86 "desc.pgc" return 0; diff --git a/src/interfaces/ecpg/test/expected/sql-desc.stderr b/src/interfaces/ecpg/test/expected/sql-desc.stderr index ef113835b7..f4db5e0161 100644 --- a/src/interfaces/ecpg/test/expected/sql-desc.stderr +++ b/src/interfaces/ecpg/test/expected/sql-desc.stderr @@ -2,139 +2,139 @@ [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ECPGconnect: opening database regress1 on port [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 29: query: create table test1 ( a int , b text ); with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 30: query: create table test1 ( a int , b text ); with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 29: using PQexec +[NO_PID]: ecpg_execute on line 30: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 29: OK: CREATE TABLE +[NO_PID]: ecpg_execute on line 30: OK: CREATE TABLE [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: prepare_common on line 30: name foo1; query: "INSERT INTO test1 VALUES ($1, $2)" +[NO_PID]: prepare_common on line 31: name foo1; query: "INSERT INTO test1 VALUES ($1, $2)" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: prepare_common on line 31: name Foo-1; query: "INSERT INTO test1 VALUES ($1, $2)" +[NO_PID]: prepare_common on line 32: name Foo-1; query: "INSERT INTO test1 VALUES ($1, $2)" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: prepare_common on line 32: name foo2; query: "SELECT * from test1 where a = $1 and b = $2" +[NO_PID]: prepare_common on line 33: name foo2; query: "SELECT * from test1 where a = $1 and b = $2" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: prepare_common on line 33: name foo3; query: "SELECT * from test1 where $1 = a" +[NO_PID]: prepare_common on line 34: name foo3; query: "SELECT * from test1 where $1 = a" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 35: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 36: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 35: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)" +[NO_PID]: ecpg_execute on line 36: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 35: parameter 1 = 1 +[NO_PID]: free_params on line 36: parameter 1 = 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 35: parameter 2 = one +[NO_PID]: free_params on line 36: parameter 2 = one [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]: ecpg_execute on line 40: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 41: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 40: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)" +[NO_PID]: ecpg_execute on line 41: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 40: parameter 1 = 2 +[NO_PID]: free_params on line 41: parameter 1 = 2 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 40: parameter 2 = null +[NO_PID]: free_params on line 41: parameter 2 = null [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 40: OK: INSERT 0 1 +[NO_PID]: ecpg_execute on line 41: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 45: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 46: query: INSERT INTO test1 VALUES ($1, $2); with 2 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 45: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)" +[NO_PID]: ecpg_execute on line 46: using PQexecPrepared for "INSERT INTO test1 VALUES ($1, $2)" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 45: parameter 1 = 3 +[NO_PID]: free_params on line 46: parameter 1 = 3 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 45: parameter 2 = this is a long test +[NO_PID]: free_params on line 46: parameter 2 = this is a long test [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 45: OK: INSERT 0 1 +[NO_PID]: ecpg_execute on line 46: OK: INSERT 0 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: deallocate_one on line 47: name Foo-1 +[NO_PID]: deallocate_one on line 48: name Foo-1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 52: query: SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 53: query: SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 52: using PQexecPrepared for "SELECT * from test1 where a = $1 and b = $2" +[NO_PID]: ecpg_execute on line 53: using PQexecPrepared for "SELECT * from test1 where a = $1 and b = $2" [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 52: parameter 1 = 1 +[NO_PID]: free_params on line 53: parameter 1 = 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 52: parameter 2 = one +[NO_PID]: free_params on line 53: parameter 2 = one [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 52: correctly got 1 tuples with 2 fields +[NO_PID]: ecpg_execute on line 53: correctly got 1 tuples with 2 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 52: putting result (1 tuples) into descriptor outdesc +[NO_PID]: ecpg_execute on line 53: putting result (1 tuples) into descriptor outdesc [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ECPGget_desc: reading items for tuple 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 54: RESULT: 1 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 55: RESULT: 1 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 58: query: declare c1 cursor for SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 59: query: declare c1 cursor for SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 58: using PQexecParams +[NO_PID]: ecpg_execute on line 59: using PQexecParams [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 58: parameter 1 = 1 +[NO_PID]: free_params on line 59: parameter 1 = 1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 58: parameter 2 = one +[NO_PID]: free_params on line 59: parameter 2 = one [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 58: OK: DECLARE CURSOR +[NO_PID]: ecpg_execute on line 59: OK: DECLARE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 60: query: fetch next from c1; with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 61: query: fetch next from c1; with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 60: using PQexec +[NO_PID]: ecpg_execute on line 61: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 60: correctly got 1 tuples with 2 fields +[NO_PID]: ecpg_execute on line 61: correctly got 1 tuples with 2 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 60: RESULT: 1 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 61: RESULT: 1 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 60: RESULT: one offset: -1; array: no +[NO_PID]: ecpg_get_data on line 61: RESULT: one offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 64: query: close c1; with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 65: query: close c1; with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 64: using PQexec +[NO_PID]: ecpg_execute on line 65: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 64: OK: CLOSE CURSOR +[NO_PID]: ecpg_execute on line 65: OK: CLOSE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 70: query: declare c2 cursor for SELECT * from test1 where $1 = a; with 1 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 71: query: declare c2 cursor for SELECT * from test1 where $1 = a; with 1 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 70: using PQexecParams +[NO_PID]: ecpg_execute on line 71: using PQexecParams [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: free_params on line 70: parameter 1 = 2 +[NO_PID]: free_params on line 71: parameter 1 = 2 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 70: OK: DECLARE CURSOR +[NO_PID]: ecpg_execute on line 71: OK: DECLARE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 72: query: fetch next from c2; with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 73: query: fetch next from c2; with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 72: using PQexec +[NO_PID]: ecpg_execute on line 73: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 72: correctly got 1 tuples with 2 fields +[NO_PID]: ecpg_execute on line 73: correctly got 1 tuples with 2 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 72: RESULT: 2 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 73: RESULT: 2 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 72: RESULT: offset: -1; array: no +[NO_PID]: ecpg_get_data on line 73: RESULT: offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 75: query: close c2; with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 76: query: close c2; 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: OK: CLOSE CURSOR +[NO_PID]: ecpg_execute on line 76: OK: CLOSE CURSOR [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 77: query: select * from test1 where a = 3; with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 78: query: select * from test1 where a = 3; with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 77: using PQexec +[NO_PID]: ecpg_execute on line 78: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 77: correctly got 1 tuples with 2 fields +[NO_PID]: ecpg_execute on line 78: correctly got 1 tuples with 2 fields [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 77: RESULT: 3 offset: -1; array: no +[NO_PID]: ecpg_get_data on line 78: RESULT: 3 offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_get_data on line 77: RESULT: this is a long test offset: -1; array: no +[NO_PID]: ecpg_get_data on line 78: RESULT: this is a long test offset: -1; array: no [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 80: query: drop table test1; with 0 parameter(s) on connection regress1 +[NO_PID]: ecpg_execute on line 81: query: drop table test1; with 0 parameter(s) on connection regress1 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 80: using PQexec +[NO_PID]: ecpg_execute on line 81: using PQexec [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ecpg_execute on line 80: OK: DROP TABLE +[NO_PID]: ecpg_execute on line 81: OK: DROP TABLE [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: deallocate_one on line 81: name foo3 +[NO_PID]: deallocate_one on line 82: name foo3 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: deallocate_one on line 81: name foo2 +[NO_PID]: deallocate_one on line 82: name foo2 [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: deallocate_one on line 81: name foo1 +[NO_PID]: deallocate_one on line 82: name foo1 [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/sql/desc.pgc b/src/interfaces/ecpg/test/sql/desc.pgc index 0e3157e577..136f326e10 100644 --- a/src/interfaces/ecpg/test/sql/desc.pgc +++ b/src/interfaces/ecpg/test/sql/desc.pgc @@ -14,12 +14,13 @@ main(void) int val1output = 2, val2i = 0; int val2null = -1; int ind1, ind2; + char desc1[8] = "outdesc"; EXEC SQL END DECLARE SECTION; ECPGdebug(1, stderr); EXEC SQL ALLOCATE DESCRIPTOR indesc; - EXEC SQL ALLOCATE DESCRIPTOR outdesc; + EXEC SQL ALLOCATE DESCRIPTOR :desc1; EXEC SQL SET DESCRIPTOR indesc VALUE 1 DATA = :val1; EXEC SQL SET DESCRIPTOR indesc VALUE 2 INDICATOR = :val2i, DATA = :val2;