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.
pull/5310/head
Rene Cannao 3 months ago
parent 4018a0ad3b
commit 6ffb59b856

@ -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;

Loading…
Cancel
Save