diff options
author | Michael Meskes <meskes@postgresql.org> | 2008-03-02 10:54:11 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2008-03-02 10:54:11 +0000 |
commit | fb7b1df083cc95ac79cdda836686933e6408f693 (patch) | |
tree | e2ba6aa88211d2554a982ef157ad991f151d9029 /src/interfaces/ecpg/test/expected/preproc-array_of_struct.c | |
parent | 0f855d621b407bfa7b4a4ef188ad261ca8e405ca (diff) | |
download | postgresql-fb7b1df083cc95ac79cdda836686933e6408f693.tar.gz postgresql-fb7b1df083cc95ac79cdda836686933e6408f693.zip |
Fixed bug that caused arrays of varchar to be output with incomplete name.
In the process expanded one test case,
Diffstat (limited to 'src/interfaces/ecpg/test/expected/preproc-array_of_struct.c')
-rw-r--r-- | src/interfaces/ecpg/test/expected/preproc-array_of_struct.c | 92 |
1 files changed, 58 insertions, 34 deletions
diff --git a/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c b/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c index 82f83309328..1a55c8ef18f 100644 --- a/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c +++ b/src/interfaces/ecpg/test/expected/preproc-array_of_struct.c @@ -81,6 +81,7 @@ int main( int argc, char * argv[] ) + #line 26 "array_of_struct.pgc" customer custs1 [ 10 ] ; @@ -111,54 +112,57 @@ int main( int argc, char * argv[] ) #line 44 "array_of_struct.pgc" int r ; -/* exec sql end declare section */ + #line 45 "array_of_struct.pgc" + struct varchar_onlyname_45 { int len; char arr[ 50 ]; } onlyname [2] ; +/* exec sql end declare section */ +#line 46 "array_of_struct.pgc" ECPGdebug(1, stderr); { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0); -#line 49 "array_of_struct.pgc" +#line 50 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 49 "array_of_struct.pgc" +#line 50 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 49 "array_of_struct.pgc" +#line 50 "array_of_struct.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table customers ( c varchar ( 50 ) , p int ) ", ECPGt_EOIT, ECPGt_EORT); -#line 51 "array_of_struct.pgc" +#line 52 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 51 "array_of_struct.pgc" +#line 52 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 51 "array_of_struct.pgc" +#line 52 "array_of_struct.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into customers values ( 'John Doe' , '12345' ) ", ECPGt_EOIT, ECPGt_EORT); -#line 52 "array_of_struct.pgc" +#line 53 "array_of_struct.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); -#line 52 "array_of_struct.pgc" +#line 53 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 52 "array_of_struct.pgc" +#line 53 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 52 "array_of_struct.pgc" +#line 53 "array_of_struct.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into customers values ( 'Jane Doe' , '67890' ) ", ECPGt_EOIT, ECPGt_EORT); -#line 53 "array_of_struct.pgc" +#line 54 "array_of_struct.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); -#line 53 "array_of_struct.pgc" +#line 54 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 53 "array_of_struct.pgc" +#line 54 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 53 "array_of_struct.pgc" +#line 54 "array_of_struct.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from customers limit 2 ", ECPGt_EOIT, @@ -166,16 +170,16 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_short,&(inds->name_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_int,&(custs1->phone),(long)1,(long)10,sizeof( customer ), ECPGt_short,&(inds->phone_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_EORT); -#line 55 "array_of_struct.pgc" +#line 56 "array_of_struct.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); -#line 55 "array_of_struct.pgc" +#line 56 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 55 "array_of_struct.pgc" +#line 56 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 55 "array_of_struct.pgc" +#line 56 "array_of_struct.pgc" printf("custs1:\n"); for (r = 0; r < 2; r++) @@ -189,16 +193,16 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_short,&(inds->name_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_int,&(custs2->phone),(long)1,(long)10,sizeof( customer2 ), ECPGt_short,&(inds->phone_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_EORT); -#line 63 "array_of_struct.pgc" +#line 64 "array_of_struct.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); -#line 63 "array_of_struct.pgc" +#line 64 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 63 "array_of_struct.pgc" +#line 64 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 63 "array_of_struct.pgc" +#line 64 "array_of_struct.pgc" printf("\ncusts2:\n"); for (r = 0; r < 2; r++) @@ -212,16 +216,16 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_short,&(inds->name_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_int,&(custs3->phone),(long)1,(long)10,sizeof( struct customer3 ), ECPGt_short,&(inds->phone_ind),(long)1,(long)10,sizeof( struct ind ), ECPGt_EORT); -#line 71 "array_of_struct.pgc" +#line 72 "array_of_struct.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); -#line 71 "array_of_struct.pgc" +#line 72 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 71 "array_of_struct.pgc" +#line 72 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 71 "array_of_struct.pgc" +#line 72 "array_of_struct.pgc" printf("\ncusts3:\n"); for (r = 0; r < 2; r++) @@ -235,29 +239,49 @@ if (sqlca.sqlcode < 0) sqlprint();} ECPGt_short,&(inds[0].name_ind),(long)1,(long)1,sizeof(short), ECPGt_int,&(custs4.phone),(long)1,(long)1,sizeof(int), ECPGt_short,&(inds[0].phone_ind),(long)1,(long)1,sizeof(short), ECPGt_EORT); -#line 79 "array_of_struct.pgc" +#line 80 "array_of_struct.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); -#line 79 "array_of_struct.pgc" +#line 80 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 79 "array_of_struct.pgc" +#line 80 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 79 "array_of_struct.pgc" +#line 80 "array_of_struct.pgc" printf("\ncusts4:\n"); printf( "name - %s\n", custs4.name.arr ); printf( "phone - %d\n", custs4.phone ); + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select c from customers limit 2 ", ECPGt_EOIT, + ECPGt_varchar,(onlyname),(long)50,(long)2,sizeof(struct varchar_onlyname_45), + ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); +#line 85 "array_of_struct.pgc" + +if (sqlca.sqlcode == ECPG_NOT_FOUND) sqlprint(); +#line 85 "array_of_struct.pgc" + +if (sqlca.sqlwarn[0] == 'W') sqlprint(); +#line 85 "array_of_struct.pgc" + +if (sqlca.sqlcode < 0) sqlprint();} +#line 85 "array_of_struct.pgc" + + printf("\nname:\n"); + for (r = 0; r < 2; r++) + { + printf( "name - %s\n", onlyname[r].arr ); + } + { ECPGdisconnect(__LINE__, "ALL"); -#line 84 "array_of_struct.pgc" +#line 92 "array_of_struct.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 84 "array_of_struct.pgc" +#line 92 "array_of_struct.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 84 "array_of_struct.pgc" +#line 92 "array_of_struct.pgc" return( 0 ); |