diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-01-15 14:57:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-01-15 14:57:06 +0200 |
commit | 6154fad72edd975b9a27a9d21d2915c0f7843907 (patch) | |
tree | 20dc5e57e786f29ae9ffa6b482ca25a1aa9f2863 | |
parent | 026bf452ea1227b683898be91ac38a2185d3bf2c (diff) |
Check that max connections is greater or equal than min in connection pool
-rw-r--r-- | odb/mysql/connection-factory.hxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/odb/mysql/connection-factory.hxx b/odb/mysql/connection-factory.hxx index 1d4610e..71011b1 100644 --- a/odb/mysql/connection-factory.hxx +++ b/odb/mysql/connection-factory.hxx @@ -9,6 +9,7 @@ #include <vector> #include <cstddef> // std::size_t +#include <cassert> #include <odb/mysql/version.hxx> #include <odb/mysql/forward.hxx> @@ -93,7 +94,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 |