summaryrefslogtreecommitdiff
path: root/libodbcpp/odbc-mock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/odbc-mock.cpp')
-rw-r--r--libodbcpp/odbc-mock.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libodbcpp/odbc-mock.cpp b/libodbcpp/odbc-mock.cpp
index 71c4c56..2799fb3 100644
--- a/libodbcpp/odbc-mock.cpp
+++ b/libodbcpp/odbc-mock.cpp
@@ -4,8 +4,9 @@
namespace ODBC {
-Mock::Mock(const std::string & masterdb, const std::string & name, const std::vector<boost::filesystem::path> & ss) :
- MockServerDatabase(masterdb, name, "odbc")
+Mock::Mock(const std::string & b, const std::string & masterdb, const std::string & name, const std::vector<boost::filesystem::path> & ss) :
+ MockServerDatabase(b + ";" + masterdb, name, "odbc"),
+ base(b)
{
CreateNewDatabase();
PlaySchemaScripts(ss);
@@ -14,7 +15,7 @@ Mock::Mock(const std::string & masterdb, const std::string & name, const std::ve
DB::Connection *
Mock::openConnection() const
{
- return new Connection(stringbf("Driver=postgresql;Database=%s;uid=postgres;servername=/run/postgresql", testDbName));
+ return new Connection(stringbf("%s;Database=%s", base, testDbName));
}
Mock::~Mock()
@@ -24,7 +25,6 @@ Mock::~Mock()
void Mock::DropDatabase() const
{
- master->execute("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = '" + testDbName + "'");
MockServerDatabase::DropDatabase();
}