2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-13 14:06:26 +00:00

[#1709] add test for "ALTER TABLE logs ADD id"

This commit is contained in:
Andrei Pavel
2021-02-16 16:46:19 +02:00
parent 23dda3f3f2
commit d9d143b425
2 changed files with 11 additions and 4 deletions

View File

@@ -261,7 +261,7 @@ mysql_upgrade_test() {
version=$("${kea_admin}" db-version mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}")
assert_str_eq "1.0" "${version}" "Expected kea-admin to return %s, returned value was %s"
# Ok, we have a 1.0 database. Let's upgrade it to 9.5
# Ok, we have a 1.0 database. Let's upgrade it to 9.6
run_command \
"${kea_admin}" db-upgrade mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}"
assert_eq 0 "${EXIT_CODE}" "kea-admin db-upgrade mysql failed, expected %d, returned non-zero status code %d\n"
@@ -825,9 +825,16 @@ insert into hosts(dhcp_identifier, dhcp_identifier_type, dhcp4_subnet_id, ipv4_a
qry="select cache_threshold, cache_max_age from dhcp6_subnet"
run_statement "dhcp6_shared_network" "$qry"
# Verify upgraded schema reports version 9.5
# Schema upgrade from 9.5 to 9.6.
qry='SELECT id FROM logs';
run_command \
mysql_execute "${qry}"
assert_eq 0 "${EXIT_CODE}" "${qry} failed: expected status code %d, returned %d"
# Verify upgraded schema reports version 9.6
version=$("${kea_admin}" db-version mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}")
assert_str_eq "9.5" "${version}" "Expected kea-admin to return %s, returned value was %s"
assert_str_eq "9.6" "${version}" "Expected kea-admin to return %s, returned value was %s"
# Let's wipe the whole database
mysql_wipe

View File

@@ -53,7 +53,7 @@ const int MLM_MYSQL_FETCH_FAILURE = 0;
/// @name Current database schema version values.
//@{
const uint32_t MYSQL_SCHEMA_VERSION_MAJOR = 9;
const uint32_t MYSQL_SCHEMA_VERSION_MINOR = 5;
const uint32_t MYSQL_SCHEMA_VERSION_MINOR = 6;
//@}