Commit dc89967b authored by Francis Dupont's avatar Francis Dupont

[#1008] Updated pgsql_host_data_source.cc

parent 68139698
......@@ -1442,7 +1442,7 @@ public:
/// has failed.
std::pair<uint32_t, uint32_t> getVersion() const;
/// @brief Pointer to the object representing an exchange which
/// @Brief Pointer to the object representing an exchange which
/// can be used to retrieve hosts and DHCPv4 options.
boost::shared_ptr<PgSqlHostWithOptionsExchange> host_exchange_;
......@@ -1464,6 +1464,9 @@ public:
/// or dhcp6_options table.
boost::shared_ptr<PgSqlOptionExchange> host_option_exchange_;
/// @brief The parameters
PgSqlConnection::ParameterMap parameters_;
/// @brief PgSQL connection
PgSqlConnection conn_;
......@@ -1913,12 +1916,10 @@ PgSqlHostDataSourceImpl(const PgSqlConnection::ParameterMap& parameters)
DHCP4_AND_DHCP6)),
host_ipv6_reservation_exchange_(new PgSqlIPv6ReservationExchange()),
host_option_exchange_(new PgSqlOptionExchange()),
parameters_(parameters),
conn_(parameters),
is_readonly_(false) {
// Open the database.
conn_.openDatabase();
// Validate the schema version first.
std::pair<uint32_t, uint32_t> code_version(PG_SCHEMA_VERSION_MAJOR,
PG_SCHEMA_VERSION_MINOR);
......@@ -1931,6 +1932,9 @@ PgSqlHostDataSourceImpl(const PgSqlConnection::ParameterMap& parameters)
<< db_version.second);
}
// Open the database.
conn_.openDatabase();
// Now prepare the SQL statements.
conn_.prepareStatements(tagged_statements.begin(),
tagged_statements.begin() + WRITE_STMTS_BEGIN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment