aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSree Harsha Totakura <sreeharsha@totakura.in>2015-03-05 16:10:42 +0100
committerSree Harsha Totakura <sreeharsha@totakura.in>2015-03-05 16:10:42 +0100
commit7a37751446e061816631e66ab0ba28da8bd6d203 (patch)
treecab9e668d2c4039b0557b6810690f20535670964
parentf7b5cf02ae0f25af55032e32bc09f21b81b551e7 (diff)
downloadexchange-7a37751446e061816631e66ab0ba28da8bd6d203.tar.gz
exchange-7a37751446e061816631e66ab0ba28da8bd6d203.tar.bz2
exchange-7a37751446e061816631e66ab0ba28da8bd6d203.zip
Fix broken compilation: add temporary flag to DB_get_connection()
-rw-r--r--src/mint/mint_db.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mint/mint_db.c b/src/mint/mint_db.c
index 91d6705c3..354bb7008 100644
--- a/src/mint/mint_db.c
+++ b/src/mint/mint_db.c
@@ -747,18 +747,18 @@ TALER_MINT_DB_init (const char *connection_cfg)
* Get the thread-local database-handle.
* Connect to the db if the connection does not exist yet.
*
+ * @param temporary #GNUNET_YES to use a temporary schema; #GNUNET_NO to use the
+ * database default one
* @return the database connection, or NULL on error
*/
PGconn *
-TALER_MINT_DB_get_connection (void)
+TALER_MINT_DB_get_connection (int temporary)
{
PGconn *db_conn;
if (NULL != (db_conn = pthread_getspecific (db_conn_threadlocal)))
return db_conn;
-
db_conn = PQconnectdb (TALER_MINT_db_connection_cfg_str);
-
if (CONNECTION_OK !=
PQstatus (db_conn))
{
@@ -767,7 +767,12 @@ TALER_MINT_DB_get_connection (void)
GNUNET_break (0);
return NULL;
}
-
+ if ((GNUNET_YES == temporary)
+ && (GNUNET_SYSERR == set_temporary_schema(db_conn)))
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
if (GNUNET_OK !=
TALER_MINT_DB_prepare (db_conn))
{