diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-01-02 20:40:11 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-01-02 20:40:11 +0100 |
commit | 7334cfc40995c98aa550fedc7b249d9c08100028 (patch) | |
tree | 27ee7cc6ed6fe18615fff32f67b3839de84c7805 /src/backenddb/test_merchantdb.c | |
parent | feb6c3c694f6f083d7b8d09a35f2074d5c3d44f4 (diff) | |
download | merchant-7334cfc40995c98aa550fedc7b249d9c08100028.tar.gz merchant-7334cfc40995c98aa550fedc7b249d9c08100028.tar.bz2 merchant-7334cfc40995c98aa550fedc7b249d9c08100028.zip |
fix DB initialization logic to avoid CREATE table attempts in taler-merchant-httpd
Diffstat (limited to 'src/backenddb/test_merchantdb.c')
-rw-r--r-- | src/backenddb/test_merchantdb.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c index a08139e9..9be7933d 100644 --- a/src/backenddb/test_merchantdb.c +++ b/src/backenddb/test_merchantdb.c @@ -6660,12 +6660,24 @@ run (void *cls) /* Data for 'store_payment()' */ /* Drop the tables to cleanup anything that might cause issues */ - if (NULL == (plugin = TALER_MERCHANTDB_plugin_load (cfg, - true))) + if (NULL == (plugin = TALER_MERCHANTDB_plugin_load (cfg))) { result = 77; return; } + (void) plugin->drop_tables (plugin->cls); + if (GNUNET_OK != + plugin->create_tables (plugin->cls)) + { + result = 77; + return; + } + if (GNUNET_OK != + plugin->connect (plugin->cls)) + { + result = 17; + return; + } /* Run the preflight */ plugin->preflight (plugin->cls); |