mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix / implement GH-15287: add a lazy fetch to Pdo\PgSql
Make Pdo\PgSql accept Pdo::setAttribute(PDO::ATTR_PREFETCH, 0) to enter libpq's single row mode. This avoids storing the whole result set in memory before being able to call the first fetch(). close GH-15750
This commit is contained in:
parent
6fb81d2360
commit
68537fd9f4
6 changed files with 360 additions and 32 deletions
|
@ -34,6 +34,8 @@ typedef struct {
|
|||
char *errmsg;
|
||||
} pdo_pgsql_error_info;
|
||||
|
||||
typedef struct pdo_pgsql_stmt pdo_pgsql_stmt;
|
||||
|
||||
/* stuff we use in a pgsql database handle */
|
||||
typedef struct {
|
||||
PGconn *server;
|
||||
|
@ -49,13 +51,15 @@ typedef struct {
|
|||
bool disable_prepares;
|
||||
HashTable *lob_streams;
|
||||
zend_fcall_info_cache *notice_callback;
|
||||
bool default_fetching_laziness;
|
||||
pdo_pgsql_stmt *running_stmt;
|
||||
} pdo_pgsql_db_handle;
|
||||
|
||||
typedef struct {
|
||||
Oid pgsql_type;
|
||||
} pdo_pgsql_column;
|
||||
|
||||
typedef struct {
|
||||
struct pdo_pgsql_stmt {
|
||||
pdo_pgsql_db_handle *H;
|
||||
PGresult *result;
|
||||
pdo_pgsql_column *cols;
|
||||
|
@ -68,7 +72,9 @@ typedef struct {
|
|||
Oid *param_types;
|
||||
int current_row;
|
||||
bool is_prepared;
|
||||
} pdo_pgsql_stmt;
|
||||
bool is_unbuffered;
|
||||
bool is_running_unbuffered;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
Oid oid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue