diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-07-20 17:46:42 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-07-20 17:46:42 +0200 |
commit | 43dd7c8ae663fcb3db64fb7571c56144baa83a0e (patch) | |
tree | 740abce6ad63c1d7e47ec49c6d9408c2f3199220 /src/backenddb/plugin_merchantdb_postgres.c | |
parent | 44f26ef64f0036474f4eed6974886ee4f41e28f0 (diff) | |
download | merchant-43dd7c8ae663fcb3db64fb7571c56144baa83a0e.tar.gz merchant-43dd7c8ae663fcb3db64fb7571c56144baa83a0e.tar.bz2 merchant-43dd7c8ae663fcb3db64fb7571c56144baa83a0e.zip |
die on bugs, do not commit
Diffstat (limited to 'src/backenddb/plugin_merchantdb_postgres.c')
-rw-r--r-- | src/backenddb/plugin_merchantdb_postgres.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c index 2dc17b43..ed051053 100644 --- a/src/backenddb/plugin_merchantdb_postgres.c +++ b/src/backenddb/plugin_merchantdb_postgres.c @@ -155,7 +155,7 @@ postgres_create_tables (void *cls) /** * Do a pre-flight check that we are not in an uncommitted transaction. - * If we are, try to commit the previous transaction and output a warning. + * If we are, die. * Does not return anything, as we will continue regardless of the outcome. * * @param cls the `struct PostgresClosure` with the plugin-specific state @@ -164,28 +164,13 @@ static void postgres_preflight (void *cls) { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_ExecuteStatement es[] = { - GNUNET_PQ_make_execute ("COMMIT"), - GNUNET_PQ_EXECUTE_STATEMENT_END - }; if (NULL == pg->transaction_name) return; /* all good */ - if (GNUNET_OK == - GNUNET_PQ_exec_statements (pg->conn, - es)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "BUG: Preflight check committed transaction `%s'!\n", - pg->transaction_name); - } - else - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "BUG: Preflight check failed to commit transaction `%s'!\n", - pg->transaction_name); - } - pg->transaction_name = NULL; + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "BUG: Preflight check detected running transaction `%s'!\n", + pg->transaction_name); + GNUNET_assert (0); } |