if (!conn_obj->intern) {
throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Connection not initialized");
} else {
+
+ switch (ZEND_NUM_ARGS()) {
+ case 1:
+ case 2:
+ isolation = conn_obj->intern->default_txn_isolation;
+ /* no break */
+ case 3:
+ readonly = conn_obj->intern->default_txn_readonly;
+ /* no break */
+ case 4:
+ deferrable = conn_obj->intern->default_txn_deferrable;
+ break;
+ }
+
if (async) {
rv = php_pqconn_start_transaction_async(zconn, conn_obj, isolation, readonly, deferrable TSRMLS_CC);
} else {
if (!obj->intern) {
throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Transacation not initialized");
} else if (!obj->intern->open) {
- throw_exce(EX_RUNTIME TSRMLS_CC, "pq\\Transacation already closed");
+ throw_exce(EX_RUNTIME TSRMLS_CC, "pq\\Transaction already closed");
} else {
PGresult *res;
smart_str cmd = {0};
int lofd = lo_open(obj->intern->conn->intern->conn, loid, mode);
if (lofd < 0) {
- throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to open large object with oid=%u with mode '%s' (%s)", loid, strmode(mode), PHP_PQerrorMessage(obj->intern->conn->intern->conn));
+ throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to open large object with oid=%u with mode '%s' (%s)", loid, php_pq_strmode(mode), PHP_PQerrorMessage(obj->intern->conn->intern->conn));
} else {
php_pqlob_t *lob = ecalloc(1, sizeof(*lob));
Oid loid = lo_creat(obj->intern->conn->intern->conn, mode);
if (loid == InvalidOid) {
- throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to create large object with mode '%s' (%s)", strmode(mode), PHP_PQerrorMessage(obj->intern->conn->intern->conn));
+ throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to create large object with mode '%s' (%s)", php_pq_strmode(mode), PHP_PQerrorMessage(obj->intern->conn->intern->conn));
} else {
int lofd = lo_open(obj->intern->conn->intern->conn, loid, mode);
if (lofd < 0) {
- throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to open large object with oid=%u with mode '%s': %s", loid, strmode(mode), PHP_PQerrorMessage(obj->intern->conn->intern->conn));
+ throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to open large object with oid=%u with mode '%s': %s", loid, php_pq_strmode(mode), PHP_PQerrorMessage(obj->intern->conn->intern->conn));
} else {
php_pqlob_t *lob = ecalloc(1, sizeof(*lob));