mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Applied patch by Boszormenyi Zoltan <zb@cybertec.at> to add out-of-scope cursor support to native mode.
This commit is contained in:
@ -24,6 +24,7 @@ test: preproc/init
|
||||
test: preproc/strings
|
||||
test: preproc/type
|
||||
test: preproc/variable
|
||||
test: preproc/outofscope
|
||||
test: preproc/whenever
|
||||
test: sql/array
|
||||
test: sql/binary
|
||||
|
@ -24,6 +24,7 @@ test: preproc/init
|
||||
test: preproc/strings
|
||||
test: preproc/type
|
||||
test: preproc/variable
|
||||
test: preproc/outofscope
|
||||
test: preproc/whenever
|
||||
test: sql/array
|
||||
test: sql/binary
|
||||
|
@ -147,7 +147,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
|
||||
|
||||
|
||||
sqlca.sqlcode = 100;
|
||||
ECPG_informix_set_var( 0, &( i ), __LINE__);\
|
||||
ECPGset_var( 0, &( i ), __LINE__);\
|
||||
ECPG_informix_reset_sqlca(); /* declare c cursor for select * from test where i <= $1 */
|
||||
#line 49 "test_informix.pgc"
|
||||
|
||||
@ -245,7 +245,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
|
||||
static void openit(void)
|
||||
{
|
||||
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare c cursor for select * from test where i <= $1 ",
|
||||
ECPGt_int,&(*( int *)(ECPG_informix_get_var( 0))),(long)1,(long)1,sizeof(int),
|
||||
ECPGt_int,&(*( int *)(ECPGget_var( 0))),(long)1,(long)1,sizeof(int),
|
||||
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
|
||||
#line 95 "test_informix.pgc"
|
||||
|
||||
|
@ -153,7 +153,8 @@ if (sqlca.sqlcode < 0) exit (1);}
|
||||
/* Dynamic cursorname test with INTO list in FETCH stmts */
|
||||
|
||||
strcpy(msg, "declare");
|
||||
/* declare $0 cursor for select id , t from t1 */
|
||||
ECPGset_var( 0, &( curname1 ), __LINE__);\
|
||||
/* declare $0 cursor for select id , t from t1 */
|
||||
#line 59 "cursor.pgc"
|
||||
|
||||
|
||||
@ -286,7 +287,10 @@ if (sqlca.sqlcode < 0) exit (1);}
|
||||
/* Dynamic cursorname test with INTO list in DECLARE stmt */
|
||||
|
||||
strcpy(msg, "declare");
|
||||
/* declare $0 cursor for select id , t from t1 */
|
||||
ECPGset_var( 3, &( curname2 ), __LINE__);\
|
||||
ECPGset_var( 1, ( t ), __LINE__);\
|
||||
ECPGset_var( 2, &( id ), __LINE__);\
|
||||
/* declare $0 cursor for select id , t from t1 */
|
||||
#line 100 "cursor.pgc"
|
||||
|
||||
|
||||
@ -435,7 +439,8 @@ if (sqlca.sqlcode < 0) exit (1);}
|
||||
|
||||
|
||||
strcpy(msg, "declare");
|
||||
/* declare $0 cursor for $1 */
|
||||
ECPGset_var( 4, &( curname3 ), __LINE__);\
|
||||
/* declare $0 cursor for $1 */
|
||||
#line 143 "cursor.pgc"
|
||||
|
||||
|
||||
@ -590,7 +595,8 @@ if (sqlca.sqlcode < 0) exit (1);}
|
||||
|
||||
|
||||
strcpy(msg, "declare");
|
||||
/* declare $0 cursor for $1 */
|
||||
ECPGset_var( 5, &( curname4 ), __LINE__);\
|
||||
/* declare $0 cursor for $1 */
|
||||
#line 193 "cursor.pgc"
|
||||
|
||||
|
||||
|
@ -107,7 +107,8 @@ main (void)
|
||||
exit (sqlca.sqlcode);
|
||||
}
|
||||
|
||||
/* declare C cursor for select name , accs , byte from empl where idnum = $1 */
|
||||
ECPGset_var( 0, &( empl.idnum ), __LINE__);\
|
||||
/* declare C cursor for select name , accs , byte from empl where idnum = $1 */
|
||||
#line 58 "binary.pgc"
|
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare C cursor for select name , accs , byte from empl where idnum = $1 ",
|
||||
@ -133,7 +134,8 @@ main (void)
|
||||
printf ("name=%s, accs=%d byte=%s\n", empl.name, empl.accs, empl.byte);
|
||||
|
||||
memset(empl.name, 0, 21L);
|
||||
/* declare B binary cursor for select name , accs , byte from empl where idnum = $1 */
|
||||
ECPGset_var( 1, &( empl.idnum ), __LINE__);\
|
||||
/* declare B binary cursor for select name , accs , byte from empl where idnum = $1 */
|
||||
#line 70 "binary.pgc"
|
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare B binary cursor for select name , accs , byte from empl where idnum = $1 ",
|
||||
@ -166,7 +168,8 @@ main (void)
|
||||
printf("(%o)", (unsigned char)empl.byte[i]);
|
||||
printf("\n");
|
||||
|
||||
/* declare A binary cursor for select byte from empl where idnum = $1 */
|
||||
ECPGset_var( 2, &( empl.idnum ), __LINE__);\
|
||||
/* declare A binary cursor for select byte from empl where idnum = $1 */
|
||||
#line 87 "binary.pgc"
|
||||
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare A binary cursor for select byte from empl where idnum = $1 ",
|
||||
|
@ -11,6 +11,7 @@ TESTS = array_of_struct array_of_struct.c \
|
||||
define define.c \
|
||||
init init.c \
|
||||
strings strings.c \
|
||||
outofscope outofscope.c \
|
||||
type type.c \
|
||||
variable variable.c \
|
||||
whenever whenever.c
|
||||
|
Reference in New Issue
Block a user