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

@ -47,11 +47,8 @@ static int is_columnstore_tables_fill(THD* thd, TABLE_LIST* tables, COND* cond)
TABLE* table = tables->table;
InformationSchemaCond isCond;
boost::shared_ptr<execplan::CalpontSystemCatalog> systemCatalogPtr =
execplan::CalpontSystemCatalog::makeCalpontSystemCatalog(
execplan::CalpontSystemCatalog::idb_tid2sid(thd->thread_id));
systemCatalogPtr->identity(execplan::CalpontSystemCatalog::FE);
execplan::CalpontSystemCatalog csc;
csc.identity(execplan::CalpontSystemCatalog::FE);
if (cond)
{
@ -60,7 +57,7 @@ static int is_columnstore_tables_fill(THD* thd, TABLE_LIST* tables, COND* cond)
const std::vector<
std::pair<execplan::CalpontSystemCatalog::OID, execplan::CalpontSystemCatalog::TableName> >
catalog_tables = systemCatalogPtr->getTables();
catalog_tables = csc.getTables();
for (std::vector<std::pair<execplan::CalpontSystemCatalog::OID,
execplan::CalpontSystemCatalog::TableName> >::const_iterator it =
@ -72,7 +69,7 @@ static int is_columnstore_tables_fill(THD* thd, TABLE_LIST* tables, COND* cond)
try
{
execplan::CalpontSystemCatalog::TableInfo tb_info = systemCatalogPtr->tableInfo((*it).second);
execplan::CalpontSystemCatalog::TableInfo tb_info = csc.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);
@ -83,7 +80,7 @@ static int is_columnstore_tables_fill(THD* thd, TABLE_LIST* tables, COND* cond)
if (tb_info.tablewithautoincr)
{
table->field[5]->set_notnull();
table->field[5]->store(systemCatalogPtr->nextAutoIncrValue((*it).second));
table->field[5]->store(csc.nextAutoIncrValue((*it).second));
}
else
{