aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/test
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2010-01-26 09:07:32 +0000
committerMichael Meskes <meskes@postgresql.org>2010-01-26 09:07:32 +0000
commitaa6ac352215d435b277711f85985d00a07a5c590 (patch)
tree9034ebed7c71dd9a0ed8e307f8e8ce92c8cb010e /src/interfaces/ecpg/test
parent525d2cbba2531f15649714121f54620738ffcacb (diff)
downloadpostgresql-aa6ac352215d435b277711f85985d00a07a5c590.tar.gz
postgresql-aa6ac352215d435b277711f85985d00a07a5c590.zip
Applied patch by Boszormenyi Zoltan <zb@cybertec.at> to add out-of-scope cursor support to native mode.
Diffstat (limited to 'src/interfaces/ecpg/test')
-rw-r--r--src/interfaces/ecpg/test/ecpg_schedule1
-rw-r--r--src/interfaces/ecpg/test/ecpg_schedule_tcp1
-rw-r--r--src/interfaces/ecpg/test/expected/compat_informix-test_informix.c4
-rw-r--r--src/interfaces/ecpg/test/expected/preproc-cursor.c14
-rw-r--r--src/interfaces/ecpg/test/expected/sql-binary.c9
-rw-r--r--src/interfaces/ecpg/test/preproc/Makefile1
6 files changed, 21 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/test/ecpg_schedule b/src/interfaces/ecpg/test/ecpg_schedule
index 2bf1e0243ef..e71452484d9 100644
--- a/src/interfaces/ecpg/test/ecpg_schedule
+++ b/src/interfaces/ecpg/test/ecpg_schedule
@@ -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
diff --git a/src/interfaces/ecpg/test/ecpg_schedule_tcp b/src/interfaces/ecpg/test/ecpg_schedule_tcp
index 9df75aba21b..64125e65eae 100644
--- a/src/interfaces/ecpg/test/ecpg_schedule_tcp
+++ b/src/interfaces/ecpg/test/ecpg_schedule_tcp
@@ -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
diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
index 0dc8c7f08ad..c19c2e5aff6 100644
--- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
+++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c
@@ -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"
diff --git a/src/interfaces/ecpg/test/expected/preproc-cursor.c b/src/interfaces/ecpg/test/expected/preproc-cursor.c
index b9bf5410a24..23734752717 100644
--- a/src/interfaces/ecpg/test/expected/preproc-cursor.c
+++ b/src/interfaces/ecpg/test/expected/preproc-cursor.c
@@ -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"
diff --git a/src/interfaces/ecpg/test/expected/sql-binary.c b/src/interfaces/ecpg/test/expected/sql-binary.c
index 00fd70224e5..64497b6a72c 100644
--- a/src/interfaces/ecpg/test/expected/sql-binary.c
+++ b/src/interfaces/ecpg/test/expected/sql-binary.c
@@ -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 ",
diff --git a/src/interfaces/ecpg/test/preproc/Makefile b/src/interfaces/ecpg/test/preproc/Makefile
index ed3243214e8..6d1d6294f54 100644
--- a/src/interfaces/ecpg/test/preproc/Makefile
+++ b/src/interfaces/ecpg/test/preproc/Makefile
@@ -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