You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
Add status variables to show ColumnStore version and commit hash.
This commit is contained in:
@@ -322,17 +322,17 @@ IF( WITH_SHARED_COMP_TESTS )
|
|||||||
ADD_SUBDIRECTORY(writeengine/shared)
|
ADD_SUBDIRECTORY(writeengine/shared)
|
||||||
ENDIF( WITH_SHARED_COMP_TESTS )
|
ENDIF( WITH_SHARED_COMP_TESTS )
|
||||||
|
|
||||||
|
exec_program("git"
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
ARGS "describe --match=NeVeRmAtCh --always --dirty"
|
||||||
|
OUTPUT_VARIABLE GIT_VERSION)
|
||||||
|
|
||||||
# releasenum is used by external scripts for various tasks. Leave it alone.
|
# releasenum is used by external scripts for various tasks. Leave it alone.
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/releasenum.in ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum IMMEDIATE)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/releasenum.in ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum IMMEDIATE)
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum DESTINATION ${INSTALL_ENGINE} COMPONENT platform)
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum DESTINATION ${INSTALL_ENGINE} COMPONENT platform)
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h.in ${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h.in ${CMAKE_CURRENT_SOURCE_DIR}/columnstoreversion.h)
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
exec_program("git"
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
ARGS "describe --match=NeVeRmAtCh --always --dirty"
|
|
||||||
OUTPUT_VARIABLE GIT_VERSION)
|
|
||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/gitversionEngine.in ${CMAKE_CURRENT_BINARY_DIR}/gitversionEngine IMMEDIATE)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/gitversionEngine.in ${CMAKE_CURRENT_BINARY_DIR}/gitversionEngine IMMEDIATE)
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/gitversionEngine DESTINATION ${INSTALL_ENGINE} COMPONENT platform)
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/gitversionEngine DESTINATION ${INSTALL_ENGINE} COMPONENT platform)
|
||||||
|
|
||||||
|
@@ -3,5 +3,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
const std::string columnstore_version("${VERSION}");
|
const std::string columnstore_version("${VERSION}");
|
||||||
const std::string columnstore_release("${PACKAGE_RELEASE}");
|
const std::string columnstore_release("${PACKAGE_RELEASE}");
|
||||||
|
const std::string columnstore_commit_hash("${GIT_VERSION}");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -33,6 +33,8 @@ static int calpont_commit(handlerton* hton, THD* thd, bool all);
|
|||||||
static int calpont_rollback(handlerton* hton, THD* thd, bool all);
|
static int calpont_rollback(handlerton* hton, THD* thd, bool all);
|
||||||
static int calpont_close_connection ( handlerton* hton, THD* thd );
|
static int calpont_close_connection ( handlerton* hton, THD* thd );
|
||||||
handlerton* mcs_hton;
|
handlerton* mcs_hton;
|
||||||
|
char cs_version[25];
|
||||||
|
char cs_commit_hash[41]; // a commit hash is 40 characters
|
||||||
|
|
||||||
// handlers creation function for hton.
|
// handlers creation function for hton.
|
||||||
// Look into ha_mcs_pushdown.* for more details.
|
// Look into ha_mcs_pushdown.* for more details.
|
||||||
@@ -128,6 +130,12 @@ static int columnstore_init_func(void* p)
|
|||||||
|
|
||||||
fprintf(stderr, "Columnstore: Started; Version: %s-%s\n", columnstore_version.c_str(), columnstore_release.c_str());
|
fprintf(stderr, "Columnstore: Started; Version: %s-%s\n", columnstore_version.c_str(), columnstore_release.c_str());
|
||||||
|
|
||||||
|
strncpy(cs_version, columnstore_version.c_str(), sizeof(cs_version));
|
||||||
|
cs_version[sizeof(cs_version) - 1] = 0;
|
||||||
|
|
||||||
|
strncpy(cs_commit_hash, columnstore_commit_hash.c_str(), sizeof(cs_commit_hash));
|
||||||
|
cs_commit_hash[sizeof(cs_commit_hash) - 1] = 0;
|
||||||
|
|
||||||
mcs_hton = (handlerton*)p;
|
mcs_hton = (handlerton*)p;
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
(void) pthread_mutex_init(&calpont_mutex, MY_MUTEX_INIT_FAST);
|
(void) pthread_mutex_init(&calpont_mutex, MY_MUTEX_INIT_FAST);
|
||||||
@@ -914,7 +922,7 @@ mysql_declare_plugin(columnstore)
|
|||||||
columnstore_init_func, /* Plugin Init */
|
columnstore_init_func, /* Plugin Init */
|
||||||
columnstore_done_func, /* Plugin Deinit */
|
columnstore_done_func, /* Plugin Deinit */
|
||||||
0x0100 /* 1.0 */,
|
0x0100 /* 1.0 */,
|
||||||
NULL, /* status variables */
|
mcs_status_variables, /* status variables */
|
||||||
mcs_system_variables, /* system variables */
|
mcs_system_variables, /* system variables */
|
||||||
NULL, /* reserved */
|
NULL, /* reserved */
|
||||||
0 /* config flags */
|
0 /* config flags */
|
||||||
@@ -931,7 +939,7 @@ maria_declare_plugin(columnstore)
|
|||||||
columnstore_init_func,
|
columnstore_init_func,
|
||||||
columnstore_done_func,
|
columnstore_done_func,
|
||||||
0x0100, /* 1.0 */
|
0x0100, /* 1.0 */
|
||||||
NULL, /* status variables */
|
mcs_status_variables, /* status variables */
|
||||||
mcs_system_variables, /* system variables */
|
mcs_system_variables, /* system variables */
|
||||||
"1.0", /* string version */
|
"1.0", /* string version */
|
||||||
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
|
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
|
||||||
|
@@ -303,6 +303,13 @@ st_mysql_sys_var* mcs_system_variables[] =
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
st_mysql_show_var mcs_status_variables[] =
|
||||||
|
{
|
||||||
|
{"columnstore_version", (char*)&cs_version, SHOW_CHAR},
|
||||||
|
{"columnstore_commit_hash", (char*)&cs_commit_hash, SHOW_CHAR},
|
||||||
|
{0, 0, (enum_mysql_show_type)0}
|
||||||
|
};
|
||||||
|
|
||||||
void* get_fe_conn_info_ptr(THD* thd)
|
void* get_fe_conn_info_ptr(THD* thd)
|
||||||
{
|
{
|
||||||
return ( current_thd == NULL && thd == NULL ) ? NULL :
|
return ( current_thd == NULL && thd == NULL ) ? NULL :
|
||||||
|
@@ -23,6 +23,9 @@
|
|||||||
#include "idb_mysql.h"
|
#include "idb_mysql.h"
|
||||||
|
|
||||||
extern st_mysql_sys_var* mcs_system_variables[];
|
extern st_mysql_sys_var* mcs_system_variables[];
|
||||||
|
extern st_mysql_show_var mcs_status_variables[];
|
||||||
|
extern char cs_version[];
|
||||||
|
extern char cs_commit_hash[];
|
||||||
|
|
||||||
// compression_type
|
// compression_type
|
||||||
enum mcs_compression_type_t {
|
enum mcs_compression_type_t {
|
||||||
|
Reference in New Issue
Block a user