From 3f880853603c1e206c58fe6703403945d30b4daa Mon Sep 17 00:00:00 2001 From: drrtuy Date: Thu, 11 Sep 2025 11:45:48 +0000 Subject: [PATCH] chore(udf): rename mcsgetplan. --- dbcon/mysql/ha_mcs_client_udfs.cpp | 8 ++++---- dbcon/mysql/install_mcs_mysql.sh.in | 2 +- mysql-test/columnstore/future/rbo_parallel_ces.result | 8 ++++---- mysql-test/columnstore/future/rbo_parallel_ces.test | 8 ++++---- mysql-test/columnstore/include/drop_functions.inc | 2 +- mysql-test/columnstore/include/functions.inc | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dbcon/mysql/ha_mcs_client_udfs.cpp b/dbcon/mysql/ha_mcs_client_udfs.cpp index 1302b2bde..dc905e938 100644 --- a/dbcon/mysql/ha_mcs_client_udfs.cpp +++ b/dbcon/mysql/ha_mcs_client_udfs.cpp @@ -930,8 +930,8 @@ extern "C" // 0 or 'original' -> pre-RBO plan // 1 or 'optimized' -> post-RBO plan // 2 or 'rules' -> comma-separated applied RBO rules - const char* mcsgetplan(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*result*/, unsigned long* length, - char* is_null, char* /*error*/) + const char* mcs_get_plan(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*result*/, unsigned long* length, + char* is_null, char* /*error*/) { if (get_fe_conn_info_ptr() == NULL) { @@ -985,7 +985,7 @@ extern "C" return out->c_str(); } - my_bool mcsgetplan_init(UDF_INIT* initid, UDF_ARGS* args, char* message) + my_bool mcs_get_plan_init(UDF_INIT* initid, UDF_ARGS* args, char* message) { if (args->arg_count > 1) { @@ -1002,7 +1002,7 @@ extern "C" return 0; } - void mcsgetplan_deinit(UDF_INIT* /*initid*/) + void mcs_get_plan_deinit(UDF_INIT* /*initid*/) { } diff --git a/dbcon/mysql/install_mcs_mysql.sh.in b/dbcon/mysql/install_mcs_mysql.sh.in index 708843583..9c36b9a8d 100755 --- a/dbcon/mysql/install_mcs_mysql.sh.in +++ b/dbcon/mysql/install_mcs_mysql.sh.in @@ -80,7 +80,7 @@ CREATE OR REPLACE FUNCTION calenablepartitionsbyvalue RETURNS STRING SONAME 'ha_ CREATE OR REPLACE FUNCTION calshowpartitionsbyvalue RETURNS STRING SONAME 'ha_columnstore.so'; CREATE OR REPLACE AGGREGATE FUNCTION moda RETURNS STRING SONAME 'libregr_mysql.so'; CREATE OR REPLACE FUNCTION mcs_set_ddldebug_level RETURNS STRING SONAME 'ha_columnstore.so'; -CREATE OR REPLACE FUNCTION mcsgetplan RETURNS STRING SONAME 'ha_columnstore.so'; +CREATE OR REPLACE FUNCTION mcs_get_plan RETURNS STRING SONAME 'ha_columnstore.so'; CREATE DATABASE IF NOT EXISTS infinidb_querystats; CREATE TABLE IF NOT EXISTS infinidb_querystats.querystats diff --git a/mysql-test/columnstore/future/rbo_parallel_ces.result b/mysql-test/columnstore/future/rbo_parallel_ces.result index c9581fe02..61ef98ca2 100644 --- a/mysql-test/columnstore/future/rbo_parallel_ces.result +++ b/mysql-test/columnstore/future/rbo_parallel_ces.result @@ -22,9 +22,9 @@ SET @@columnstore_ces_optimization_parallel_factor=5; SELECT SUM(col1) FROM Ti; SUM(col1) 5050 -SET @orig_plan := mcsgetplan('original'); -SET @opt_plan := mcsgetplan('optimized'); -SET @rbo_rules := mcsgetplan('rules'); +SET @orig_plan := mcs_get_plan('original'); +SET @opt_plan := mcs_get_plan('optimized'); +SET @rbo_rules := mcs_get_plan('rules'); SET @uu_tail := SUBSTRING_INDEX(@orig_plan, '--- Union Unit ---', -1); SET @unit_open := CONCAT(CHAR(10),' {',CHAR(10)); SELECT (CHAR_LENGTH(@uu_tail) - CHAR_LENGTH(REPLACE(@uu_tail, @unit_open, '')))/CHAR_LENGTH(@unit_open) AS unions_original; @@ -41,7 +41,7 @@ SET @@columnstore_ces_optimization_parallel_factor=15; SELECT SUM(col1) FROM Ti; SUM(col1) 5050 -SET @opt_plan := mcsgetplan('optimized'); +SET @opt_plan := mcs_get_plan('optimized'); SET @uu_tail := SUBSTRING_INDEX(@opt_plan, '--- Union Unit ---', -1); SELECT (CHAR_LENGTH(@uu_tail) - CHAR_LENGTH(REPLACE(@uu_tail, @unit_open, '')))/CHAR_LENGTH(@unit_open) AS unions_optimized_15; unions_optimized_15 diff --git a/mysql-test/columnstore/future/rbo_parallel_ces.test b/mysql-test/columnstore/future/rbo_parallel_ces.test index 104bb354d..b8f944569 100644 --- a/mysql-test/columnstore/future/rbo_parallel_ces.test +++ b/mysql-test/columnstore/future/rbo_parallel_ces.test @@ -38,9 +38,9 @@ SET @@columnstore_ces_optimization_parallel_factor=5; SELECT SUM(col1) FROM Ti; # Snapshot plans into variables for readability -SET @orig_plan := mcsgetplan('original'); -SET @opt_plan := mcsgetplan('optimized'); -SET @rbo_rules := mcsgetplan('rules'); +SET @orig_plan := mcs_get_plan('original'); +SET @opt_plan := mcs_get_plan('optimized'); +SET @rbo_rules := mcs_get_plan('rules'); # Validate plan contents using stored plans # Count Union Units by looking for opening unit blocks after the marker '--- Union Unit ---' @@ -60,7 +60,7 @@ SET @@columnstore_ces_optimization_parallel_factor=15; # Re-execute to rebuild plan with new factor SELECT SUM(col1) FROM Ti; -SET @opt_plan := mcsgetplan('optimized'); +SET @opt_plan := mcs_get_plan('optimized'); SET @uu_tail := SUBSTRING_INDEX(@opt_plan, '--- Union Unit ---', -1); SELECT (CHAR_LENGTH(@uu_tail) - CHAR_LENGTH(REPLACE(@uu_tail, @unit_open, '')))/CHAR_LENGTH(@unit_open) AS unions_optimized_15; diff --git a/mysql-test/columnstore/include/drop_functions.inc b/mysql-test/columnstore/include/drop_functions.inc index 8e2fdefce..fcc83fcf2 100644 --- a/mysql-test/columnstore/include/drop_functions.inc +++ b/mysql-test/columnstore/include/drop_functions.inc @@ -60,5 +60,5 @@ DROP FUNCTION calenablepartitionsbyvalue; DROP FUNCTION calshowpartitionsbyvalue; DROP FUNCTION moda; DROP FUNCTION mcs_set_ddldebug_level; -DROP FUNCTION mcsgetplan; +DROP FUNCTION mcs_get_plan; --enable_query_log diff --git a/mysql-test/columnstore/include/functions.inc b/mysql-test/columnstore/include/functions.inc index 807df8a5e..fd61377e4 100644 --- a/mysql-test/columnstore/include/functions.inc +++ b/mysql-test/columnstore/include/functions.inc @@ -60,6 +60,6 @@ CREATE OR REPLACE FUNCTION calenablepartitionsbyvalue RETURNS STRING SONAME 'ha_ CREATE OR REPLACE FUNCTION calshowpartitionsbyvalue RETURNS STRING SONAME 'ha_columnstore.so'; CREATE OR REPLACE AGGREGATE FUNCTION moda RETURNS STRING SONAME 'libregr_mysql.so'; CREATE OR REPLACE FUNCTION mcs_set_ddldebug_level RETURNS STRING SONAME 'ha_columnstore.so'; -CREATE OR REPLACE FUNCTION mcsgetplan RETURNS STRING SONAME 'ha_columnstore.so'; +CREATE OR REPLACE FUNCTION mcs_get_plan RETURNS STRING SONAME 'ha_columnstore.so'; --enable_query_log