diff options
Diffstat (limited to 'src/interfaces/ecpg/test/expected/preproc-variable.c')
-rw-r--r-- | src/interfaces/ecpg/test/expected/preproc-variable.c | 93 |
1 files changed, 54 insertions, 39 deletions
diff --git a/src/interfaces/ecpg/test/expected/preproc-variable.c b/src/interfaces/ecpg/test/expected/preproc-variable.c index 3954f837690..cce377021be 100644 --- a/src/interfaces/ecpg/test/expected/preproc-variable.c +++ b/src/interfaces/ecpg/test/expected/preproc-variable.c @@ -71,6 +71,8 @@ main (void) + + #line 27 "variable.pgc" struct personal_struct { @@ -98,27 +100,33 @@ main (void) } ; struct t2 { #line 32 "variable.pgc" struct varchar_3 { int len; char arr[ BUFFERSIZ ]; } name ; - } ;/* exec sql end declare section */ + } ; #line 33 "variable.pgc" + static struct varchar_4 { int len; char arr[ 50 ]; } vc1 ; static struct varchar_5 { int len; char arr[ 50 ]; } vc2 ; static struct varchar_6 { int len; char arr[ 255 ]; } vc3 ; + +#line 34 "variable.pgc" + static int i1 , i2 , i3 ; +/* exec sql end declare section */ +#line 35 "variable.pgc" -#line 35 "variable.pgc" +#line 37 "variable.pgc" char * married = NULL ; -#line 35 "variable.pgc" +#line 37 "variable.pgc" -#line 36 "variable.pgc" +#line 38 "variable.pgc" long ind_married ; -#line 36 "variable.pgc" +#line 38 "variable.pgc" -#line 37 "variable.pgc" +#line 39 "variable.pgc" ind children ; -#line 37 "variable.pgc" +#line 39 "variable.pgc" int loopcount; char msg[128]; @@ -127,78 +135,78 @@ main (void) strcpy(msg, "connect"); { ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , NULL, 0); -#line 44 "variable.pgc" +#line 46 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 44 "variable.pgc" +#line 46 "variable.pgc" strcpy(msg, "set"); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT); -#line 47 "variable.pgc" +#line 49 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 47 "variable.pgc" +#line 49 "variable.pgc" strcpy(msg, "create"); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table family ( name char ( 8 ) , born integer , age smallint , married date , children integer )", ECPGt_EOIT, ECPGt_EORT); -#line 50 "variable.pgc" +#line 52 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 50 "variable.pgc" +#line 52 "variable.pgc" strcpy(msg, "insert"); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , married , children ) values ( 'Mum' , '19870714' , 3 )", ECPGt_EOIT, ECPGt_EORT); -#line 53 "variable.pgc" +#line 55 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 53 "variable.pgc" +#line 55 "variable.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , born , married , children ) values ( 'Dad' , '19610721' , '19870714' , 3 )", ECPGt_EOIT, ECPGt_EORT); -#line 54 "variable.pgc" +#line 56 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 54 "variable.pgc" +#line 56 "variable.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , age ) values ( 'Child 1' , 16 )", ECPGt_EOIT, ECPGt_EORT); -#line 55 "variable.pgc" +#line 57 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 55 "variable.pgc" +#line 57 "variable.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , age ) values ( 'Child 2' , 14 )", ECPGt_EOIT, ECPGt_EORT); -#line 56 "variable.pgc" +#line 58 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 56 "variable.pgc" +#line 58 "variable.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into family ( name , age ) values ( 'Child 3' , 9 )", ECPGt_EOIT, ECPGt_EORT); -#line 57 "variable.pgc" +#line 59 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 57 "variable.pgc" +#line 59 "variable.pgc" strcpy(msg, "commit"); { ECPGtrans(__LINE__, NULL, "commit"); -#line 60 "variable.pgc" +#line 62 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 60 "variable.pgc" +#line 62 "variable.pgc" strcpy(msg, "open"); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur cursor for select name , born , age , married , children from family", ECPGt_EOIT, ECPGt_EORT); -#line 63 "variable.pgc" +#line 65 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 63 "variable.pgc" +#line 65 "variable.pgc" /* exec sql whenever not found break ; */ -#line 65 "variable.pgc" +#line 67 "variable.pgc" p=&personal; @@ -217,13 +225,13 @@ if (sqlca.sqlcode < 0) exit (1);} 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 72 "variable.pgc" +#line 74 "variable.pgc" if (sqlca.sqlcode == ECPG_NOT_FOUND) break; -#line 72 "variable.pgc" +#line 74 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 72 "variable.pgc" +#line 74 "variable.pgc" printf("%8.8s", personal.name.arr); if (i->ind_birth.born >= 0) @@ -242,35 +250,42 @@ if (sqlca.sqlcode < 0) exit (1);} strcpy(msg, "close"); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur", ECPGt_EOIT, ECPGt_EORT); -#line 89 "variable.pgc" +#line 91 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 89 "variable.pgc" +#line 91 "variable.pgc" strcpy(msg, "drop"); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table family", ECPGt_EOIT, ECPGt_EORT); -#line 92 "variable.pgc" +#line 94 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 92 "variable.pgc" +#line 94 "variable.pgc" strcpy(msg, "commit"); { ECPGtrans(__LINE__, NULL, "commit"); -#line 95 "variable.pgc" +#line 97 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 95 "variable.pgc" +#line 97 "variable.pgc" strcpy(msg, "disconnect"); { ECPGdisconnect(__LINE__, "CURRENT"); -#line 98 "variable.pgc" +#line 100 "variable.pgc" if (sqlca.sqlcode < 0) exit (1);} -#line 98 "variable.pgc" +#line 100 "variable.pgc" + + /* this just to silence unused-variable warnings: */ + vc1.len = vc2.len = vc3.len = 0; + i1 = i2 = i3 = 0; + printf("%d %d %d %d %d %d\n", + vc1.len, vc2.len, vc3.len, + i1, i2, i3); return 0; } |