From 96adf535ae2f42e384d417978dbc74b4aafed368 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 19 Dec 2019 19:42:38 +0100 Subject: [PATCH] don't create a ResourceManager to initialize a global variable this is executed when ha_columnstore is loaded, at dlopen time before any initialization code is run and crashes any dlopen attemps. Crashes - because a missing config file is a crashing offence, but it's an issue for another day --- dbcon/mysql/ha_mcs_ddl.cpp | 4 ++-- dbcon/mysql/ha_mcs_dml.cpp | 9 ++++++--- dbcon/mysql/ha_mcs_impl.cpp | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dbcon/mysql/ha_mcs_ddl.cpp b/dbcon/mysql/ha_mcs_ddl.cpp index 66fc3118c..43671055e 100644 --- a/dbcon/mysql/ha_mcs_ddl.cpp +++ b/dbcon/mysql/ha_mcs_ddl.cpp @@ -96,8 +96,8 @@ namespace { typedef CalpontSelectExecutionPlan::ColumnMap::value_type CMVT_; -ResourceManager* rm = ResourceManager::instance(); -bool useHdfs = rm->useHdfs(); +// HDFS is never used nowadays, so don't bother +bool useHdfs = false; // ResourceManager::instance()->useHdfs(); #include "ha_autoi.cpp" diff --git a/dbcon/mysql/ha_mcs_dml.cpp b/dbcon/mysql/ha_mcs_dml.cpp index df3d2d206..1aaa59b53 100644 --- a/dbcon/mysql/ha_mcs_dml.cpp +++ b/dbcon/mysql/ha_mcs_dml.cpp @@ -77,9 +77,9 @@ using namespace joblist; namespace { -ResourceManager* rm = ResourceManager::instance(); -uint64_t fBatchInsertGroupRows = rm->getRowsPerBatch(); -bool useHdfs = rm->useHdfs(); +uint64_t fBatchInsertGroupRows = 0; // ResourceManager::instance()->getRowsPerBatch(); +// HDFS is never used nowadays, so don't bother +bool useHdfs = false; // ResourceManager::instance()->useHdfs(); //convenience fcn inline uint32_t tid2sid(const uint32_t tid) @@ -595,6 +595,9 @@ int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info& return rc; } + if (fBatchInsertGroupRows == 0) + fBatchInsertGroupRows = ResourceManager::instance()->getRowsPerBatch(); + //timer.stop( "buildValueList"); if ( ci.singleInsert // Single insert || (( ci.bulkInsertRows > 0 ) && (( ( ci.rowsHaveInserted + size) >= ci.bulkInsertRows ) || ( size >= fBatchInsertGroupRows )) ) diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index fdf6e546e..766cfbea7 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -162,8 +162,8 @@ static const string interval_names[] = const unsigned NONSUPPORTED_ERR_THRESH = 2000; -ResourceManager* rm = ResourceManager::instance(); -bool useHdfs = rm->useHdfs(); +// HDFS is never used nowadays, so don't bother +bool useHdfs = false; // ResourceManager::instance()->useHdfs(); //convenience fcn inline uint32_t tid2sid(const uint32_t tid)