aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-01-15 14:57:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-01-15 14:57:06 +0200
commit7d8ecb4a85fa7c18071aeb5f1b5866e485b962d8 (patch)
tree8526bc85ad6a1168d4608d4defc87dfff207a9e5
parent2128d342ad4518604e941d03ad57efaad77842ad (diff)
Check that max connections is greater or equal than min in connection pool
-rw-r--r--odb/pgsql/connection-factory.hxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/odb/pgsql/connection-factory.hxx b/odb/pgsql/connection-factory.hxx
index 686f763..d6f4871 100644
--- a/odb/pgsql/connection-factory.hxx
+++ b/odb/pgsql/connection-factory.hxx
@@ -9,6 +9,7 @@
#include <vector>
#include <cstddef> // std::size_t
+#include <cassert>
#include <odb/details/mutex.hxx>
#include <odb/details/condition.hxx>
@@ -88,7 +89,9 @@ namespace odb
db_ (0),
cond_ (mutex_)
{
- // @@ check min_ <= max_
+ // max_connections == 0 means unlimited.
+ //
+ assert (max_connections == 0 || max_connections >= min_connections);
}
virtual connection_ptr