30.patch
text/x-patch
Filename: 30.patch
Type: text/x-patch
Part: 3
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/interfaces/ecpg/ecpglib/cursor.c | 7 | 0 |
| src/interfaces/ecpg/ecpglib/extern.h | 1 | 0 |
commit c809a50d569bfde4d6520e8ce57f71bbe6159498
Author: Böszörményi Zoltán <zb@cybertec.at>
Date: Wed Nov 20 13:51:29 2013 +0100
ECPG: During FETCH ALL, temporarily use FETCHALL_MULTIPLIER times
the current readahead window size. FETCHALL_MULTIPLIER == 1000.
No change in regression tests.
diff --git a/src/interfaces/ecpg/ecpglib/cursor.c b/src/interfaces/ecpg/ecpglib/cursor.c
index f366a3e..a3384ba 100644
--- a/src/interfaces/ecpg/ecpglib/cursor.c
+++ b/src/interfaces/ecpg/ecpglib/cursor.c
@@ -1554,6 +1554,7 @@ ecpg_cursor_fetch(struct statement *stmt, struct cursor_descriptor *cur,
long ntuples;
int step;
int64 prev_pos, next_pos, start_idx, var_index;
+ int64 old_readahead;
switch (direction)
{
@@ -1725,6 +1726,10 @@ abs_rel:
goto abs_rel;
}
+ old_readahead = cur->readahead;
+ if (fetchall)
+ cur->readahead *= FETCHALL_MULTIPLIER;
+
/*
* The direction is backward if FETCH BACKWARD ALL
* or the amount to fetch is negative.
@@ -1808,6 +1813,8 @@ abs_rel:
sqlca->sqlerrd[2] = (var_index <= LONG_MAX ? var_index : 0);
+ cur->readahead = old_readahead;
+
if (var_index == 0)
{
ecpg_raise(stmt->lineno, ECPG_NOT_FOUND, ECPG_SQLSTATE_NO_DATA, NULL);
diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h
index 612412f..de0f3b8 100644
--- a/src/interfaces/ecpg/ecpglib/extern.h
+++ b/src/interfaces/ecpg/ecpglib/extern.h
@@ -32,6 +32,7 @@ enum ARRAY_TYPE
#define LOOP_FORWARD (1)
#define LOOP_BACKWARD (-1)
#define MAX_CACHE_MISS (3)
+#define FETCHALL_MULTIPLIER (1000)
/* A generic varchar type. */
struct ECPGgeneric_varchar