Skip to content

Commit

Permalink
[postfix] rename galaxy.so to polarx_udf.so
Browse files Browse the repository at this point in the history
NOTES
-----
It's a temporary fix. Most of galaxy definitions have not been fixed.
  • Loading branch information
jiyang.zjy committed Oct 24, 2023
1 parent ad9b6d0 commit e08f80b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion mysql-test/include/plugin.defs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ qa_auth_interface plugin_output_directory PLUGIN_AUTH_INTE
qa_auth_server plugin_output_directory PLUGIN_AUTH_SERVER qa_auth_server
qa_auth_client plugin_output_directory PLUGIN_AUTH_CLIENT qa_auth_client
udf_example plugin_output_directory UDF_EXAMPLE_LIB
galaxy plugin_output_directory GALAXY_PLUGIN
polarx_udf plugin_output_directory GALAXY_PLUGIN
ha_example plugin_output_directory EXAMPLE_PLUGIN EXAMPLE
semisync_master plugin_output_directory SEMISYNC_MASTER_PLUGIN
semisync_slave plugin_output_directory SEMISYNC_SLAVE_PLUGIN
Expand Down
23 changes: 11 additions & 12 deletions mysql-test/suite/galaxystore/r/feature_galaxy_plugin.result
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
Install galaxy plugin
INSTALL PLUGIN galaxy SONAME "galaxy.so";
Install polarx_udf plugin
INSTALL PLUGIN polarx_udf SONAME "polarx_udf.so";
galax plugin status
show global status like '%galaxy%';
show global status like '%polarx_udf%';
Variable_name Value
Galaxyx_address #
Galaxyx_port #
galaxy_bloomfilter_call_count #
galaxy_hllndv_call_count #
galaxy_hyperloglog_call_count #
polarx_udf_number_bloomfilter_calls #
polarx_udf_number_hashcheck_calls #
polarx_udf_number_hllndv_calls #
polarx_udf_number_hyperloglog_calls #
performance_schema metrics
select * from performance_schema.user_defined_functions where UDF_NAME in ('hyperloglog', 'hllndv', 'bloomfilter');
UDF_NAME UDF_RETURN_TYPE UDF_TYPE UDF_LIBRARY UDF_USAGE_COUNT
bloomfilter integer function 1
hllndv integer aggregate 1
hyperloglog char aggregate 1
test create/drop inner function
create function bloomfilter returns int soname "galaxy.so";
create function bloomfilter returns int soname "polarx_udf.so";
ERROR HY000: Function 'bloomfilter' already exists
create function hyperloglog returns int soname "galaxy.so";
create function hyperloglog returns int soname "polarx_udf.so";
ERROR HY000: Function 'hyperloglog' already exists
create function hllndv returns int soname "galaxy.so";
create function hllndv returns int soname "polarx_udf.so";
ERROR HY000: Function 'hllndv' already exists
drop function bloomfilter;
ERROR HY000: DROP FUNCTION can't drop a dynamically registered user defined function
drop function hyperloglog;
ERROR HY000: DROP FUNCTION can't drop a dynamically registered user defined function
drop function hllndv;
ERROR HY000: DROP FUNCTION can't drop a dynamically registered user defined function
UNINSTALL PLUGIN galaxy;
UNINSTALL PLUGIN polarx_udf;
select * from performance_schema.user_defined_functions where UDF_NAME in ('hyperloglog', 'hllndv', 'bloomfilter');
UDF_NAME UDF_RETURN_TYPE UDF_TYPE UDF_LIBRARY UDF_USAGE_COUNT
8 changes: 4 additions & 4 deletions mysql-test/suite/galaxystore/t/feature_galaxy_plugin.test
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
--source include/have_galaxy.inc

--echo Install galaxy plugin
--echo Install polarx_udf plugin

eval INSTALL PLUGIN galaxy SONAME "$GALAXY_PLUGIN";
eval INSTALL PLUGIN polarx_udf SONAME "$GALAXY_PLUGIN";

--echo galax plugin status

--replace_column 2 #
show global status like '%galaxy%';
show global status like '%polarx_udf%';

--echo performance_schema metrics
select * from performance_schema.user_defined_functions where UDF_NAME in ('hyperloglog', 'hllndv', 'bloomfilter');
Expand All @@ -32,6 +32,6 @@ drop function hyperloglog;
--error ER_UDF_DROP_DYNAMICALLY_REGISTERED
drop function hllndv;

UNINSTALL PLUGIN galaxy;
UNINSTALL PLUGIN polarx_udf;

select * from performance_schema.user_defined_functions where UDF_NAME in ('hyperloglog', 'hllndv', 'bloomfilter');
8 changes: 4 additions & 4 deletions plugin/galaxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

ADD_DEFINITIONS(-DLOG_COMPONENT_TAG="galaxy")
ADD_DEFINITIONS(-DLOG_COMPONENT_TAG="polarx_udf")

INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIR})

SET(GALAXY_SOURCES
SET(POLARX_UDF_SOURCES
plugin.h
plugin.cc
udf/udf.cc
Expand All @@ -38,6 +38,6 @@ SET(GALAXY_SOURCES
service/service_udf.cc)


MYSQL_ADD_PLUGIN(galaxy ${GALAXY_SOURCES} MODULE_ONLY MODULE_OUTPUT_NAME
"galaxy")
MYSQL_ADD_PLUGIN(polarx_udf ${POLARX_UDF_SOURCES} MODULE_ONLY MODULE_OUTPUT_NAME
"polarx_udf")

8 changes: 4 additions & 4 deletions plugin/galaxy/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ static SYS_VAR *galaxy_system_vars[] = {

/** All counter for show global status */
static SHOW_VAR galaxy_status_vars[] = {
{"galaxy_bloomfilter_call_count",
{"polarx_udf_number_bloomfilter_calls",
(char *)&udf::udf_counter.bloomfilter_counter, SHOW_LONG,
SHOW_SCOPE_GLOBAL},
{"galaxy_hyperloglog_call_count",
{"polarx_udf_number_hyperloglog_calls",
(char *)&udf::udf_counter.hyperloglog_counter, SHOW_LONG,
SHOW_SCOPE_GLOBAL},
{"galaxy_hllndv_call_count", (char *)&udf::udf_counter.hllndv_counter,
{"polarx_udf_number_hllndv_calls", (char *)&udf::udf_counter.hllndv_counter,
SHOW_LONG, SHOW_SCOPE_GLOBAL},
{"galaxy_hashcheck_call_count", (char*)&udf::udf_counter.hashcheck_counter, SHOW_LONG,
{"polarx_udf_number_hashcheck_calls", (char*)&udf::udf_counter.hashcheck_counter, SHOW_LONG,
SHOW_SCOPE_GLOBAL},
{NULL, NULL, SHOW_LONG, SHOW_SCOPE_GLOBAL},
};
Expand Down
2 changes: 1 addition & 1 deletion plugin/galaxy/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
#ifndef PLUGIN_GALAXY_PLUGIN_H
#define PLUGIN_GALAXY_PLUGIN_H

#define GALAXY_PLUGIN_NAME "galaxy"
#define GALAXY_PLUGIN_NAME "polarx_udf"

#endif

0 comments on commit e08f80b

Please sign in to comment.