commit 2348661c1050cacce0a3b2789313b106aa5d5604
Author: Böszörményi Zoltán <zboszor@pr.hu>
Date:   Wed Apr 16 10:34:49 2014 +0200

    ECPG: Increase the readahead window permanently if the application
    ever sends us FETCH FORWARD/BACKWARD/RELATIVE with an argument
    larger than the current readahead window. This invalidates the points
    and corner cases tested by src/interfaces/ecpg/test/sql/cursor-ra-fetch.pgc
    but not its results. Leave this test in place for reference.

diff --git a/src/interfaces/ecpg/ecpglib/cursor.c b/src/interfaces/ecpg/ecpglib/cursor.c
index 43fd173..da83c92 100644
--- a/src/interfaces/ecpg/ecpglib/cursor.c
+++ b/src/interfaces/ecpg/ecpglib/cursor.c
@@ -1907,20 +1907,30 @@ ECPGfetch(const int lineno, const int compat, const int force_indicator,
 				return false;
 			}
 			if (!ecpg_process_output(stmt, 0, PQntuples(stmt->results), LOOP_FORWARD, 0, true, false))
 			{
 				ecpg_do_epilogue(stmt);
 				return false;
 			}
 		}
 		else
 		{
+			if (dir == ECPGc_forward || dir == ECPGc_relative)
+			{
+				if (llabs(amount1) > cur->readahead)
+				{
+					cur->readahead = llabs(amount1);
+					ecpg_log("ECPGfetch on line %d: permanently raising readahead window size to %lld\n",
+									lineno, (long long)cur->readahead);
+				}
+			}
+
 			if (!ecpg_cursor_fetch(stmt, cur, dir, amount1, fetchall))
 			{
 				ecpg_do_epilogue(stmt);
 				return false;
 			}
 		}
 	}
 
 	ecpg_do_epilogue(stmt);
 
