namespace {
-#if 0 // TKM
-/// @brief Maximum size of an IPv6 address represented as a text string.
-///
-/// This is 32 hexadecimal characters written in 8 groups of four, plus seven
-/// colon separators.
-const size_t ADDRESS6_TEXT_MAX_LEN = 39;
-
-/// @brief Maximum length of classes stored in a dhcp4/6_client_classes
-/// columns.
-const size_t CLIENT_CLASSES_MAX_LEN = 255;
-
-/// @brief Maximum length of the hostname stored in DNS.
-///
-/// This length is restricted by the length of the domain-name carried
-/// in the Client FQDN %Option (see RFC4702 and RFC4704).
-const size_t HOSTNAME_MAX_LEN = 255;
-#endif
-
/// @brief Maximum length of option value.
const size_t OPTION_VALUE_MAX_LEN = 4096;
-#if 0
-/// @brief Maximum length of option value specified in textual format.
-const size_t OPTION_FORMATTED_VALUE_MAX_LEN = 8192;
-
-/// @brief Maximum length of option space name.
-const size_t OPTION_SPACE_MAX_LEN = 128;
-#endif
-
/// @brief Numeric value representing last supported identifier.
///
/// This value is used to validate whether the identifier type stored in
uint32_t host_id = impl_->addStatement(PgSqlHostDataSourceImpl::INSERT_HOST,
bind_array, true);
- // @todo TKM take this out
- std::cout << "id of new host: " << host_id << std::endl;
-
// Insert DHCPv4 options.
ConstCfgOptionPtr cfg_option4 = host->getCfgOption4();
if (cfg_option4) {
return(impl_->getVersion());
}
-#if 0
-// Do we really need these ?
-void
-PgSqlHostDataSource::commit() {
- impl_->conn_.commit();
-}
-
-
-void
-PgSqlHostDataSource::rollback() {
- impl_->conn_.rollback();
-}
-#endif
-
-
}; // end of isc::dhcp namespace
}; // end of isc namespace
testHostname("foo.example.org", 100);
}
-// Test verifies if a host without any hostname specified can be stored and
+// Test verifies if a host without any hostname specified can be stored and
// later retrieved.
TEST_F(PgSqlHostDataSourceTest, noHostname) {
testHostname("", 1);
testOptionsReservations46(true);
}
-#if 0
// This test checks transactional insertion of the host information
// into the database. The failure to insert host information at
// any stage should cause the whole transaction to be rolled back.
params["password"] = "keatest";
PgSqlConnection conn(params);
ASSERT_NO_THROW(conn.openDatabase());
- int status = mysql_query(conn.mysql_,
- "DROP TABLE IF EXISTS ipv6_reservations");
- ASSERT_EQ(0, status) << mysql_error(conn.mysql_);
+
+ PgSqlResult r(PQexec(conn, "DROP TABLE IF EXISTS ipv6_reservations"));
+ ASSERT_TRUE (PQresultStatus(r) == PGRES_COMMAND_OK)
+ << " drop command failed :" << PQerrorMessage(conn);
// Create a host with a reservation.
HostPtr host = initializeHost6("2001:db8:1::1", Host::IDENT_HWADDR, false);
host->getIdentifier().size());
EXPECT_FALSE(from_hds);
}
-#endif
}; // Of anonymous namespace