Potapov Sergey
2014-Sep-03 12:41 UTC
Assertion failed in sql_transaction_commit with pgsql driver
Hi! Next code from driver_pgsql_transaction_commit cause assertion failed in do_query function - i_assert(SQL_DB_IS_READY(&db->api)) } else { /* multiple queries, use a transaction */ ctx->refcount++; sql_query(_ctx->db, "BEGIN", transaction_begin_callback, ctx); <- first sql_query changes db state to SQL_DB_STATE_BUSY while (_ctx->head != NULL) { ctx->refcount++; sql_query(_ctx->db, _ctx->head->query, <- second query cause assertion failed due to SQL_DB_IS_READY returns false transaction_update_callback, _ctx->head); _ctx->head = _ctx->head->next; } sql_query(_ctx->db, "COMMIT", transaction_commit_callback, ctx); } Next transaction query should be called after previous is finished and driver state changed to SQL_DB_STATE_IDLE