1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-5384 This commit replaces shared pointer to CSC with CSC ctor that is cleaned up leaving a scope

CSC default ctor was private b/c it must not allow to use CSC outside thread cache.
  However there are some places in the plugin code that need a standalone syscat that
  is cleaned up leaving the scope. The decision is to make the restriction mentioned
  organizational rather than syntactical.
This commit is contained in:
Roman Nozdrin
2023-01-24 12:54:50 +00:00
parent 00e766253c
commit ff534dba7f
6 changed files with 54 additions and 52 deletions

View File

@ -38,7 +38,7 @@ using namespace oam;
#include "errorids.h"
using namespace logging;
//#include "resourcemanager.h"
// #include "resourcemanager.h"
#include "columnstoreversion.h"
#include "ha_mcs_sysvars.h"
@ -140,7 +140,8 @@ extern "C"
std::string pstr(parameter);
boost::algorithm::to_lower(pstr);
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -243,7 +244,8 @@ extern "C"
const char* mcsgetstats(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
{
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -322,7 +324,8 @@ extern "C"
#endif
long long mcssettrace(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
{
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -387,7 +390,7 @@ extern "C"
try
{
if (dbrm.getSystemReady() > 0 && dbrm.getSystemQueryReady() > 0)
if (dbrm.getSystemReady() > 0 && dbrm.getSystemQueryReady() > 0)
{
return 1;
}
@ -556,7 +559,8 @@ extern "C"
{
THD* thd = current_thd;
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -665,7 +669,8 @@ extern "C"
const char* mcscleartablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
{
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -789,14 +794,12 @@ extern "C"
boost::algorithm::to_lower(tableName.table);
}
boost::shared_ptr<execplan::CalpontSystemCatalog> csc =
execplan::CalpontSystemCatalog::makeCalpontSystemCatalog(
execplan::CalpontSystemCatalog::idb_tid2sid(thd->thread_id));
csc->identity(execplan::CalpontSystemCatalog::FE);
execplan::CalpontSystemCatalog csc;
csc.identity(execplan::CalpontSystemCatalog::FE);
try
{
nextVal = csc->nextAutoIncrValue(tableName);
nextVal = csc.nextAutoIncrValue(tableName);
}
catch (std::exception&)
{
@ -931,7 +934,8 @@ extern "C"
}
}
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -1095,7 +1099,8 @@ extern "C"
const char* mcsgetsqlcount(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
{
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}