diff options
author | Michael Meskes <meskes@postgresql.org> | 2008-10-14 09:31:05 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2008-10-14 09:31:05 +0000 |
commit | f346a232edc233858203ff4aa7774fdd4b53e1a5 (patch) | |
tree | 1dc94f49d4785de185e3ded0a35892efaf53f9af /src/interfaces/ecpg/test/expected/sql-fetch.c | |
parent | 84c37694827326c3e5853a25d71ac9581ef6432d (diff) | |
download | postgresql-f346a232edc233858203ff4aa7774fdd4b53e1a5.tar.gz postgresql-f346a232edc233858203ff4aa7774fdd4b53e1a5.zip |
Fixed parsing of parameters. Added regression test for this.
Diffstat (limited to 'src/interfaces/ecpg/test/expected/sql-fetch.c')
-rw-r--r-- | src/interfaces/ecpg/test/expected/sql-fetch.c | 56 |
1 files changed, 47 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/test/expected/sql-fetch.c b/src/interfaces/ecpg/test/expected/sql-fetch.c index 52c3065a5ae..d8b2880fb18 100644 --- a/src/interfaces/ecpg/test/expected/sql-fetch.c +++ b/src/interfaces/ecpg/test/expected/sql-fetch.c @@ -162,34 +162,72 @@ if (sqlca.sqlcode < 0) sqlprint();} printf("%d: %s\n", i, str); - { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close C", ECPGt_EOIT, ECPGt_EORT); + /* declare D cursor for select * from My_Table where Item1 = $1 */ #line 42 "fetch.pgc" + + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare D cursor for select * from My_Table where Item1 = $1 ", + ECPGt_const,"1",(long)1,(long)1,strlen("1"), + ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); +#line 44 "fetch.pgc" + if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 42 "fetch.pgc" +#line 44 "fetch.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 42 "fetch.pgc" +#line 44 "fetch.pgc" + + + /* exec sql whenever not found break ; */ +#line 46 "fetch.pgc" + + while (1) { + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 in D", ECPGt_EOIT, + ECPGt_int,&(i),(long)1,(long)1,sizeof(int), + ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, + ECPGt_char,(str),(long)25,(long)1,(25)*sizeof(char), + ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); +#line 48 "fetch.pgc" + +if (sqlca.sqlcode == ECPG_NOT_FOUND) break; +#line 48 "fetch.pgc" + +if (sqlca.sqlwarn[0] == 'W') sqlprint(); +#line 48 "fetch.pgc" + +if (sqlca.sqlcode < 0) sqlprint();} +#line 48 "fetch.pgc" + + printf("%d: %s\n", i, str); + } + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close D", ECPGt_EOIT, ECPGt_EORT); +#line 51 "fetch.pgc" + +if (sqlca.sqlwarn[0] == 'W') sqlprint(); +#line 51 "fetch.pgc" + +if (sqlca.sqlcode < 0) sqlprint();} +#line 51 "fetch.pgc" { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table My_Table ", ECPGt_EOIT, ECPGt_EORT); -#line 44 "fetch.pgc" +#line 53 "fetch.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 44 "fetch.pgc" +#line 53 "fetch.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 44 "fetch.pgc" +#line 53 "fetch.pgc" { ECPGdisconnect(__LINE__, "ALL"); -#line 46 "fetch.pgc" +#line 55 "fetch.pgc" if (sqlca.sqlwarn[0] == 'W') sqlprint(); -#line 46 "fetch.pgc" +#line 55 "fetch.pgc" if (sqlca.sqlcode < 0) sqlprint();} -#line 46 "fetch.pgc" +#line 55 "fetch.pgc" return 0; |