You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-05 16:15:50 +03:00
Merge branch 'develop' into mcol-61
Conflicts: oam/install_scripts/post-install oam/oamcpp/liboamcpp.cpp
This commit is contained in:
@@ -36,6 +36,31 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
|
|||||||
|
|
||||||
#set( CMAKE_VERBOSE_MAKEFILE on )
|
#set( CMAKE_VERBOSE_MAKEFILE on )
|
||||||
|
|
||||||
|
IF (NOT VERSION)
|
||||||
|
SET (VERSION 1.0.5)
|
||||||
|
ENDIF()
|
||||||
|
IF (NOT RELEASE)
|
||||||
|
SET (RELEASE 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET (PACKAGE columnstore)
|
||||||
|
SET (PACKAGE_NAME columnstore)
|
||||||
|
SET (PACKAGE_TARNAME columnstore)
|
||||||
|
SET (PACKAGE_BUGREPORT support@mariadb.com)
|
||||||
|
SET (PACKAGE_URL "")
|
||||||
|
|
||||||
|
IF (NOT PACKAGE_VERSION)
|
||||||
|
SET (PACKAGE_VERSION ${VERSION})
|
||||||
|
ENDIF()
|
||||||
|
IF (NOT PACKAGE_RELEASE)
|
||||||
|
SET (PACKAGE_RELEASE ${RELEASE})
|
||||||
|
ENDIF()
|
||||||
|
SET (PACKAGE_STRING columnstore-${PACKAGE_VERSION})
|
||||||
|
|
||||||
|
|
||||||
|
SET (ENGINE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
SET (INSTALL_ENGINE "/usr/local/mariadb/columnstore")
|
||||||
|
|
||||||
# use, i.e. don't skip the full RPATH for the build tree
|
# use, i.e. don't skip the full RPATH for the build tree
|
||||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||||
|
|
||||||
@@ -43,31 +68,18 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|||||||
# (but later on when installing)
|
# (but later on when installing)
|
||||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||||
|
|
||||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
SET(CMAKE_INSTALL_RPATH "${INSTALL_ENGINE}/lib")
|
||||||
|
|
||||||
# add the automatically determined parts of the RPATH
|
# add the automatically determined parts of the RPATH
|
||||||
# which point to directories outside the build tree to the install RPATH
|
# which point to directories outside the build tree to the install RPATH
|
||||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
|
|
||||||
# the RPATH to be used when installing, but only if it's not a system directory
|
# the RPATH to be used when installing, but only if it's not a system directory
|
||||||
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${INSTALL_ENGINE}/lib" isSystemDir)
|
||||||
IF("${isSystemDir}" STREQUAL "-1")
|
IF("${isSystemDir}" STREQUAL "-1")
|
||||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
SET(CMAKE_INSTALL_RPATH "${INSTALL_ENGINE}/lib")
|
||||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||||
|
|
||||||
SET (PACKAGE columnstore)
|
|
||||||
SET (VERSION 1.0.2)
|
|
||||||
SET (PACKAGE_NAME columnstore)
|
|
||||||
SET (PACKAGE_TARNAME columnstore)
|
|
||||||
SET (PACKAGE_VERSION 1.0.2)
|
|
||||||
SET (PACKAGE_STRING columnstore-1.0.2)
|
|
||||||
SET (PACKAGE_BUGREPORT support@mariadb.com)
|
|
||||||
SET (PACKAGE_URL "")
|
|
||||||
|
|
||||||
SET (ENGINE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
SET (INSTALL_ENGINE "/usr/local/mariadb/columnstore")
|
|
||||||
|
|
||||||
INCLUDE (configureEngine.cmake)
|
INCLUDE (configureEngine.cmake)
|
||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/releasenum.in ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum @ONLY IMMEDIATE)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/releasenum.in ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum @ONLY IMMEDIATE)
|
||||||
@@ -110,7 +122,7 @@ ENDFOREACH()
|
|||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3 -fno-tree-vectorize -DSAFE_MUTEX -DSAFEMALLOC -DENABLED_DEBUG_SYNC -O0 -Wall -D_DEBUG -DHAVE_CONFIG_H")
|
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb3 -fno-tree-vectorize -DSAFE_MUTEX -DSAFEMALLOC -DENABLED_DEBUG_SYNC -O0 -Wall -D_DEBUG -DHAVE_CONFIG_H")
|
||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb3 -fno-tree-vectorize -DSAFE_MUTEX -DSAFEMALLOC -DENABLED_DEBUG_SYNC -O0 -Wall -D _DEBUG -DHAVE_CONFIG_H")
|
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb3 -fno-tree-vectorize -DSAFE_MUTEX -DSAFEMALLOC -DENABLED_DEBUG_SYNC -O0 -Wall -D _DEBUG -DHAVE_CONFIG_H")
|
||||||
|
|
||||||
SET (ENGINE_LDFLAGS "-Wl,--rpath -Wl,${INSTALL_ENGINE}/lib -Wl,--no-as-needed -Wl,--add-needed")
|
SET (ENGINE_LDFLAGS "-Wl,--no-as-needed -Wl,--add-needed")
|
||||||
|
|
||||||
FIND_PACKAGE(Boost 1.53.0 REQUIRED COMPONENTS system filesystem thread regex date_time)
|
FIND_PACKAGE(Boost 1.53.0 REQUIRED COMPONENTS system filesystem thread regex date_time)
|
||||||
|
|
||||||
|
2
README
2
README
@@ -1,6 +1,6 @@
|
|||||||
This is MariaDB ColumnStore 1.0.4
|
This is MariaDB ColumnStore 1.0.4
|
||||||
MariaDB ColumnStore 1.0.4 is the development version of MariaDB ColumnStore.
|
MariaDB ColumnStore 1.0.4 is the development version of MariaDB ColumnStore.
|
||||||
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.18 and adding entirely
|
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.19 and adding entirely
|
||||||
new features not found anywhere else.
|
new features not found anywhere else.
|
||||||
|
|
||||||
MariaDB ColumnStore 1.0.4 is an Beta release. This is the first MariaDB
|
MariaDB ColumnStore 1.0.4 is an Beta release. This is the first MariaDB
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#MariaDB ColumnStore Storage/Execution engine 1.0.4
|
#MariaDB ColumnStore Storage/Execution engine 1.0.4
|
||||||
MariaDB ColumnStore 1.0.4 is the development version of MariaDB ColumnStore.
|
MariaDB ColumnStore 1.0.4 is the development version of MariaDB ColumnStore.
|
||||||
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.18 and adding entirely
|
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.19 and adding entirely
|
||||||
new features not found anywhere else.
|
new features not found anywhere else.
|
||||||
|
|
||||||
#MariaDB ColumnStore 1.0.4 is an Beta release.
|
#MariaDB ColumnStore 1.0.4 is an Beta release.
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
version=1.0.4
|
|
||||||
release=1
|
|
@@ -1,2 +1,2 @@
|
|||||||
version=@CPACK_RPM_PACKAGE_VERSION@
|
version=@VERSION@
|
||||||
release=@CPACK_RPM_PACKAGE_RELEASE@
|
release=@RELEASE@
|
@@ -15,10 +15,10 @@ SET(CPACK_PACKAGE_NAME "mariadb-columnstore")
|
|||||||
SET(ENGINE_ARCH "x86_64")
|
SET(ENGINE_ARCH "x86_64")
|
||||||
|
|
||||||
IF (NOT CPACK_RPM_PACKAGE_VERSION)
|
IF (NOT CPACK_RPM_PACKAGE_VERSION)
|
||||||
SET (CPACK_RPM_PACKAGE_VERSION "1.0.0")
|
SET (CPACK_RPM_PACKAGE_VERSION ${PACKAGE_VERSION})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF (NOT CPACK_RPM_PACKAGE_RELEASE)
|
IF (NOT CPACK_RPM_PACKAGE_RELEASE)
|
||||||
SET (CPACK_RPM_PACKAGE_RELEASE "0")
|
SET (CPACK_RPM_PACKAGE_RELEASE ${PACKAGE_RELEASE})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
|
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
|
||||||
@@ -318,6 +318,15 @@ SET(CPACK_RPM_storage-engine_USER_FILELIST
|
|||||||
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so.1.0.0"
|
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so.1.0.0"
|
||||||
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so.1"
|
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so.1"
|
||||||
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so"
|
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_columns.so"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_columns.so.1"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_columns.so.1.0.0"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_extents.so"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_extents.so.1"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_extents.so.1.0.0"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_tables.so"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_tables.so.1"
|
||||||
|
"/usr/local/mariadb/columnstore/lib/is_columnstore_tables.so.1.0.0"
|
||||||
"/usr/local/mariadb/columnstore/mysql/mysql-Columnstore"
|
"/usr/local/mariadb/columnstore/mysql/mysql-Columnstore"
|
||||||
"/usr/local/mariadb/columnstore/mysql/install_calpont_mysql.sh"
|
"/usr/local/mariadb/columnstore/mysql/install_calpont_mysql.sh"
|
||||||
"/usr/local/mariadb/columnstore/mysql/syscatalog_mysql.sql"
|
"/usr/local/mariadb/columnstore/mysql/syscatalog_mysql.sql"
|
||||||
|
@@ -2599,6 +2599,7 @@ const vector< pair<CalpontSystemCatalog::OID, CalpontSystemCatalog::TableName> >
|
|||||||
SimpleColumn *c1 = new SimpleColumn(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+TABLENAME_COL, fSessionID);
|
SimpleColumn *c1 = new SimpleColumn(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+TABLENAME_COL, fSessionID);
|
||||||
SimpleColumn *c2 = new SimpleColumn(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+SCHEMA_COL, fSessionID);
|
SimpleColumn *c2 = new SimpleColumn(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+SCHEMA_COL, fSessionID);
|
||||||
SimpleColumn *c3 = new SimpleColumn(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+OBJECTID_COL, fSessionID);
|
SimpleColumn *c3 = new SimpleColumn(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+OBJECTID_COL, fSessionID);
|
||||||
|
SimpleColumn *c4 = new SimpleColumn(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+CREATEDATE_COL, fSessionID);
|
||||||
|
|
||||||
SRCP srcp;
|
SRCP srcp;
|
||||||
srcp.reset(c1);
|
srcp.reset(c1);
|
||||||
@@ -2607,6 +2608,8 @@ const vector< pair<CalpontSystemCatalog::OID, CalpontSystemCatalog::TableName> >
|
|||||||
colMap.insert(CMVT_(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+SCHEMA_COL, srcp));
|
colMap.insert(CMVT_(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+SCHEMA_COL, srcp));
|
||||||
srcp.reset(c3);
|
srcp.reset(c3);
|
||||||
colMap.insert(CMVT_(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+OBJECTID_COL, srcp));
|
colMap.insert(CMVT_(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+OBJECTID_COL, srcp));
|
||||||
|
srcp.reset(c4);
|
||||||
|
colMap.insert(CMVT_(CALPONT_SCHEMA+"."+SYSTABLE_TABLE+"."+CREATEDATE_COL, srcp));
|
||||||
csep.columnMapNonStatic(colMap);
|
csep.columnMapNonStatic(colMap);
|
||||||
|
|
||||||
srcp.reset(c1->clone());
|
srcp.reset(c1->clone());
|
||||||
@@ -2653,6 +2656,14 @@ const vector< pair<CalpontSystemCatalog::OID, CalpontSystemCatalog::TableName> >
|
|||||||
tables[i].second.schema = (*it)->GetStringData(i);
|
tables[i].second.schema = (*it)->GetStringData(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (it = sysDataList.begin(); it != sysDataList.end(); it++)
|
||||||
|
{
|
||||||
|
if ((*it)->ColumnOID() == c4->oid())
|
||||||
|
{
|
||||||
|
for (int i = 0; i < (*it)->dataCount(); i++)
|
||||||
|
tables[i].second.create_date = (*it)->GetData(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (it = sysDataList.begin(); it != sysDataList.end(); it++)
|
for (it = sysDataList.begin(); it != sysDataList.end(); it++)
|
||||||
{
|
{
|
||||||
|
@@ -431,6 +431,7 @@ public:
|
|||||||
TableName(const TableAliasName& tan): schema(tan.schema), table(tan.table) {}
|
TableName(const TableAliasName& tan): schema(tan.schema), table(tan.table) {}
|
||||||
std::string schema;
|
std::string schema;
|
||||||
std::string table;
|
std::string table;
|
||||||
|
int64_t create_date;
|
||||||
bool operator<(const TableName& rhs) const;
|
bool operator<(const TableName& rhs) const;
|
||||||
bool operator>=(const TableName& rhs) const { return !(*this < rhs); }
|
bool operator>=(const TableName& rhs) const { return !(*this < rhs); }
|
||||||
bool operator==(const TableName& rhs) const
|
bool operator==(const TableName& rhs) const
|
||||||
|
@@ -29,7 +29,40 @@ target_link_libraries(calmysql ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_
|
|||||||
|
|
||||||
set_target_properties(calmysql PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
set_target_properties(calmysql PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||||
|
|
||||||
install(TARGETS calmysql DESTINATION ${ENGINE_LIBDIR} COMPONENT storage-engine)
|
SET ( is_columnstore_tables_SRCS
|
||||||
|
is_columnstore_tables.cpp
|
||||||
|
)
|
||||||
|
add_library(is_columnstore_tables SHARED ${is_columnstore_tables_SRCS})
|
||||||
|
|
||||||
|
target_link_libraries(is_columnstore_tables ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool)
|
||||||
|
|
||||||
|
# Don't prepend .so file with 'lib'
|
||||||
|
set_target_properties(is_columnstore_tables PROPERTIES PREFIX "")
|
||||||
|
set_target_properties(is_columnstore_tables PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||||
|
|
||||||
|
SET ( is_columnstore_columns_SRCS
|
||||||
|
is_columnstore_columns.cpp
|
||||||
|
)
|
||||||
|
add_library(is_columnstore_columns SHARED ${is_columnstore_columns_SRCS})
|
||||||
|
|
||||||
|
target_link_libraries(is_columnstore_columns ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool)
|
||||||
|
|
||||||
|
# Don't prepend .so file with 'lib'
|
||||||
|
set_target_properties(is_columnstore_columns PROPERTIES PREFIX "")
|
||||||
|
set_target_properties(is_columnstore_columns PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||||
|
|
||||||
|
SET ( is_columnstore_extents_SRCS
|
||||||
|
is_columnstore_extents.cpp
|
||||||
|
)
|
||||||
|
add_library(is_columnstore_extents SHARED ${is_columnstore_extents_SRCS})
|
||||||
|
|
||||||
|
target_link_libraries(is_columnstore_extents ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool)
|
||||||
|
|
||||||
|
# Don't prepend .so file with 'lib'
|
||||||
|
set_target_properties(is_columnstore_extents PROPERTIES PREFIX "")
|
||||||
|
set_target_properties(is_columnstore_extents PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||||
|
|
||||||
|
install(TARGETS calmysql is_columnstore_tables is_columnstore_columns is_columnstore_extents DESTINATION ${ENGINE_LIBDIR} COMPONENT storage-engine)
|
||||||
install(FILES syscatalog_mysql.sql
|
install(FILES syscatalog_mysql.sql
|
||||||
dumpcat_mysql.sql
|
dumpcat_mysql.sql
|
||||||
calsetuserpriority.sql
|
calsetuserpriority.sql
|
||||||
|
@@ -30,6 +30,9 @@ df=$installdir/mysql/my.cnf
|
|||||||
$installdir/mysql/bin/mysql --defaults-file=$df --force --user=root $pwprompt mysql 2>/tmp/mysql_install.log <<EOD
|
$installdir/mysql/bin/mysql --defaults-file=$df --force --user=root $pwprompt mysql 2>/tmp/mysql_install.log <<EOD
|
||||||
INSTALL PLUGIN columnstore SONAME 'libcalmysql.so';
|
INSTALL PLUGIN columnstore SONAME 'libcalmysql.so';
|
||||||
INSTALL PLUGIN infinidb SONAME 'libcalmysql.so';
|
INSTALL PLUGIN infinidb SONAME 'libcalmysql.so';
|
||||||
|
INSTALL PLUGIN columnstore_tables SONAME 'is_columnstore_tables.so';
|
||||||
|
INSTALL PLUGIN columnstore_columns SONAME 'is_columnstore_columns.so';
|
||||||
|
INSTALL PLUGIN columnstore_extents SONAME 'is_columnstore_extents.so';
|
||||||
-- these are deprecated names
|
-- these are deprecated names
|
||||||
DELETE FROM mysql.func WHERE name='caldisablepartition';
|
DELETE FROM mysql.func WHERE name='caldisablepartition';
|
||||||
DELETE FROM mysql.func WHERE name='caldroppartition';
|
DELETE FROM mysql.func WHERE name='caldroppartition';
|
||||||
|
187
dbcon/mysql/is_columnstore_columns.cpp
Normal file
187
dbcon/mysql/is_columnstore_columns.cpp
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
/* c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil
|
||||||
|
* vi: set shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
* :indentSize=4:tabSize=4:noTabs=true:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 MariaDB Corporaton
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "idb_mysql.h"
|
||||||
|
#include <vector>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include "calpontsystemcatalog.h"
|
||||||
|
#include "dataconvert.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Required declaration as it isn't in a MairaDB include
|
||||||
|
bool schema_table_store_record(THD *thd, TABLE *table);
|
||||||
|
|
||||||
|
ST_FIELD_INFO is_columnstore_columns_fields[] =
|
||||||
|
{
|
||||||
|
{"TABLE_SCHEMA", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
||||||
|
{"TABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
||||||
|
{"COLUMN_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
||||||
|
{"OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
||||||
|
{"DICTIONARY_OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
||||||
|
{"LIST_OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
||||||
|
{"TREE_OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
||||||
|
{"DATA_TYPE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
||||||
|
{"COLUMN_LENGTH", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
||||||
|
{"COLUMN_POSITION", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
||||||
|
{"COLUMN_DEFAULT", 0, MYSQL_TYPE_LONG_BLOB, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
||||||
|
{"IS_NULLABLE", 1, MYSQL_TYPE_TINY, 0, 0, 0, 0},
|
||||||
|
{"NUMERIC_PRECISION", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
||||||
|
{"NUMERIC_SCALE", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
||||||
|
{"IS_AUTOINCREMENT", 1, MYSQL_TYPE_TINY, 0, 0, 0, 0},
|
||||||
|
{"COMPRESSION_TYPE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
||||||
|
{0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
static int is_columnstore_columns_fill(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||||
|
{
|
||||||
|
CHARSET_INFO *cs = system_charset_info;
|
||||||
|
TABLE *table = tables->table;
|
||||||
|
|
||||||
|
boost::shared_ptr<execplan::CalpontSystemCatalog> systemCatalogPtr =
|
||||||
|
execplan::CalpontSystemCatalog::makeCalpontSystemCatalog(0);
|
||||||
|
|
||||||
|
const std::vector< std::pair<execplan::CalpontSystemCatalog::OID, execplan::CalpontSystemCatalog::TableName> > catalog_tables
|
||||||
|
= systemCatalogPtr->getTables();
|
||||||
|
|
||||||
|
for (std::vector<std::pair<execplan::CalpontSystemCatalog::OID, execplan::CalpontSystemCatalog::TableName> >::const_iterator it = catalog_tables.begin();
|
||||||
|
it != catalog_tables.end(); ++it)
|
||||||
|
{
|
||||||
|
execplan::CalpontSystemCatalog::RIDList column_rid_list = systemCatalogPtr->columnRIDs((*it).second);
|
||||||
|
for (size_t col_num = 0; col_num < column_rid_list.size(); col_num++)
|
||||||
|
{
|
||||||
|
execplan::CalpontSystemCatalog::TableColName tcn = systemCatalogPtr->colName(column_rid_list[col_num].objnum);
|
||||||
|
execplan::CalpontSystemCatalog::ColType ct = systemCatalogPtr->colType(column_rid_list[col_num].objnum);
|
||||||
|
|
||||||
|
table->field[0]->store(tcn.schema.c_str(), tcn.schema.length(), cs);
|
||||||
|
table->field[1]->store(tcn.table.c_str(), tcn.table.length(), cs);
|
||||||
|
table->field[2]->store(tcn.column.c_str(), tcn.column.length(), cs);
|
||||||
|
table->field[3]->store(column_rid_list[col_num].objnum);
|
||||||
|
if (ct.ddn.dictOID == std::numeric_limits<int32_t>::min())
|
||||||
|
{
|
||||||
|
table->field[4]->set_null();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[4]->set_notnull();
|
||||||
|
table->field[4]->store(ct.ddn.dictOID);
|
||||||
|
}
|
||||||
|
if (ct.ddn.listOID == std::numeric_limits<int32_t>::min())
|
||||||
|
{
|
||||||
|
table->field[5]->set_null();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[5]->set_notnull();
|
||||||
|
table->field[5]->store(ct.ddn.listOID);
|
||||||
|
}
|
||||||
|
if (ct.ddn.treeOID == std::numeric_limits<int32_t>::min())
|
||||||
|
{
|
||||||
|
table->field[6]->set_null();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[6]->set_notnull();
|
||||||
|
table->field[6]->store(ct.ddn.treeOID);
|
||||||
|
}
|
||||||
|
std::string data_type = execplan::colDataTypeToString(ct.colDataType);
|
||||||
|
table->field[7]->store(data_type.c_str(), data_type.length(), cs);
|
||||||
|
table->field[8]->store(ct.colWidth);
|
||||||
|
table->field[9]->store(ct.colPosition);
|
||||||
|
if (ct.defaultValue.empty())
|
||||||
|
{
|
||||||
|
table->field[10]->set_null();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[10]->set_notnull();
|
||||||
|
table->field[10]->store(ct.defaultValue.c_str(), ct.defaultValue.length(), cs);
|
||||||
|
}
|
||||||
|
table->field[11]->store(ct.autoincrement);
|
||||||
|
table->field[12]->store(ct.precision);
|
||||||
|
table->field[13]->store(ct.scale);
|
||||||
|
if (ct.constraintType != execplan::CalpontSystemCatalog::NOTNULL_CONSTRAINT)
|
||||||
|
{
|
||||||
|
table->field[14]->store(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[14]->store(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string compression_type;
|
||||||
|
switch (ct.compressionType)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
compression_type = "None";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
compression_type = "Snappy";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
compression_type = "Unknown";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
table->field[15]->store(compression_type.c_str(), compression_type.length(), cs);
|
||||||
|
if (schema_table_store_record(thd, table))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int is_columnstore_columns_plugin_init(void *p)
|
||||||
|
{
|
||||||
|
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE*) p;
|
||||||
|
schema->fields_info = is_columnstore_columns_fields;
|
||||||
|
schema->fill_table = is_columnstore_columns_fill;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct st_mysql_information_schema is_columnstore_columns_plugin_version =
|
||||||
|
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
|
||||||
|
|
||||||
|
maria_declare_plugin(is_columnstore_columns_plugin)
|
||||||
|
{
|
||||||
|
MYSQL_INFORMATION_SCHEMA_PLUGIN,
|
||||||
|
&is_columnstore_columns_plugin_version,
|
||||||
|
"COLUMNSTORE_COLUMNS",
|
||||||
|
"MariaDB Corporaton",
|
||||||
|
"An information schema plugin to list ColumnStore columns",
|
||||||
|
PLUGIN_LICENSE_GPL,
|
||||||
|
is_columnstore_columns_plugin_init,
|
||||||
|
//is_columnstore_tables_plugin_deinit,
|
||||||
|
NULL,
|
||||||
|
0x0100,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
"1.0",
|
||||||
|
MariaDB_PLUGIN_MATURITY_STABLE
|
||||||
|
}
|
||||||
|
maria_declare_plugin_end;
|
||||||
|
|
||||||
|
|
222
dbcon/mysql/is_columnstore_extents.cpp
Normal file
222
dbcon/mysql/is_columnstore_extents.cpp
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
/* c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil
|
||||||
|
* vi: set shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
* :indentSize=4:tabSize=4:noTabs=true:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 MariaDB Corporaton
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "idb_mysql.h"
|
||||||
|
#include <vector>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include "dbrm.h"
|
||||||
|
#include "objectidmanager.h"
|
||||||
|
#include "we_convertor.h"
|
||||||
|
#include "we_define.h"
|
||||||
|
#include "IDBPolicy.h"
|
||||||
|
#include "we_config.h"
|
||||||
|
|
||||||
|
// Required declaration as it isn't in a MairaDB include
|
||||||
|
bool schema_table_store_record(THD *thd, TABLE *table);
|
||||||
|
|
||||||
|
ST_FIELD_INFO is_columnstore_extents_fields[] =
|
||||||
|
{
|
||||||
|
{"OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 0
|
||||||
|
{"OBJECT_TYPE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0}, // 1
|
||||||
|
{"LOGICAL_BLOCK_START", 19, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, // 2
|
||||||
|
{"LOGICAL_BLOCK_END", 19, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, // 3
|
||||||
|
{"MIN_VALUE", 19, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, 0, 0}, // 4
|
||||||
|
{"MAX_VALUE", 19, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, 0, 0}, // 5
|
||||||
|
{"WIDTH", 1, MYSQL_TYPE_TINY, 0, 0, 0, 0}, // 6
|
||||||
|
{"DBROOT", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 7
|
||||||
|
{"PARTITION_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 8
|
||||||
|
{"SEGMENT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 9
|
||||||
|
{"BLOCK_OFFSET", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 10
|
||||||
|
{"MAX_BLOCKS", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 11
|
||||||
|
{"HIGH_WATER_MARK", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0}, // 12
|
||||||
|
{"STATE", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0}, // 13
|
||||||
|
{"STATUS", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0}, // 14
|
||||||
|
{"DATA_SIZE", 19, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, // 15
|
||||||
|
{"FILENAME", 1024, MYSQL_TYPE_STRING, 0, 0, 0, 0}, // 16
|
||||||
|
{"FILE_SIZE", 19, MYSQL_TYPE_LONGLONG, 0, MY_I_S_MAYBE_NULL, 0, 0}, // 17
|
||||||
|
{0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
static int is_columnstore_extents_fill(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||||
|
{
|
||||||
|
CHARSET_INFO *cs = system_charset_info;
|
||||||
|
TABLE *table = tables->table;
|
||||||
|
std::vector<struct BRM::EMEntry> entries;
|
||||||
|
std::vector<struct BRM::EMEntry>::iterator iter;
|
||||||
|
std::vector<struct BRM::EMEntry>::iterator end;
|
||||||
|
char oidDirName[WriteEngine::FILE_NAME_SIZE];
|
||||||
|
char fullFileName[WriteEngine::FILE_NAME_SIZE];
|
||||||
|
char dbDir[WriteEngine::MAX_DB_DIR_LEVEL][WriteEngine::MAX_DB_DIR_NAME_SIZE];
|
||||||
|
|
||||||
|
BRM::DBRM *emp = new BRM::DBRM();
|
||||||
|
if (!emp || !emp->isDBRMReady())
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
execplan::ObjectIDManager oidm;
|
||||||
|
BRM::OID_t MaxOID = oidm.size();
|
||||||
|
|
||||||
|
for(BRM::OID_t oid = 0; oid <= MaxOID; oid++)
|
||||||
|
{
|
||||||
|
emp->getExtents(oid, entries, false, false, true);
|
||||||
|
if (entries.size() == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
iter = entries.begin();
|
||||||
|
end = entries.end();
|
||||||
|
while (iter != end)
|
||||||
|
{
|
||||||
|
table->field[0]->store(oid);
|
||||||
|
if (iter->colWid > 0)
|
||||||
|
{
|
||||||
|
table->field[1]->store("Column", strlen("Column"), cs);
|
||||||
|
if (iter->partition.cprange.lo_val == std::numeric_limits<int64_t>::max() ||
|
||||||
|
iter->partition.cprange.lo_val <= (std::numeric_limits<int64_t>::min() + 2))
|
||||||
|
{
|
||||||
|
table->field[4]->set_null();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[4]->set_notnull();
|
||||||
|
table->field[4]->store(iter->partition.cprange.lo_val);
|
||||||
|
}
|
||||||
|
if (iter->partition.cprange.hi_val == std::numeric_limits<int64_t>::max() ||
|
||||||
|
iter->partition.cprange.hi_val <= (std::numeric_limits<int64_t>::min() + 2))
|
||||||
|
{
|
||||||
|
table->field[5]->set_null();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[5]->set_notnull();
|
||||||
|
table->field[5]->store(iter->partition.cprange.hi_val);
|
||||||
|
}
|
||||||
|
table->field[6]->store(iter->colWid);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[1]->store("Dictionary", strlen("Dictionary"), cs);
|
||||||
|
table->field[4]->set_null();
|
||||||
|
table->field[5]->set_null();
|
||||||
|
table->field[6]->store(8192);
|
||||||
|
}
|
||||||
|
table->field[2]->store(iter->range.start);
|
||||||
|
table->field[3]->store(iter->range.start + (iter->range.size * 1024) - 1);
|
||||||
|
|
||||||
|
table->field[7]->store(iter->dbRoot);
|
||||||
|
table->field[8]->store(iter->partitionNum);
|
||||||
|
table->field[9]->store(iter->segmentNum);
|
||||||
|
table->field[10]->store(iter->blockOffset);
|
||||||
|
table->field[11]->store(iter->range.size * 1024);
|
||||||
|
table->field[12]->store(iter->HWM);
|
||||||
|
|
||||||
|
switch (iter->partition.cprange.isValid)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
table->field[13]->store("Invalid", strlen("Invalid"), cs);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
table->field[13]->store("Updating", strlen("Updating"), cs);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
table->field[13]->store("Valid", strlen("Valid"), cs);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
table->field[13]->store("Unknown", strlen("Unknown"), cs);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (iter->status)
|
||||||
|
{
|
||||||
|
case BRM::EXTENTAVAILABLE:
|
||||||
|
table->field[14]->store("Available", strlen("Available"), cs);
|
||||||
|
break;
|
||||||
|
case BRM::EXTENTUNAVAILABLE:
|
||||||
|
table->field[14]->store("Unavailable", strlen("Unavailable"), cs);
|
||||||
|
break;
|
||||||
|
case BRM::EXTENTOUTOFSERVICE:
|
||||||
|
table->field[14]->store("Out of service", strlen("Out of service"), cs);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
table->field[14]->store("Unknown", strlen("Unknown"), cs);
|
||||||
|
}
|
||||||
|
table->field[15]->store((iter->HWM + 1) * 8192);
|
||||||
|
|
||||||
|
WriteEngine::Convertor::oid2FileName(oid, oidDirName, dbDir, iter->partitionNum, iter->segmentNum);
|
||||||
|
snprintf(fullFileName, WriteEngine::FILE_NAME_SIZE, "%s/%s", WriteEngine::Config::getDBRootByNum(iter->dbRoot).c_str(), oidDirName);
|
||||||
|
table->field[16]->store(fullFileName, strlen(fullFileName), cs);
|
||||||
|
|
||||||
|
if (idbdatafile::IDBPolicy::exists(fullFileName))
|
||||||
|
{
|
||||||
|
table->field[17]->set_notnull();
|
||||||
|
table->field[17]->store(idbdatafile::IDBPolicy::size(fullFileName));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[17]->set_null();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (schema_table_store_record(thd, table))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
iter++;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int is_columnstore_extents_plugin_init(void *p)
|
||||||
|
{
|
||||||
|
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE*) p;
|
||||||
|
schema->fields_info = is_columnstore_extents_fields;
|
||||||
|
schema->fill_table = is_columnstore_extents_fill;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct st_mysql_information_schema is_columnstore_extents_plugin_version =
|
||||||
|
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
|
||||||
|
|
||||||
|
maria_declare_plugin(is_columnstore_extents_plugin)
|
||||||
|
{
|
||||||
|
MYSQL_INFORMATION_SCHEMA_PLUGIN,
|
||||||
|
&is_columnstore_extents_plugin_version,
|
||||||
|
"COLUMNSTORE_EXTENTS",
|
||||||
|
"MariaDB Corporaton",
|
||||||
|
"An information schema plugin to list ColumnStore extents",
|
||||||
|
PLUGIN_LICENSE_GPL,
|
||||||
|
is_columnstore_extents_plugin_init,
|
||||||
|
//is_columnstore_extents_plugin_deinit,
|
||||||
|
NULL,
|
||||||
|
0x0100,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
"1.0",
|
||||||
|
MariaDB_PLUGIN_MATURITY_STABLE
|
||||||
|
}
|
||||||
|
maria_declare_plugin_end;
|
||||||
|
|
||||||
|
|
113
dbcon/mysql/is_columnstore_tables.cpp
Normal file
113
dbcon/mysql/is_columnstore_tables.cpp
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
/* c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil
|
||||||
|
* vi: set shiftwidth=4 tabstop=4 expandtab:
|
||||||
|
* :indentSize=4:tabSize=4:noTabs=true:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 MariaDB Corporaton
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "idb_mysql.h"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include "calpontsystemcatalog.h"
|
||||||
|
#include "dataconvert.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Required declaration as it isn't in a MairaDB include
|
||||||
|
bool schema_table_store_record(THD *thd, TABLE *table);
|
||||||
|
|
||||||
|
ST_FIELD_INFO is_columnstore_tables_fields[] =
|
||||||
|
{
|
||||||
|
{"TABLE_SCHEMA", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
||||||
|
{"TABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, 0, 0},
|
||||||
|
{"OBJECT_ID", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
||||||
|
{"CREATION_DATE", 0, MYSQL_TYPE_DATE, 0, 0, 0, 0},
|
||||||
|
{"COLUMN_COUNT", 11, MYSQL_TYPE_LONG, 0, 0, 0, 0},
|
||||||
|
{"AUTOINCREMENT", 11, MYSQL_TYPE_LONG, 0, MY_I_S_MAYBE_NULL, 0, 0},
|
||||||
|
{0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
static int is_columnstore_tables_fill(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||||
|
{
|
||||||
|
CHARSET_INFO *cs = system_charset_info;
|
||||||
|
TABLE *table = tables->table;
|
||||||
|
|
||||||
|
boost::shared_ptr<execplan::CalpontSystemCatalog> systemCatalogPtr =
|
||||||
|
execplan::CalpontSystemCatalog::makeCalpontSystemCatalog(0);
|
||||||
|
|
||||||
|
const std::vector< std::pair<execplan::CalpontSystemCatalog::OID, execplan::CalpontSystemCatalog::TableName> > catalog_tables
|
||||||
|
= systemCatalogPtr->getTables();
|
||||||
|
|
||||||
|
for (std::vector<std::pair<execplan::CalpontSystemCatalog::OID, execplan::CalpontSystemCatalog::TableName> >::const_iterator it = catalog_tables.begin();
|
||||||
|
it != catalog_tables.end(); ++it)
|
||||||
|
{
|
||||||
|
execplan::CalpontSystemCatalog::TableInfo tb_info = systemCatalogPtr->tableInfo((*it).second);
|
||||||
|
std::string create_date = dataconvert::DataConvert::dateToString((*it).second.create_date);
|
||||||
|
table->field[0]->store((*it).second.schema.c_str(), (*it).second.schema.length(), cs);
|
||||||
|
table->field[1]->store((*it).second.table.c_str(), (*it).second.table.length(), cs);
|
||||||
|
table->field[2]->store((*it).first);
|
||||||
|
table->field[3]->store(create_date.c_str(), create_date.length(), cs);
|
||||||
|
table->field[4]->store(tb_info.numOfCols);
|
||||||
|
if (tb_info.tablewithautoincr)
|
||||||
|
{
|
||||||
|
table->field[5]->set_notnull();
|
||||||
|
table->field[5]->store(systemCatalogPtr->nextAutoIncrValue((*it).second));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
table->field[5]->set_null();
|
||||||
|
}
|
||||||
|
table->field[5]->store(tb_info.tablewithautoincr);
|
||||||
|
if (schema_table_store_record(thd, table))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int is_columnstore_tables_plugin_init(void *p)
|
||||||
|
{
|
||||||
|
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE*) p;
|
||||||
|
schema->fields_info = is_columnstore_tables_fields;
|
||||||
|
schema->fill_table = is_columnstore_tables_fill;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct st_mysql_information_schema is_columnstore_tables_plugin_version =
|
||||||
|
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
|
||||||
|
|
||||||
|
maria_declare_plugin(is_columnstore_tables_plugin)
|
||||||
|
{
|
||||||
|
MYSQL_INFORMATION_SCHEMA_PLUGIN,
|
||||||
|
&is_columnstore_tables_plugin_version,
|
||||||
|
"COLUMNSTORE_TABLES",
|
||||||
|
"MariaDB Corporaton",
|
||||||
|
"An information schema plugin to list ColumnStore tables",
|
||||||
|
PLUGIN_LICENSE_GPL,
|
||||||
|
is_columnstore_tables_plugin_init,
|
||||||
|
//is_columnstore_tables_plugin_deinit,
|
||||||
|
NULL,
|
||||||
|
0x0100,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
"1.0",
|
||||||
|
MariaDB_PLUGIN_MATURITY_STABLE
|
||||||
|
}
|
||||||
|
maria_declare_plugin_end;
|
||||||
|
|
||||||
|
|
@@ -57,8 +57,10 @@ if [ "x$has_um" = x ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
user=$USER
|
user=$USER
|
||||||
|
sudo=sudo
|
||||||
if [ -z "$user" ]; then
|
if [ -z "$user" ]; then
|
||||||
user=root
|
user=root
|
||||||
|
sudo=" "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
checkInstallSetup() {
|
checkInstallSetup() {
|
||||||
@@ -66,7 +68,7 @@ checkInstallSetup() {
|
|||||||
if [ $InitialInstallFlag != "y" ]; then
|
if [ $InitialInstallFlag != "y" ]; then
|
||||||
echo "Please run the postConfigure install script, check the Installation Guide"
|
echo "Please run the postConfigure install script, check the Installation Guide"
|
||||||
echo "for additional details"
|
echo "for additional details"
|
||||||
rm -f /var/lock/subsys/columnstore
|
sudo rm -f /var/lock/subsys/columnstore
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -79,13 +81,13 @@ start() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(mkdir -p /var/lock/subsys && touch /var/lock/subsys/columnstore) >/dev/null 2>&1
|
(sudo mkdir -p /var/lock/subsys && touch /var/lock/subsys/columnstore) >/dev/null 2>&1
|
||||||
|
|
||||||
if [ -x $InstallDir/bin/columnstore.pre-start ]; then
|
if [ -x $InstallDir/bin/columnstore.pre-start ]; then
|
||||||
$InstallDir/bin/columnstore.pre-start
|
$InstallDir/bin/columnstore.pre-start
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error running MariaDB Columnstore pre-start script, not starting MariaDB Columnstore"
|
echo "Error running MariaDB Columnstore pre-start script, not starting MariaDB Columnstore"
|
||||||
rm -f /var/lock/subsys/columnstore
|
sudo rm -f /var/lock/subsys/columnstore
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -106,21 +108,21 @@ start() {
|
|||||||
|
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
echo "Starting MariaDB Columnstore Database Platform"
|
echo "Starting MariaDB Columnstore Database Platform"
|
||||||
rm -f /tmp/StopColumnstore
|
sudo rm -f /tmp/StopColumnstore
|
||||||
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
|
exec $InstallDir/bin/run.sh $InstallDir/bin/ProcMon > /dev/null 2>&1 &
|
||||||
|
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
stop() {
|
stop() {
|
||||||
echo "Shutting down MariaDB Columnstore Database Platform"
|
echo "Shutting down MariaDB Columnstore Database Platform"
|
||||||
touch /tmp/StopColumnstore
|
sudo touch /tmp/StopColumnstore
|
||||||
pkill ProcMon
|
sudo pkill ProcMon
|
||||||
pkill ProcMgr
|
sudo pkill ProcMgr
|
||||||
sleep 1
|
sleep 1
|
||||||
$InstallDir/bin/clearShm
|
$InstallDir/bin/clearShm
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
rm -f /var/lock/subsys/columnstore
|
sudo rm -f /var/lock/subsys/columnstore
|
||||||
fuser -k 8604/tcp > /dev/null 2>&1
|
sudo fuser -k 8604/tcp > /dev/null 2>&1
|
||||||
test -f $InstallDir/mysql/mysql-Columnstore || return $RETVAL
|
test -f $InstallDir/mysql/mysql-Columnstore || return $RETVAL
|
||||||
$InstallDir/mysql/mysql-Columnstore stop > /dev/null 2>&1
|
$InstallDir/mysql/mysql-Columnstore stop > /dev/null 2>&1
|
||||||
if [ -x $InstallDir/bin/columnstore.post-stop ]; then
|
if [ -x $InstallDir/bin/columnstore.post-stop ]; then
|
||||||
|
@@ -98,10 +98,14 @@ sudo ln -s /usr/lib64/perl5/CORE/libperl.so /usr/lib64/libperl.so >/dev/null 2>&
|
|||||||
|
|
||||||
cd /
|
cd /
|
||||||
|
|
||||||
|
test -d /var/log/mariadb || sudo mkdir /var/log/mariadb >/dev/null 2>&1
|
||||||
test -d /var/log/mariadb/columnstore || sudo mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
|
test -d /var/log/mariadb/columnstore || sudo mkdir /var/log/mariadb/columnstore >/dev/null 2>&1
|
||||||
test -d /var/log/mariadb/columnstore/archive || sudo mkdir /var/log/mariadb/columnstore/archive >/dev/null 2>&1
|
sudo chmod -R 777 /var/log/mariadb
|
||||||
test -d /var/log/mariadb/columnstore/corefiles || sudo mkdir /var/log/mariadb/columnstore/corefiles >/dev/null 2>&1
|
|
||||||
test -h /var/log/mariadb/columnstore/data && sudo rm -f /var/log/mariadb/columnstore/data
|
test -d /var/log/mariadb/columnstore/archive || mkdir /var/log/mariadb/columnstore/archive >/dev/null 2>&1
|
||||||
|
test -d /var/log/mariadb/columnstore/corefiles || mkdir /var/log/mariadb/columnstore/corefiles >/dev/null 2>&1
|
||||||
|
test -d /var/log/mariadb/columnstore/trace || mkdir /var/log/mariadb/columnstore/trace >/dev/null 2>&1
|
||||||
|
test -h /var/log/mariadb/columnstore/data && rm -f /var/log/mariadb/columnstore/data
|
||||||
# make sure trace dir is world-writable and sticky
|
# make sure trace dir is world-writable and sticky
|
||||||
test -d $installdir/data || mkdir $installdir/data
|
test -d $installdir/data || mkdir $installdir/data
|
||||||
test -d $installdir/data1 || mkdir $installdir/data1
|
test -d $installdir/data1 || mkdir $installdir/data1
|
||||||
@@ -186,6 +190,8 @@ else
|
|||||||
sudo $installdir/bin/syslogSetup.sh --installdir=$installdir install > /tmp/syslog_install.log 2>&1
|
sudo $installdir/bin/syslogSetup.sh --installdir=$installdir install > /tmp/syslog_install.log 2>&1
|
||||||
sudo chown $user:$user $installdir/etc/Columnstore.xml
|
sudo chown $user:$user $installdir/etc/Columnstore.xml
|
||||||
sudo chmod -R 777 /dev/shm
|
sudo chmod -R 777 /dev/shm
|
||||||
|
sudo chmod 777 /var/lock/subsys
|
||||||
|
sudo chmod 777 /tmp
|
||||||
sudo rm -f /var/lock/subsys/mysql-Columnstore
|
sudo rm -f /var/lock/subsys/mysql-Columnstore
|
||||||
sudo rm -f /tmp/StopColumnstore
|
sudo rm -f /tmp/StopColumnstore
|
||||||
|
|
||||||
|
@@ -82,9 +82,15 @@ chown -R $user.$user $installdir/mysql
|
|||||||
if [ -f $installdir/lib/libcalmysql.so.1.0.0 ]; then
|
if [ -f $installdir/lib/libcalmysql.so.1.0.0 ]; then
|
||||||
libcalmysql=$installdir/lib/libcalmysql.so.1.0.0
|
libcalmysql=$installdir/lib/libcalmysql.so.1.0.0
|
||||||
libudfsdk=$installdir/lib/libudf_mysql.so.1.0.0
|
libudfsdk=$installdir/lib/libudf_mysql.so.1.0.0
|
||||||
|
is_columnstore_tables=$installdir/lib/is_columnstore_tables.so.1.0.0
|
||||||
|
is_columnstore_columns=$installdir/lib/is_columnstore_columns.so.1.0.0
|
||||||
|
is_columnstore_extents=$installdir/lib/is_columnstore_extents.so.1.0.0
|
||||||
elif [ -f $installdir/lib/libcalmysql.so.1 ]; then
|
elif [ -f $installdir/lib/libcalmysql.so.1 ]; then
|
||||||
libcalmysql=$installdir/lib/libcalmysql.so.1
|
libcalmysql=$installdir/lib/libcalmysql.so.1
|
||||||
libudfsdk=$installdir/lib/libudf_mysql.so.1
|
libudfsdk=$installdir/lib/libudf_mysql.so.1
|
||||||
|
is_columnstore_tables=$installdir/lib/is_columnstore_tables.so.1
|
||||||
|
is_columnstore_columns=$installdir/lib/is_columnstore_columns.so.1
|
||||||
|
is_columnstore_extents=$installdir/lib/is_columnstore_extents.so.1
|
||||||
else
|
else
|
||||||
libcalmysql=
|
libcalmysql=
|
||||||
fi
|
fi
|
||||||
@@ -95,6 +101,9 @@ if [ -n "$libcalmysql" ]; then
|
|||||||
ln -sf $libcalmysql libcalmysql.so
|
ln -sf $libcalmysql libcalmysql.so
|
||||||
ln -sf $libcalmysql libcalmysqlent.so
|
ln -sf $libcalmysql libcalmysqlent.so
|
||||||
ln -sf $libudfsdk libudf_mysql.so
|
ln -sf $libudfsdk libudf_mysql.so
|
||||||
|
ln -sf $is_columnstore_tables is_columnstore_tables.so
|
||||||
|
ln -sf $is_columnstore_columns is_columnstore_columns.so
|
||||||
|
ln -sf $is_columnstore_extents is_columnstore_extents.so
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# cleanup previous install mysql replication files
|
# cleanup previous install mysql replication files
|
||||||
|
@@ -38,17 +38,27 @@ $installdir/bin/columnstore stop > /dev/null 2>&1
|
|||||||
$installdir/myql/columnstore-Mysql stop > /dev/null 2>&1
|
$installdir/myql/columnstore-Mysql stop > /dev/null 2>&1
|
||||||
|
|
||||||
# uninstall OS scripts updated by postConfigure
|
# uninstall OS scripts updated by postConfigure
|
||||||
|
if [ $user = "root" ]; then
|
||||||
if test -f /root/.bashrc.columnstoreSave ; then
|
if test -f /root/.bashrc.columnstoreSave ; then
|
||||||
$sudo mv -f /root/.bashrc.columnstoreSave /root/.bashrc > /dev/null 2>&1
|
mv -f /root/.bashrc.columnstoreSave /root/.bashrc > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if test -f $HOME/.bashrc.columnstoreSave ; then
|
||||||
|
mv -f /home/$user/.bashrc.columnstoreSave /home/$user/.bashrc > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test -f /etc/exports.columnstoreSave ; then
|
if test -f /etc/exports.columnstoreSave ; then
|
||||||
$sudo mv -f /etc/exports.columnstoreSave /etc/exports > /dev/null 2>&1
|
$sudo mv -f /etc/exports.columnstoreSave /etc/exports > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
$sudo rm -f /etc/exports > /dev/null 2>&1
|
$sudo rm -f /etc/exports > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -f /etc/rc.d/rc.local.columnstoreSave ; then
|
if test -f /etc/rc.d/rc.local.columnstoreSave ; then
|
||||||
$sudo mv -f /etc/rc.d/rc.local.columnstoreSave /etc/rc.d/rc.local > /dev/null 2>&1
|
$sudo mv -f /etc/rc.d/rc.local.columnstoreSave /etc/rc.d/rc.local > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -f /etc/rc.local.columnstoreSave ; then
|
if test -f /etc/rc.local.columnstoreSave ; then
|
||||||
$sudo mv -f /etc/rc.local.columnstoreSave /etc/rc.local > /dev/null 2>&1
|
$sudo mv -f /etc/rc.local.columnstoreSave /etc/rc.local > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
@@ -9614,8 +9614,8 @@ namespace oam
|
|||||||
// not root user
|
// not root user
|
||||||
// The stat above may fail for non-root because of permissions
|
// The stat above may fail for non-root because of permissions
|
||||||
// This is a non-optimal solution
|
// This is a non-optimal solution
|
||||||
string cmd = "pgrep ProcMon";
|
string cmd = "pgrep ProcMon > /dev/null 2>&1";
|
||||||
if (system(cmd.c_str()) == 1)
|
if (system(cmd.c_str()) == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -234,7 +234,6 @@ void processAlarm(const Alarm& calAlarm)
|
|||||||
rewriteActiveLog (alarmList);
|
rewriteActiveLog (alarmList);
|
||||||
} catch (runtime_error& e)
|
} catch (runtime_error& e)
|
||||||
{
|
{
|
||||||
if (ALARM_DEBUG) {
|
|
||||||
LoggingID lid(11);
|
LoggingID lid(11);
|
||||||
MessageLog ml(lid);
|
MessageLog ml(lid);
|
||||||
Message msg;
|
Message msg;
|
||||||
@@ -242,9 +241,7 @@ void processAlarm(const Alarm& calAlarm)
|
|||||||
args.add("rewriteActiveLog error:");
|
args.add("rewriteActiveLog error:");
|
||||||
args.add(e.what());
|
args.add(e.what());
|
||||||
msg.format(args);
|
msg.format(args);
|
||||||
ml.logDebugMessage(msg);
|
ml.logErrorMessage(msg);
|
||||||
}
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -256,7 +253,6 @@ void processAlarm(const Alarm& calAlarm)
|
|||||||
logAlarm (calAlarm, ACTIVE_ALARM_FILE);
|
logAlarm (calAlarm, ACTIVE_ALARM_FILE);
|
||||||
} catch (runtime_error& e)
|
} catch (runtime_error& e)
|
||||||
{
|
{
|
||||||
if (ALARM_DEBUG) {
|
|
||||||
LoggingID lid(11);
|
LoggingID lid(11);
|
||||||
MessageLog ml(lid);
|
MessageLog ml(lid);
|
||||||
Message msg;
|
Message msg;
|
||||||
@@ -264,9 +260,7 @@ void processAlarm(const Alarm& calAlarm)
|
|||||||
args.add("logAlarm error:");
|
args.add("logAlarm error:");
|
||||||
args.add(e.what());
|
args.add(e.what());
|
||||||
msg.format(args);
|
msg.format(args);
|
||||||
ml.logDebugMessage(msg);
|
ml.logErrorMessage(msg);
|
||||||
}
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +270,6 @@ void processAlarm(const Alarm& calAlarm)
|
|||||||
logAlarm (calAlarm, ALARM_FILE);
|
logAlarm (calAlarm, ALARM_FILE);
|
||||||
} catch (runtime_error& e)
|
} catch (runtime_error& e)
|
||||||
{
|
{
|
||||||
if (ALARM_DEBUG) {
|
|
||||||
LoggingID lid(11);
|
LoggingID lid(11);
|
||||||
MessageLog ml(lid);
|
MessageLog ml(lid);
|
||||||
Message msg;
|
Message msg;
|
||||||
@@ -284,9 +277,7 @@ void processAlarm(const Alarm& calAlarm)
|
|||||||
args.add("logAlarm error:");
|
args.add("logAlarm error:");
|
||||||
args.add(e.what());
|
args.add(e.what());
|
||||||
msg.format(args);
|
msg.format(args);
|
||||||
ml.logDebugMessage(msg);
|
ml.logErrorMessage(msg);
|
||||||
}
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,7 +453,6 @@ void ALARMManager::sendAlarmReport (const char* componentID, int alarmID, int st
|
|||||||
configAlarm (calAlarm);
|
configAlarm (calAlarm);
|
||||||
} catch (runtime_error& e)
|
} catch (runtime_error& e)
|
||||||
{
|
{
|
||||||
if (ALARM_DEBUG) {
|
|
||||||
LoggingID lid(11);
|
LoggingID lid(11);
|
||||||
MessageLog ml(lid);
|
MessageLog ml(lid);
|
||||||
Message msg;
|
Message msg;
|
||||||
@@ -470,9 +460,7 @@ void ALARMManager::sendAlarmReport (const char* componentID, int alarmID, int st
|
|||||||
args.add("configAlarm error:");
|
args.add("configAlarm error:");
|
||||||
args.add(e.what());
|
args.add(e.what());
|
||||||
msg.format(args);
|
msg.format(args);
|
||||||
ml.logDebugMessage(msg);
|
ml.logErrorMessage(msg);
|
||||||
}
|
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@@ -114,8 +114,10 @@ void dbrmDirCheck()
|
|||||||
dbrmroot = sysConfig->getConfig(SystemSection, "DBRMRoot");
|
dbrmroot = sysConfig->getConfig(SystemSection, "DBRMRoot");
|
||||||
dbrmrootPrev = sysConfigPrev->getConfig(SystemSection, "DBRMRoot");
|
dbrmrootPrev = sysConfigPrev->getConfig(SystemSection, "DBRMRoot");
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if ( dbrmrootPrev.empty() )
|
if ( dbrmrootPrev.empty() )
|
||||||
return;
|
return;
|
||||||
@@ -259,8 +261,10 @@ void mysqlSetup()
|
|||||||
try {
|
try {
|
||||||
oam.actionMysqlCalpont(MYSQL_START);
|
oam.actionMysqlCalpont(MYSQL_START);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
sleep(2);
|
sleep(2);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
@@ -289,7 +293,10 @@ void mysqlSetup()
|
|||||||
try {
|
try {
|
||||||
oam.setSystemConfig("MySQLPasswordConfig", "y");
|
oam.setSystemConfig("MySQLPasswordConfig", "y");
|
||||||
}
|
}
|
||||||
catch(...) {}
|
catch(const std::exception &exc)
|
||||||
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -303,8 +310,10 @@ void mysqlSetup()
|
|||||||
try {
|
try {
|
||||||
oam.actionMysqlCalpont(MYSQL_STOP);
|
oam.actionMysqlCalpont(MYSQL_STOP);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
unlink("/tmp/idbmysql.log");
|
unlink("/tmp/idbmysql.log");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -344,8 +353,10 @@ int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum)
|
|||||||
if ( procstat.ProcessOpState == oam::ACTIVE)
|
if ( procstat.ProcessOpState == oam::ACTIVE)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
catch (exception& ex)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemModuleTypeConfig systemmoduletypeconfig;
|
SystemModuleTypeConfig systemmoduletypeconfig;
|
||||||
@@ -353,8 +364,10 @@ int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum)
|
|||||||
try{
|
try{
|
||||||
oam.getSystemConfig(systemmoduletypeconfig);
|
oam.getSystemConfig(systemmoduletypeconfig);
|
||||||
}
|
}
|
||||||
catch (exception& ex)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
ByteStream msg;
|
ByteStream msg;
|
||||||
ByteStream::byte requestID = RUNUPGRADE;
|
ByteStream::byte requestID = RUNUPGRADE;
|
||||||
@@ -393,8 +406,10 @@ int sendUpgradeRequest(int IserverTypeInstall, bool pmwithum)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (exception& ex)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -417,8 +432,10 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, std::st
|
|||||||
try{
|
try{
|
||||||
oam.getSystemConfig(systemmoduletypeconfig);
|
oam.getSystemConfig(systemmoduletypeconfig);
|
||||||
}
|
}
|
||||||
catch (exception& ex)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
//get Primary (Master) UM
|
//get Primary (Master) UM
|
||||||
string masterModule = oam::UnassignedName;
|
string masterModule = oam::UnassignedName;
|
||||||
@@ -530,8 +547,10 @@ int sendReplicationRequest(int IserverTypeInstall, std::string password, std::st
|
|||||||
pt++;
|
pt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (exception& ex)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pt++;
|
pt++;
|
||||||
@@ -593,7 +612,9 @@ int sendMsgProcMon( std::string module, ByteStream msg, int requestID, int timeo
|
|||||||
try {
|
try {
|
||||||
receivedMSG = mqRequest.read(&ts);
|
receivedMSG = mqRequest.read(&ts);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (const std::exception &exc)
|
||||||
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
return returnStatus;
|
return returnStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -630,8 +651,10 @@ int sendMsgProcMon( std::string module, ByteStream msg, int requestID, int timeo
|
|||||||
|
|
||||||
mqRequest.shutdown();
|
mqRequest.shutdown();
|
||||||
}
|
}
|
||||||
catch (exception& ex)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
return returnStatus;
|
return returnStatus;
|
||||||
}
|
}
|
||||||
@@ -651,8 +674,10 @@ void checkFilesPerPartion(int DBRootCount, Config* sysConfig)
|
|||||||
try {
|
try {
|
||||||
dbRoot = sysConfig->getConfig(SystemSection, "DBRoot1");
|
dbRoot = sysConfig->getConfig(SystemSection, "DBRoot1");
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
dbRoot = dbRoot + "/000.dir";
|
dbRoot = dbRoot + "/000.dir";
|
||||||
|
|
||||||
@@ -661,8 +686,10 @@ void checkFilesPerPartion(int DBRootCount, Config* sysConfig)
|
|||||||
string tmp = sysConfig->getConfig("ExtentMap", "FilesPerColumnPartition");
|
string tmp = sysConfig->getConfig("ExtentMap", "FilesPerColumnPartition");
|
||||||
FilesPerColumnPartition = atoi(tmp.c_str());
|
FilesPerColumnPartition = atoi(tmp.c_str());
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if ( fmod(FilesPerColumnPartition , (float) DBRootCount) != 0 ) {
|
if ( fmod(FilesPerColumnPartition , (float) DBRootCount) != 0 ) {
|
||||||
ifstream oldFile (dbRoot.c_str());
|
ifstream oldFile (dbRoot.c_str());
|
||||||
@@ -738,8 +765,10 @@ void checkMysqlPort( std::string& mysqlPort, Config* sysConfig )
|
|||||||
try {
|
try {
|
||||||
sysConfig->setConfig("Installation", "MySQLPort", mysqlPort);
|
sysConfig->setConfig("Installation", "MySQLPort", mysqlPort);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !writeConfig(sysConfig) ) {
|
if ( !writeConfig(sysConfig) ) {
|
||||||
cout << "ERROR: Failed trying to update MariDB Columnstore System Configuration file" << endl;
|
cout << "ERROR: Failed trying to update MariDB Columnstore System Configuration file" << endl;
|
||||||
@@ -860,8 +889,10 @@ void checkSystemMySQLPort(std::string& mysqlPort, Config* sysConfig, std::string
|
|||||||
try {
|
try {
|
||||||
sysConfig->setConfig("Installation", "MySQLPort", mysqlPort);
|
sysConfig->setConfig("Installation", "MySQLPort", mysqlPort);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !writeConfig(sysConfig) ) {
|
if ( !writeConfig(sysConfig) ) {
|
||||||
cout << "ERROR: Failed trying to update MariDB Columnstore System Configuration file" << endl;
|
cout << "ERROR: Failed trying to update MariDB Columnstore System Configuration file" << endl;
|
||||||
@@ -889,8 +920,10 @@ bool writeConfig( Config* sysConfig )
|
|||||||
sysConfig->write();
|
sysConfig->write();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(const std::exception &exc)
|
||||||
{}
|
{
|
||||||
|
std::cerr << exc.what() << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -5041,10 +5041,10 @@ bool updateBash()
|
|||||||
|
|
||||||
if (!rootUser)
|
if (!rootUser)
|
||||||
{
|
{
|
||||||
string cmd = "echo export columnstore_INSTALL_DIR=" + installDir + " >> " + fileName;
|
string cmd = "echo export COLUMNSTORE_INSTALL_DIR=" + installDir + " >> " + fileName;
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
|
|
||||||
cmd = "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$columnstore_INSTALL_DIR/lib:$columnstore_INSTALL_DIR/mysql/lib/mysql >> " + fileName;
|
cmd = "echo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$COLUMNSTORE_INSTALL_DIR/lib:$COLUMNSTORE_INSTALL_DIR/mysql/lib/mysql >> " + fileName;
|
||||||
system(cmd.c_str());
|
system(cmd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -436,9 +436,15 @@ const SBS InetStreamSocket::read(const struct ::timespec* timeout, bool* isTimeO
|
|||||||
uint8_t* msglenp = reinterpret_cast<uint8_t*>(&msglen);
|
uint8_t* msglenp = reinterpret_cast<uint8_t*>(&msglen);
|
||||||
size_t mlread = 0;
|
size_t mlread = 0;
|
||||||
|
|
||||||
if (readToMagic(msecs, isTimeOut, stats) == false) //indicates a timeout or EOF
|
bool myIsTimeOut = false;
|
||||||
|
if (readToMagic(msecs, &myIsTimeOut, stats) == false) //indicates a timeout or EOF
|
||||||
{
|
{
|
||||||
logIoError("InetStreamSocket::read: timeout during readToMagic", 0);
|
if (!myIsTimeOut)
|
||||||
|
logIoError("InetStreamSocket::read: EOF during readToMagic", 0);
|
||||||
|
if (isTimeOut)
|
||||||
|
{
|
||||||
|
*isTimeOut = myIsTimeOut;
|
||||||
|
}
|
||||||
return SBS(new ByteStream(0));
|
return SBS(new ByteStream(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -193,7 +193,7 @@ uint8_t WE_DDLCommandProc::writeSystable(ByteStream& bs, std::string &err)
|
|||||||
|
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
gmtime_r(&t, &tmp);
|
gmtime_r(&t, &tmp);
|
||||||
aDay.year = tmp.tm_year;
|
aDay.year = tmp.tm_year + 1900;
|
||||||
aDay.month = tmp.tm_mon+1;
|
aDay.month = tmp.tm_mon+1;
|
||||||
aDay.day = tmp.tm_mday;
|
aDay.day = tmp.tm_mday;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user