diff --git a/.gitignore b/.gitignore index ee1c67405..c6e72fa1f 100644 --- a/.gitignore +++ b/.gitignore @@ -140,4 +140,4 @@ oam/post/mcstest-001.sh oam/post/mcstest-002.sh oam/post/mcstest-003.sh oam/post/mcstest-004.sh - +dbcon/mysql/ha_mcs_version.h diff --git a/cmake/columnstore_version.cmake b/cmake/columnstore_version.cmake index 571fba591..5acdcc8a6 100644 --- a/cmake/columnstore_version.cmake +++ b/cmake/columnstore_version.cmake @@ -42,6 +42,12 @@ IF(NOT "${CS_MAJOR_VERSION}" MATCHES "[0-9]+" OR ENDIF () SET(PACKAGE_VERSION "${CS_MAJOR_VERSION}.${CS_MINOR_VERSION}.${CS_PATCH_VERSION}${CS_EXTRA_VERSION}") SET(PACKAGE_RELEASE "${CS_RELEASE_VERSION}") + if (${CS_MINOR_VERSION} LESS 10) + SET(MCSVERSIONHEX "0x0${CS_MAJOR_VERSION}0${CS_MINOR_VERSION}") + else () + SET(MCSVERSIONHEX "0x0${CS_MAJOR_VERSION}${CS_MINOR_VERSION}") + endif () + ENDMACRO() # Get columnstore version diff --git a/dbcon/mysql/CMakeLists.txt b/dbcon/mysql/CMakeLists.txt index 6a06ad703..8f1610c02 100644 --- a/dbcon/mysql/CMakeLists.txt +++ b/dbcon/mysql/CMakeLists.txt @@ -1,5 +1,5 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/install_mcs_mysql.sh.in" "${CMAKE_CURRENT_SOURCE_DIR}/install_mcs_mysql.sh" @ONLY) - +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ha_mcs_version.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/ha_mcs_version.h") include_directories( ${ENGINE_COMMON_INCLUDES} /usr/include/libxml2 ) diff --git a/dbcon/mysql/ha_mcs.cpp b/dbcon/mysql/ha_mcs.cpp index 77c71d5bd..6af9a7ceb 100644 --- a/dbcon/mysql/ha_mcs.cpp +++ b/dbcon/mysql/ha_mcs.cpp @@ -24,6 +24,7 @@ #define NEED_CALPONT_EXTERNS #include "ha_mcs_impl.h" #include "is_columnstore.h" +#include "ha_mcs_version.h" static handler* calpont_create_handler(handlerton* hton, TABLE_SHARE* table, @@ -925,23 +926,6 @@ static struct st_mysql_information_schema is_columnstore_plugin_version = { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; -mysql_declare_plugin(columnstore) -{ - MYSQL_STORAGE_ENGINE_PLUGIN, - &columnstore_storage_engine, - "Columnstore", - "MariaDB", - "Columnstore storage engine", - PLUGIN_LICENSE_GPL, - columnstore_init_func, /* Plugin Init */ - columnstore_done_func, /* Plugin Deinit */ - 0x0100 /* 1.0 */, - mcs_status_variables, /* status variables */ - mcs_system_variables, /* system variables */ - NULL, /* reserved */ - 0 /* config flags */ -} -mysql_declare_plugin_end; maria_declare_plugin(columnstore) { MYSQL_STORAGE_ENGINE_PLUGIN, @@ -952,10 +936,10 @@ maria_declare_plugin(columnstore) PLUGIN_LICENSE_GPL, columnstore_init_func, columnstore_done_func, - 0x0100, /* 1.0 */ + MCSVERSIONHEX, mcs_status_variables, /* status variables */ mcs_system_variables, /* system variables */ - "1.0", /* string version */ + MCSVERSION, /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ }, { @@ -968,10 +952,10 @@ maria_declare_plugin(columnstore) is_columnstore_columns_plugin_init, //is_columnstore_tables_plugin_deinit, NULL, - 0x0100, + MCSVERSIONHEX, NULL, NULL, - "1.0", + MCSVERSION, MariaDB_PLUGIN_MATURITY_STABLE }, { @@ -984,10 +968,10 @@ maria_declare_plugin(columnstore) is_columnstore_tables_plugin_init, //is_columnstore_tables_plugin_deinit, NULL, - 0x0100, + MCSVERSIONHEX, NULL, NULL, - "1.0", + MCSVERSION, MariaDB_PLUGIN_MATURITY_STABLE }, { @@ -1000,10 +984,10 @@ maria_declare_plugin(columnstore) is_columnstore_files_plugin_init, //is_columnstore_files_plugin_deinit, NULL, - 0x0100, + MCSVERSIONHEX, NULL, NULL, - "1.0", + MCSVERSION, MariaDB_PLUGIN_MATURITY_STABLE }, { @@ -1016,10 +1000,10 @@ maria_declare_plugin(columnstore) is_columnstore_extents_plugin_init, //is_columnstore_extents_plugin_deinit, NULL, - 0x0100, + MCSVERSIONHEX, NULL, NULL, - "1.0", + MCSVERSION, MariaDB_PLUGIN_MATURITY_STABLE } maria_declare_plugin_end; diff --git a/dbcon/mysql/ha_mcs_version.h.in b/dbcon/mysql/ha_mcs_version.h.in new file mode 100644 index 000000000..23e7f5325 --- /dev/null +++ b/dbcon/mysql/ha_mcs_version.h.in @@ -0,0 +1,21 @@ +/* Copyright (C) 2019 MariaDB Corporation + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; version 2 of + the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#pragma once + +#define MCSVERSION "${PACKAGE_VERSION}" +#define MCSVERSIONHEX ${MCSVERSIONHEX}