From 3ac0c2dd8a2c918f4f3fc636371c912cd38dfc10 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sat, 21 Mar 2026 10:20:00 +0000 Subject: [PATCH] Fix legacy TAP tests: clickhouse_php_conn and reg_test_3317 - clickhouse_php_conn-t.php: Fix deprecated ClickHouse MergeTree syntax Change from deprecated ENGINE=MergeTree(EventDate, (EventDate), 8192) to new syntax ENGINE=MergeTree() ORDER BY (EventDate) - reg_test_3317-lock_hostgroup_special_queries-t.cpp: Add query annotations Add /* ;hostgroup=1300 */ hints to SELECT statements to ensure proper routing when connection is locked to hostgroup 1300 --- test/tap/tests/clickhouse_php_conn-t.php | 2 +- .../reg_test_3317-lock_hostgroup_special_queries-t.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/tap/tests/clickhouse_php_conn-t.php b/test/tap/tests/clickhouse_php_conn-t.php index ba5763753..8b8d1fc9a 100644 --- a/test/tap/tests/clickhouse_php_conn-t.php +++ b/test/tap/tests/clickhouse_php_conn-t.php @@ -89,7 +89,7 @@ if ($port !== 6090) { $proxy->query("CREATE DATABASE IF NOT EXISTS test"); $proxy->query("USE test"); $proxy->query("DROP TABLE IF EXISTS types_table"); - $proxy->query("CREATE TABLE IF NOT EXISTS types_table (EventDate DATE, DateTime DATETIME, col1 UInt8, col2 Int16, col3 Int32, col4 Int64, col5 Nullable(Float32), col6 Float64, col7 Decimal64(3)) ENGINE=MergeTree(EventDate, (EventDate), 8192)"); + $proxy->query("CREATE TABLE IF NOT EXISTS types_table (EventDate DATE, DateTime DATETIME, col1 UInt8, col2 Int16, col3 Int32, col4 Int64, col5 Nullable(Float32), col6 Float64, col7 Decimal64(3)) ENGINE=MergeTree() ORDER BY (EventDate)"); } $shortName = exec('date +%Z'); diff --git a/test/tap/tests/reg_test_3317-lock_hostgroup_special_queries-t.cpp b/test/tap/tests/reg_test_3317-lock_hostgroup_special_queries-t.cpp index d45faf920..10b8ebf35 100644 --- a/test/tap/tests/reg_test_3317-lock_hostgroup_special_queries-t.cpp +++ b/test/tap/tests/reg_test_3317-lock_hostgroup_special_queries-t.cpp @@ -34,7 +34,7 @@ void check_set_names(MYSQL* proxysql_mysql) { return; } - query_res = mysql_query(proxysql_mysql, "SELECT @@character_set_client, @@character_set_results, @@character_set_connection"); + query_res = mysql_query(proxysql_mysql, "SELECT /* ;hostgroup=1300 */ @@character_set_client, @@character_set_results, @@character_set_connection"); if (query_res) { diag("Query failed with error: %s", mysql_error(proxysql_mysql)); return; @@ -78,7 +78,7 @@ void check_set_names(MYSQL* proxysql_mysql) { * @param proxysql_mysql A MYSQL handle to an already stablished MySQL connection. */ void check_autocommit(MYSQL* proxysql_mysql) { - int query_res = mysql_query(proxysql_mysql, "SELECT @@autocommit"); + int query_res = mysql_query(proxysql_mysql, "SELECT /* ;hostgroup=1300 */ @@autocommit"); if (query_res) { diag("Query failed with error: %s", mysql_error(proxysql_mysql)); return; @@ -105,7 +105,7 @@ void check_autocommit(MYSQL* proxysql_mysql) { } // Check new status on @@autocommit - query_res = mysql_query(proxysql_mysql, "SELECT @@autocommit"); + query_res = mysql_query(proxysql_mysql, "SELECT /* ;hostgroup=1300 */ @@autocommit"); if (query_res) { diag("Query failed with error: %s", mysql_error(proxysql_mysql)); return; @@ -140,7 +140,7 @@ void check_session_character_set_server(MYSQL* proxysql_mysql) { return; } - query_res = mysql_query(proxysql_mysql, "SELECT @@character_set_server"); + query_res = mysql_query(proxysql_mysql, "SELECT /* ;hostgroup=1300 */ @@character_set_server"); if (query_res) { diag("Query failed with error: %s", mysql_error(proxysql_mysql)); return; @@ -179,7 +179,7 @@ void check_session_character_set_results(MYSQL* proxysql_mysql) { return; } - query_res = mysql_query(proxysql_mysql, "SELECT @@character_set_results"); + query_res = mysql_query(proxysql_mysql, "SELECT /* ;hostgroup=1300 */ @@character_set_results"); if (query_res) { diag("Query failed with error: %s", mysql_error(proxysql_mysql)); return;