From 017496bc451ad29f37bc691dd2eb0d5d80d5ecfa Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sat, 18 Apr 2026 11:16:38 +0000 Subject: [PATCH] test(mysqlx): add runtime_mysqlx_variables to config-store test fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MysqlxConfigStore::load_from_runtime issues five fetch_result queries in sequence and returns false (leaving the store empty) if any one fails. One of those queries — SELECT FROM runtime_mysqlx_variables — hit a table that create_test_db() never created, so every scenario that depended on data actually being loaded silently short-circuited before the swap. Effect: eight assertions in mysqlx_config_store_pure_unit-t.cpp were quietly failing under the pre-existing plan(25) — none of the tests that exercised a loaded identity, route, or endpoint were actually verifying the production code, because identities_/routes_/ hostgroup_endpoints_ were never populated. Adding the DDL fixes all eight. No production changes; test harness only. --- .../tests/unit/mysqlx_config_store_pure_unit-t.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/tap/tests/unit/mysqlx_config_store_pure_unit-t.cpp b/test/tap/tests/unit/mysqlx_config_store_pure_unit-t.cpp index fbd8b1553..839fbe017 100644 --- a/test/tap/tests/unit/mysqlx_config_store_pure_unit-t.cpp +++ b/test/tap/tests/unit/mysqlx_config_store_pure_unit-t.cpp @@ -46,6 +46,16 @@ const char kRuntimeMysqlxEndpointsDdl[] = " PRIMARY KEY (hostname, mysql_port)" " )"; +// load_from_runtime also queries runtime_mysqlx_variables. Without the table +// fetch_result returns false and the load short-circuits before swapping in +// the newly-loaded routes/identities, silently breaking every scenario in +// this file that depended on data actually being loaded. +const char kRuntimeMysqlxVariablesDdl[] = + "CREATE TABLE runtime_mysqlx_variables (" + " variable_name VARCHAR NOT NULL PRIMARY KEY," + " variable_value VARCHAR NOT NULL DEFAULT ''" + " )"; + std::unique_ptr create_test_db() { auto db = std::make_unique(); db->open((char*)":memory:", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX); @@ -54,6 +64,7 @@ std::unique_ptr create_test_db() { db->execute(kRuntimeMysqlxUsersDdl); db->execute(kRuntimeMysqlxRoutesDdl); db->execute(kRuntimeMysqlxEndpointsDdl); + db->execute(kRuntimeMysqlxVariablesDdl); return db; }