diff --git a/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.stderr b/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.stderr
index 474dc04..3429a54 100644
--- a/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.stderr
+++ b/src/interfaces/ecpg/test/expected/sql-cursor-ra-fetch.stderr
@@ -1639,60 +1639,54 @@
 [NO_PID]: ecpg_execute on line 309: query: fetch absolute 31 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 309: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 309: correctly got 0 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 309: no data found on line 309
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 325: query: fetch backward 8 from scroll_cur4; fetch all: 0 amount: -8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 325: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ECPGfetch on line 325: permanently raising readahead window size to 8
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 325: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 325: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 325: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 325: command fetch backward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 325: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 325: correctly got 8 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 26 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 25 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 24 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 23 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 325: RESULT: z offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 325: RESULT: y offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 325: RESULT: x offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 325: RESULT: w offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 325: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 325: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 325: command fetch backward 4 from scroll_cur4; returned 4 tuples
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 325: correctly got 4 tuples with 2 fields
-[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 22 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 21 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 20 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: 19 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 325: RESULT: z offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 325: RESULT: y offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 325: RESULT: x offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 325: RESULT: w offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: v offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: u offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: t offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 325: RESULT: s offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 333: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: 36
 [NO_PID]: sqlca: code: 0, state: 00000
@@ -1713,61 +1707,61 @@
 [NO_PID]: ecpg_cursor_execute on line 333: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 333: no data found on line 333
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 333: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: 26
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: query: move absolute 25 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 333: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 333: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 333: command fetch forward 4 from scroll_cur4; returned 1 tuples
+[NO_PID]: ecpg_cursor_execute on line 333: command fetch forward 8 from scroll_cur4; returned 1 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 333: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: 26 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: z offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 333: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: 21
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: query: move absolute 20 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 333: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 333: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 333: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 333: command fetch forward 8 from scroll_cur4; returned 6 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 333: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: 21 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: u offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 333: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: 16
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: query: move absolute 15 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 333: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 333: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 333: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 333: command fetch forward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 333: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: 16 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: p offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 333: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: 11
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 333: query: fetch absolute 11 from scroll_cur4; with 0 parameter(s) on connection regress1
@@ -1799,60 +1793,52 @@
 [NO_PID]: ecpg_execute on line 333: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 333: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: 1 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 333: RESULT: a offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 350: query: fetch forward 8 from scroll_cur4; fetch all: 0 amount: 8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 350: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 350: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 350: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 350: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 350: command fetch forward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 350: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 350: correctly got 8 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 2 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 3 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 4 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 5 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 350: RESULT: b offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 350: RESULT: c offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 350: RESULT: d offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 350: RESULT: e offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 350: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 350: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 350: command fetch forward 4 from scroll_cur4; returned 4 tuples
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 350: correctly got 4 tuples with 2 fields
-[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 6 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 7 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 8 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: 9 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 350: RESULT: b offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 350: RESULT: c offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 350: RESULT: d offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 350: RESULT: e offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: f offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: g offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: h offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 350: RESULT: i offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGtrans on line 354: action "rollback"; connection "regress1"
 [NO_PID]: sqlca: code: 0, state: 00000
@@ -1957,60 +1943,54 @@
 [NO_PID]: ecpg_execute on line 370: query: fetch absolute -31 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 370: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 370: correctly got 0 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 370: no data found on line 370
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 387: query: fetch forward 8 from scroll_cur4; fetch all: 0 amount: 8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 387: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ECPGfetch on line 387: permanently raising readahead window size to 8
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 387: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 387: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 387: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 387: command fetch forward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 387: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 387: correctly got 8 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 1 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 2 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 3 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 4 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 387: RESULT: a offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 387: RESULT: b offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 387: RESULT: c offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 387: RESULT: d offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 387: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 387: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 387: command fetch forward 4 from scroll_cur4; returned 4 tuples
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 387: correctly got 4 tuples with 2 fields
-[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 5 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 6 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 7 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: 8 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 387: RESULT: a offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 387: RESULT: b offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 387: RESULT: c offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 387: RESULT: d offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: e offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: f offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: g offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 387: RESULT: h offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 395: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: -36
 [NO_PID]: sqlca: code: 0, state: 00000
@@ -2031,61 +2011,61 @@
 [NO_PID]: ecpg_cursor_execute on line 395: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 395: no data found on line 395
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 395: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: -26
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: query: move absolute -25 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 395: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 395: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 395: command fetch backward 4 from scroll_cur4; returned 1 tuples
+[NO_PID]: ecpg_cursor_execute on line 395: command fetch backward 8 from scroll_cur4; returned 1 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 395: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: 1 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: a offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 395: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: -21
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: query: move absolute -20 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 395: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 395: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 395: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 395: command fetch backward 8 from scroll_cur4; returned 6 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 395: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: 6 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: f offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 395: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: -16
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: query: move absolute -15 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 395: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 395: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 395: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 395: command fetch backward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 395: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: 11 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: k offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 395: query: fetch absolute $0 from scroll_cur4; fetch all: 0 amount: -11
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 395: query: fetch absolute -11 from scroll_cur4; with 0 parameter(s) on connection regress1
@@ -2117,131 +2097,109 @@
 [NO_PID]: ecpg_execute on line 395: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 395: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: 26 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 395: RESULT: z offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 412: query: fetch backward 8 from scroll_cur4; fetch all: 0 amount: -8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 412: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 412: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 412: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 412: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 412: command fetch backward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 412: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 412: correctly got 8 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 25 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 24 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 23 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 22 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 412: RESULT: y offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 412: RESULT: x offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 412: RESULT: w offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 412: RESULT: v offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 412: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 412: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 412: command fetch backward 4 from scroll_cur4; returned 4 tuples
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 412: correctly got 4 tuples with 2 fields
-[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 21 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 20 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 19 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: 18 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 412: RESULT: y offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 412: RESULT: x offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 412: RESULT: w offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 412: RESULT: v offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: u offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: t offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: s offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 412: RESULT: r offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGtrans on line 416: action "rollback"; connection "regress1"
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 426: query: declare scroll_cur4 scroll cursor for select id , t from t1 order by id; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 426: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 426: OK: DECLARE CURSOR
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 433: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGfetch on line 433: permanently raising readahead window size to 5
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 433: query: move relative 4 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 433: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 433: query: fetch forward 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 433: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 433: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 433: command fetch forward 5 from scroll_cur4; returned 5 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 433: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 433: RESULT: 5 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 433: RESULT: e offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 433: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: query: move absolute 5 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: query: move relative 4 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 433: query: fetch forward 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 433: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 433: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 433: command fetch forward 5 from scroll_cur4; returned 5 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 433: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 433: RESULT: 10 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 433: RESULT: j offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 433: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: query: move absolute 10 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: query: move relative 4 in scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 433: query: fetch forward 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 433: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 433: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 433: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 433: command fetch forward 5 from scroll_cur4; returned 5 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 433: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 433: RESULT: 15 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 433: RESULT: o offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 433: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 433: query: move absolute 15 in scroll_cur4; with 0 parameter(s) on connection regress1
@@ -2275,60 +2233,54 @@
 [NO_PID]: ecpg_execute on line 433: query: fetch relative 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 433: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 433: correctly got 0 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 433: no data found on line 433
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 451: query: fetch backward 8 from scroll_cur4; fetch all: 0 amount: -8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 451: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ECPGfetch on line 451: permanently raising readahead window size to 8
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 451: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 451: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 451: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 451: command fetch backward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 451: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 451: correctly got 8 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 26 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 25 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 24 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 23 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 451: RESULT: z offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 451: RESULT: y offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 451: RESULT: x offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 451: RESULT: w offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 451: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 451: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 451: command fetch backward 4 from scroll_cur4; returned 4 tuples
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 451: correctly got 4 tuples with 2 fields
-[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 22 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 21 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 20 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: 19 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 451: RESULT: z offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 451: RESULT: y offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 451: RESULT: x offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 451: RESULT: w offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: v offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: u offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: t offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 451: RESULT: s offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 456: query: move forward 100 in scroll_cur4; fetch all: 0 amount: 100
 [NO_PID]: sqlca: code: 0, state: 00000
@@ -2343,141 +2295,123 @@
 [NO_PID]: ecpg_get_data on line 465: RESULT: 22 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: v offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 465: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 465: query: move absolute -9 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 465: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 465: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 465: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 465: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 465: command fetch backward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 465: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: 17 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: q offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 465: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: query: move absolute -14 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 465: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 465: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 465: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: 12 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: l offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 465: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 465: query: move absolute -19 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 465: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 465: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 465: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 465: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 465: command fetch backward 8 from scroll_cur4; returned 7 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 465: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: 7 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: g offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 465: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: query: move absolute -20 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: query: fetch relative - 5 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: using PQexec
+[NO_PID]: ecpg_cursor_execute on line 465: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 465: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: 2 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 465: RESULT: b offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 465: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: query: fetch relative - 5 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 465: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 465: correctly got 0 tuples with 2 fields
+[NO_PID]: ecpg_cursor_execute on line 465: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 465: no data found on line 465
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 483: query: fetch forward 8 from scroll_cur4; fetch all: 0 amount: 8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 483: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 483: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 483: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 483: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 483: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 483: correctly got 7 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: 1 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: 2 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: 3 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: 4 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 483: RESULT: 5 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 483: RESULT: 6 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 483: RESULT: 7 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: a offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: b offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: c offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: d offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 483: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 483: using PQexec
+[NO_PID]: ecpg_get_data on line 483: RESULT: e offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 483: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_get_data on line 483: RESULT: f offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 483: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_get_data on line 483: RESULT: g offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 483: RESULT: 5 offset: -1; array: no
+[NO_PID]: ecpg_execute on line 483: query: move absolute -20 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 483: RESULT: 6 offset: -1; array: no
+[NO_PID]: ecpg_execute on line 483: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 483: RESULT: 7 offset: -1; array: no
+[NO_PID]: ecpg_execute on line 483: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 483: RESULT: 8 offset: -1; array: no
+[NO_PID]: ecpg_execute on line 483: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 483: RESULT: e offset: -1; array: no
+[NO_PID]: ecpg_cursor_execute on line 483: command fetch forward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 483: RESULT: f offset: -1; array: no
+[NO_PID]: ecpg_process_output on line 483: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 483: RESULT: g offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 483: RESULT: 8 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 483: RESULT: h offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGtrans on line 487: action "rollback"; connection "regress1"
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 497: query: declare scroll_cur4 scroll cursor for select id , t from t1 order by id; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 497: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 497: OK: DECLARE CURSOR
@@ -2489,77 +2423,63 @@
 [NO_PID]: ecpg_execute on line 501: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 501: stmt->results is NULL, ignoring
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 504: query: move forward 1 in scroll_cur4; fetch all: 0 amount: 1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 504: stmt->results is NULL, ignoring
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 511: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGfetch on line 511: permanently raising readahead window size to 5
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: query: move forward all in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: query: move relative -4 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 511: query: fetch backward 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 511: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 511: command fetch backward 5 from scroll_cur4; returned 5 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 511: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 511: RESULT: 22 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 511: RESULT: v offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 511: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: query: move absolute -5 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: query: move relative -4 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 511: query: fetch backward 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 511: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 511: command fetch backward 5 from scroll_cur4; returned 5 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 511: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 511: RESULT: 17 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 511: RESULT: q offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 511: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: query: move absolute -10 in scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 511: query: fetch backward 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: query: move relative -4 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 511: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 511: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 511: command fetch backward 5 from scroll_cur4; returned 5 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 511: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 511: RESULT: 12 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 511: RESULT: l offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 511: query: fetch relative - 5 from scroll_cur4; fetch all: 0 amount: -5
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: query: move absolute -15 in scroll_cur4; with 0 parameter(s) on connection regress1
@@ -2593,60 +2513,54 @@
 [NO_PID]: ecpg_execute on line 511: query: fetch relative - 5 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 511: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 511: correctly got 0 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 511: no data found on line 511
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 529: query: fetch forward 8 from scroll_cur4; fetch all: 0 amount: 8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 529: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ECPGfetch on line 529: permanently raising readahead window size to 8
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 529: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 529: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 529: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 529: command fetch forward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 529: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 529: correctly got 8 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 1 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 2 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 3 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 4 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 529: RESULT: a offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 529: RESULT: b offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 529: RESULT: c offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 529: RESULT: d offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 529: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 529: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 529: command fetch forward 4 from scroll_cur4; returned 4 tuples
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 529: correctly got 4 tuples with 2 fields
-[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 5 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 6 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 7 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: 8 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 529: RESULT: a offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 529: RESULT: b offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 529: RESULT: c offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 529: RESULT: d offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: e offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: f offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: g offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 529: RESULT: h offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 534: query: move backward 100 in scroll_cur4; fetch all: 0 amount: -100
 [NO_PID]: sqlca: code: 0, state: 00000
@@ -2661,141 +2575,123 @@
 [NO_PID]: ecpg_get_data on line 543: RESULT: 5 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: e offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 543: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 543: query: move absolute 9 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 543: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 543: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 543: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 543: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 543: command fetch forward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 543: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: 10 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: j offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 543: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: query: move absolute 14 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 543: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 543: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 543: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: 15 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: o offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 543: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 543: query: move absolute 19 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 543: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: query: fetch forward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_execute on line 543: query: fetch forward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 543: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 543: command fetch forward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_cursor_execute on line 543: command fetch forward 8 from scroll_cur4; returned 7 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 543: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: 20 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: t offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 543: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: query: move absolute 20 in scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: query: fetch relative 5 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: using PQexec
+[NO_PID]: ecpg_cursor_execute on line 543: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 543: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: 25 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 543: RESULT: y offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGfetch on line 543: query: fetch relative 5 from scroll_cur4; fetch all: 0 amount: 5
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: query: fetch relative 5 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 543: using PQexec
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 543: correctly got 0 tuples with 2 fields
+[NO_PID]: ecpg_cursor_execute on line 543: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: raising sqlcode 100 on line 543: no data found on line 543
 [NO_PID]: sqlca: code: 100, state: 02000
 [NO_PID]: ECPGfetch on line 561: query: fetch backward 8 from scroll_cur4; fetch all: 0 amount: -8
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 561: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 561: using PQexec
+[NO_PID]: ecpg_cursor_execute on line 561: tuple already in cache
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 561: command fetch backward 4 from scroll_cur4; returned 4 tuples
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 561: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_process_output on line 561: correctly got 7 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: 26 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: 25 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: 24 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: 23 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 561: RESULT: 22 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 561: RESULT: 21 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_get_data on line 561: RESULT: 20 offset: -1; array: no
+[NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: z offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: y offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: x offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: w offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 561: query: fetch backward 4 from scroll_cur4; with 0 parameter(s) on connection regress1
+[NO_PID]: ecpg_get_data on line 561: RESULT: v offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_execute on line 561: using PQexec
+[NO_PID]: ecpg_get_data on line 561: RESULT: u offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_cursor_execute on line 561: command fetch backward 4 from scroll_cur4; returned 4 tuples
+[NO_PID]: ecpg_get_data on line 561: RESULT: t offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_process_output on line 561: correctly got 4 tuples with 2 fields
+[NO_PID]: ecpg_execute on line 561: query: move absolute 20 in scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 561: RESULT: 22 offset: -1; array: no
+[NO_PID]: ecpg_execute on line 561: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 561: RESULT: 21 offset: -1; array: no
+[NO_PID]: ecpg_execute on line 561: query: fetch backward 8 from scroll_cur4; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 561: RESULT: 20 offset: -1; array: no
+[NO_PID]: ecpg_execute on line 561: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 561: RESULT: 19 offset: -1; array: no
+[NO_PID]: ecpg_cursor_execute on line 561: command fetch backward 8 from scroll_cur4; returned 8 tuples
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 561: RESULT: v offset: -1; array: no
+[NO_PID]: ecpg_process_output on line 561: correctly got 1 tuples with 2 fields
 [NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 561: RESULT: u offset: -1; array: no
-[NO_PID]: sqlca: code: 0, state: 00000
-[NO_PID]: ecpg_get_data on line 561: RESULT: t offset: -1; array: no
+[NO_PID]: ecpg_get_data on line 561: RESULT: 19 offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_get_data on line 561: RESULT: s offset: -1; array: no
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ECPGtrans on line 565: action "rollback"; connection "regress1"
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 569: query: drop table t1; with 0 parameter(s) on connection regress1
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_execute on line 569: using PQexec
 [NO_PID]: sqlca: code: 0, state: 00000
 [NO_PID]: ecpg_process_output on line 569: OK: DROP TABLE
