From 66119b74fb9dbef6ae20cd7d752d85eeb18e65a6 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sun, 14 Dec 2025 07:16:34 +0000 Subject: [PATCH] Add comments to select @@version queries to bypass ProxySQL interception ProxySQL now responds directly to `select @@version` queries, which prevents these queries from reaching the backend MySQL server. This commit adds `/* set_testing */` comments to these queries in test files to prevent perfect match interception and allow them to run on the backend. Modified files: - test/tap/tap/utils.cpp - test/tap/tests/set_testing-240.h - test/tap/tests/set_testing.h - test/tap/tests/test_firewall-t.cpp --- test/tap/tap/utils.cpp | 2 +- test/tap/tests/set_testing-240.h | 2 +- test/tap/tests/set_testing.h | 2 +- test/tap/tests/test_firewall-t.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tap/tap/utils.cpp b/test/tap/tap/utils.cpp index 6f5ce42e3..ddc26bcd7 100644 --- a/test/tap/tap/utils.cpp +++ b/test/tap/tap/utils.cpp @@ -400,7 +400,7 @@ int set_admin_global_variable(MYSQL *mysql, const string& var_name, const string int get_server_version(MYSQL *mysql, string& version) { char query[128]; - if (mysql_query(mysql, "select @@version")) { + if (mysql_query(mysql, "select /* set_testing */ @@version")) { fprintf(stderr, "Error %d, %s\n", mysql_errno(mysql), mysql_error(mysql)); return exit_status(); diff --git a/test/tap/tests/set_testing-240.h b/test/tap/tests/set_testing-240.h index d385ef3c5..263dcfaea 100644 --- a/test/tap/tests/set_testing-240.h +++ b/test/tap/tests/set_testing-240.h @@ -474,7 +474,7 @@ int detect_version(CommandLine& cl, bool& is_mariadb) { return 1; } - MYSQL_QUERY(mysql, "select @@version"); + MYSQL_QUERY(mysql, "select /* set_testing */ @@version"); MYSQL_RES *result = mysql_store_result(mysql); MYSQL_ROW row; while ((row = mysql_fetch_row(result))) diff --git a/test/tap/tests/set_testing.h b/test/tap/tests/set_testing.h index 045ba84fb..4fac20e71 100644 --- a/test/tap/tests/set_testing.h +++ b/test/tap/tests/set_testing.h @@ -473,7 +473,7 @@ int detect_version(CommandLine& cl, bool& is_mariadb, bool& is_cluster) { return 1; } - MYSQL_QUERY(mysql, "select @@version"); + MYSQL_QUERY(mysql, "select /* set_testing */ @@version"); MYSQL_RES *result = mysql_store_result(mysql); MYSQL_ROW row; while ((row = mysql_fetch_row(result))) diff --git a/test/tap/tests/test_firewall-t.cpp b/test/tap/tests/test_firewall-t.cpp index a9b8cc6ba..1becb8cba 100644 --- a/test/tap/tests/test_firewall-t.cpp +++ b/test/tap/tests/test_firewall-t.cpp @@ -58,7 +58,7 @@ int main(int argc, char** argv) { MYSQL_QUERY(mysqladmin, "load mysql variables to runtime"); // Test that firewall initialized and blocks all queries - if (mysql_query(mysql, "select @@version")) { + if (mysql_query(mysql, "select /* set_testing */ @@version")) { int myerrno = mysql_errno(mysql); ok(myerrno == 1148, "Any query should be blocked"); }