Admin: Add support for loading sqliteserver variables from config file

Previously, sqliteserver variables (e.g., sqliteserver-mysql_ifaces)
were not loaded from the configuration file during startup or via the
LOAD SQLITESERVER VARIABLES FROM CONFIG command.

This fix adds:
- LOAD SQLITESERVER VARIABLES FROM CONFIG command handling in Admin_Handler
- sqliteserver variables loading during bootstrap in Admin_Bootstrap
pull/5435/head
Rene Cannao 2 months ago
parent 7c8f3c03d0
commit cf1fd5cb35

@ -1047,6 +1047,7 @@ bool ProxySQL_Admin::init(const bootstrap_info_t& bootstrap_info) {
proxysql_config().Read_MySQL_Query_Rules_from_configfile();
proxysql_config().Read_Global_Variables_from_configfile("admin");
proxysql_config().Read_Global_Variables_from_configfile("mysql");
proxysql_config().Read_Global_Variables_from_configfile("sqliteserver");
proxysql_config().Read_PgSQL_Servers_from_configfile(e);
proxysql_config().Read_PgSQL_Users_from_configfile(e);

@ -2007,6 +2007,7 @@ bool admin_handler_command_load_or_save(char *query_no_space, unsigned int query
if (
(query_no_space_length==strlen("LOAD MYSQL VARIABLES FROM CONFIG") && !strncasecmp("LOAD MYSQL VARIABLES FROM CONFIG",query_no_space, query_no_space_length)) ||
(query_no_space_length==strlen("LOAD PGSQL VARIABLES FROM CONFIG") && !strncasecmp("LOAD PGSQL VARIABLES FROM CONFIG", query_no_space, query_no_space_length)) ||
(query_no_space_length==strlen("LOAD SQLITESERVER VARIABLES FROM CONFIG") && !strncasecmp("LOAD SQLITESERVER VARIABLES FROM CONFIG", query_no_space, query_no_space_length)) ||
(query_no_space_length==strlen("LOAD TSDB VARIABLES FROM CONFIG") && !strncasecmp("LOAD TSDB VARIABLES FROM CONFIG", query_no_space, query_no_space_length)) ||
(query_no_space_length==strlen("LOAD GENAI VARIABLES FROM CONFIG") && !strncasecmp("LOAD GENAI VARIABLES FROM CONFIG", query_no_space, query_no_space_length))
) {
@ -2019,6 +2020,9 @@ bool admin_handler_command_load_or_save(char *query_no_space, unsigned int query
if (strcasestr(query_no_space, "PGSQL")) {
rows=SPA->proxysql_config().Read_Global_Variables_from_configfile("pgsql");
proxy_debug(PROXY_DEBUG_ADMIN, 4, "Loaded pgsql global variables from CONFIG\n");
} else if (strcasestr(query_no_space, "SQLITESERVER")) {
rows=SPA->proxysql_config().Read_Global_Variables_from_configfile("sqliteserver");
proxy_debug(PROXY_DEBUG_ADMIN, 4, "Loaded sqliteserver global variables from CONFIG\n");
} else if (strcasestr(query_no_space, "GENAI")) {
rows=SPA->proxysql_config().Read_Global_Variables_from_configfile("genai");
proxy_debug(PROXY_DEBUG_ADMIN, 4, "Loaded genai global variables from CONFIG\n");

Loading…
Cancel
Save