}
}
- obj->intern->default_fetch_type = Z_LVAL_P(zft) & 0x2; /* two bits only */
+ obj->intern->default_fetch_type = Z_LVAL_P(zft) & 0x3; /* two bits only */
if (zft != value) {
zval_ptr_dtor(&zft);
}
}
- obj->intern->default_txn_isolation = Z_LVAL_P(zti) & 0x2; /* two bits only */
+ obj->intern->default_txn_isolation = Z_LVAL_P(zti) & 0x3; /* two bits only */
if (zti != value) {
zval_ptr_dtor(&zti);
static void php_pqconn_wakeup(php_persistent_handle_factory_t *f, void **handle TSRMLS_DC)
{
- // FIXME: ping server
+ PGresult *res = PQexec(*handle, "");
+ PHP_PQclear(res);
+
+ if (CONNECTION_OK != PQstatus(*handle)) {
+ PQreset(*handle);
+ }
}
static inline PGresult *unlisten(PGconn *conn, const char *channel_str, size_t channel_len TSRMLS_DC)