static zend_object_handlers php_pqtxn_object_handlers;
static HashTable php_pqtxn_object_prophandlers;
-const char *isolation_level(long *isolation)
+const char *php_pq_isolation_level(long *isolation)
{
switch (*isolation) {
case PHP_PQTXN_SERIALIZABLE:
fprintf(stderr, "FREE txn(#%d) %p (conn(#%d): %p)\n", obj->zv.handle, obj, obj->intern->conn->zv.handle, obj->intern->conn);
#endif
if (obj->intern) {
- if (obj->intern->open) {
+ if (obj->intern->open && obj->intern->conn->intern) {
PGresult *res = PQexec(obj->intern->conn->intern->conn, "ROLLBACK");
if (res) {
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));