Make sure to close the transactions after repack_one_table
If we exit early (e.g. checking the triggers) repack_cleanup() is not called but we must close the transactions anyway.
This commit is contained in:
parent
477fba884c
commit
fb07fad34a
@ -1253,6 +1253,10 @@ cleanup:
|
|||||||
if (vxid)
|
if (vxid)
|
||||||
free(vxid);
|
free(vxid);
|
||||||
|
|
||||||
|
/* Rollback current transactions */
|
||||||
|
pgut_rollback(connection);
|
||||||
|
pgut_rollback(conn2);
|
||||||
|
|
||||||
/* XXX: distinguish between fatal and non-fatal errors via the first
|
/* XXX: distinguish between fatal and non-fatal errors via the first
|
||||||
* arg to repack_cleanup().
|
* arg to repack_cleanup().
|
||||||
*/
|
*/
|
||||||
@ -1491,10 +1495,6 @@ repack_cleanup(bool fatal, const repack_table *table)
|
|||||||
char buffer[12];
|
char buffer[12];
|
||||||
const char *params[1];
|
const char *params[1];
|
||||||
|
|
||||||
/* Rollback current transactions */
|
|
||||||
pgut_rollback(connection);
|
|
||||||
pgut_rollback(conn2);
|
|
||||||
|
|
||||||
/* Try reconnection if not available. */
|
/* Try reconnection if not available. */
|
||||||
if (PQstatus(connection) != CONNECTION_OK ||
|
if (PQstatus(connection) != CONNECTION_OK ||
|
||||||
PQstatus(conn2) != CONNECTION_OK)
|
PQstatus(conn2) != CONNECTION_OK)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user