From 8c9aecce9b624deec7ab727ea119923611b194bc Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Mon, 19 Jan 2026 21:46:29 +0000 Subject: [PATCH] feat: Add LOAD MCP QUERY RULES FROM DISK / TO MEMORY commands - Add LOAD MCP QUERY RULES FROM DISK command - Add LOAD MCP QUERY RULES TO MEMORY command - Both commands copy rules from disk.mcp_query_rules to main.mcp_query_rules This completes the full set of MCP query rules LOAD/SAVE commands, matching the MySQL query rules pattern. --- lib/Admin_Handler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Admin_Handler.cpp b/lib/Admin_Handler.cpp index a3802ae54..5541d6995 100644 --- a/lib/Admin_Handler.cpp +++ b/lib/Admin_Handler.cpp @@ -2348,6 +2348,18 @@ bool admin_handler_command_load_or_save(char *query_no_space, unsigned int query // MCP QUERY RULES commands - handled separately from MYSQL/PGSQL if ((query_no_space_length>20) && ( (!strncasecmp("SAVE MCP QUERY RULES ", query_no_space, 21)) || (!strncasecmp("LOAD MCP QUERY RULES ", query_no_space, 21)) ) ) { + // LOAD MCP QUERY RULES FROM DISK / TO MEMORY + if ( + (query_no_space_length == strlen("LOAD MCP QUERY RULES FROM DISK") && !strncasecmp("LOAD MCP QUERY RULES FROM DISK", query_no_space, query_no_space_length)) + || + (query_no_space_length == strlen("LOAD MCP QUERY RULES TO MEMORY") && !strncasecmp("LOAD MCP QUERY RULES TO MEMORY", query_no_space, query_no_space_length)) + ) { + l_free(*ql,*q); + *q=l_strdup("INSERT OR REPLACE INTO main.mcp_query_rules SELECT * FROM disk.mcp_query_rules"); + *ql=strlen(*q)+1; + return true; + } + // SAVE MCP QUERY RULES TO DISK if ( (query_no_space_length == strlen("SAVE MCP QUERY RULES TO DISK") && !strncasecmp("SAVE MCP QUERY RULES TO DISK", query_no_space, query_no_space_length))