X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqtxn.c;h=5fc1e9d5afcf7ebdbff9c6f213db3fa962bbee54;hp=41b49508bf0581a940975e348e54fd6d599dd397;hb=94be2af75078af30116718bb2df201d9e5a47e5b;hpb=bf2e263195f9909b017fcf93d96cfc83a97ad2e3 diff --git a/src/php_pqtxn.c b/src/php_pqtxn.c index 41b4950..5fc1e9d 100644 --- a/src/php_pqtxn.c +++ b/src/php_pqtxn.c @@ -229,6 +229,20 @@ static PHP_METHOD(pqtxn, __construct) { 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 { @@ -341,7 +355,7 @@ static PHP_METHOD(pqtxn, commit) { 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};