summaryrefslogtreecommitdiff
path: root/libpqpp/unittests/testpq.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-02-28 17:22:24 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2016-02-28 17:22:24 +0000
commit9228b13ad8b8a42277af00bbcd645aa65e0c9f56 (patch)
tree1800183cd6053d9c2703934c2a8a978ed33aa260 /libpqpp/unittests/testpq.cpp
parentPrepare statement upfront during construction (diff)
downloadlibdbpp-postgresql-9228b13ad8b8a42277af00bbcd645aa65e0c9f56.tar.bz2
libdbpp-postgresql-9228b13ad8b8a42277af00bbcd645aa65e0c9f56.tar.xz
libdbpp-postgresql-9228b13ad8b8a42277af00bbcd645aa65e0c9f56.zip
Actually, don't prepare statement upfront during construction as it might not be valid (e.g. uncreated temp tables)libdbpp-postgresql-1.0.3
Diffstat (limited to 'libpqpp/unittests/testpq.cpp')
-rw-r--r--libpqpp/unittests/testpq.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpqpp/unittests/testpq.cpp b/libpqpp/unittests/testpq.cpp
index 088910d..1905192 100644
--- a/libpqpp/unittests/testpq.cpp
+++ b/libpqpp/unittests/testpq.cpp
@@ -271,7 +271,7 @@ BOOST_AUTO_TEST_CASE( statementReuse )
BOOST_REQUIRE_EQUAL(pqconn->preparedStatements.size(), 1);
for (int y = 0; y < 4; y += 1) {
auto m1 = ro->modify("INSERT INTO test(id) VALUES(?)");
- BOOST_REQUIRE_EQUAL(pqconn->preparedStatements.size(), 2);
+ BOOST_REQUIRE_EQUAL(pqconn->preparedStatements.size(), y == 0 ? 1 : 2);
for (int x = 0; x < 4; x += 1) {
m1->bindParamI(0, x);
m1->execute();