From 6ffb59b856c6e039b031dc81a8eccedeb9bad3c5 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sat, 17 Jan 2026 00:40:41 +0000 Subject: [PATCH] fix: Use db parameter instead of hardcoded admindb in GenAI database_to_runtime The flush_genai_variables___database_to_runtime() function was using hardcoded 'admindb' instead of the 'db' parameter passed to the function. This caused the function to always query from admindb, ignoring the actual database parameter. This fixes the issue where runtime_global_variables table was not being populated on startup because the query was always hitting the same database regardless of the parameter. --- lib/Admin_FlushVariables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Admin_FlushVariables.cpp b/lib/Admin_FlushVariables.cpp index 8d50ab4e7..4aced07a0 100644 --- a/lib/Admin_FlushVariables.cpp +++ b/lib/Admin_FlushVariables.cpp @@ -1054,7 +1054,7 @@ void ProxySQL_Admin::flush_genai_variables___database_to_runtime(SQLite3DB* db, int affected_rows = 0; SQLite3_result* resultset = NULL; char* q = (char*)"SELECT variable_name, variable_value FROM global_variables WHERE variable_name LIKE 'genai-%'"; - admindb->execute_statement(q, &error, &cols, &affected_rows, &resultset); + db->execute_statement(q, &error, &cols, &affected_rows, &resultset); if (error) { proxy_error("Error on %s : %s\n", q, error); return;