1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-2178 CS now doesn't initiate a scan when MDB explicitly set scan to false in rnd_init().

sortItemIsInGroupRec() now has a base case for Item_Field and this prevents unbound recursion.

    Fixes fromSub() call with incorrect number of arguments.

    CS now doesn't ask for statistics unless a user explicitly asks for it using calsettrace().
This commit is contained in:
Roman Nozdrin
2019-07-15 21:58:45 +03:00
committed by Gagan Goel
parent a9c72675ba
commit 7d5275e1bd
5 changed files with 62 additions and 46 deletions

View File

@ -373,17 +373,16 @@ status_t
tpl_close ( cpsm_tplh_t* ntplh,
cpsm_conhdl_t** conn_hdl,
QueryStats& stats,
bool ask_4_stats,
bool clear_scan_ctx)
{
cpsm_conhdl_t* hndl = *conn_hdl;
#if IDB_SM_DEBUG
SMDEBUGLOG << "tpl_close: hndl" << hndl << " ntplh " << ntplh;
if (ntplh)
SMDEBUGLOG << " tableid: " << ntplh->tableid;
SMDEBUGLOG << endl;
#endif
delete ntplh;
// determine end of result set and end of statement execution
@ -391,57 +390,60 @@ tpl_close ( cpsm_tplh_t* ntplh,
{
// Get the query stats
ByteStream bs;
ByteStream::quadbyte qb = 3;
bs << qb;
hndl->write(bs);
// Ask for a stats only if a user explicitly asks
if(ask_4_stats)
{
ByteStream::quadbyte qb = 3;
bs << qb;
hndl->write(bs);
}
// MCOL-1601 Dispose of unused empty RowGroup
if (clear_scan_ctx)
{
std::cout << "tpl_close() clear_scan_ctx read" << std::endl;
bs = hndl->exeMgr->read();
}
#if IDB_SM_DEBUG
SMDEBUGLOG << "tpl_close hndl->exeMgr: " << hndl->exeMgr << endl;
#endif
//keep reading until we get a string
//TODO: really need to fix this! Why is ExeMgr sending other stuff?
for (int tries = 0; tries < 10; tries++)
// Ask for a stats only if a user explicitly asks
if(ask_4_stats)
{
bs = hndl->exeMgr->read();
for (int tries = 0; tries < 10; tries++)
{
bs = hndl->exeMgr->read();
if (bs.length() == 0) break;
if (bs.length() == 0) break;
try
{
bs >> hndl->queryStats;
bs >> hndl->extendedStats;
bs >> hndl->miniStats;
stats.unserialize(bs);
stats.setEndTime();
stats.insert();
break;
try
{
bs >> hndl->queryStats;
bs >> hndl->extendedStats;
bs >> hndl->miniStats;
stats.unserialize(bs);
stats.setEndTime();
stats.insert();
break;
}
catch (IDBExcept&)
{
// @bug4732
end_query(hndl);
throw;
}
catch (...)
{
// querystats messed up. close connection.
// no need to throw for querystats protocol error, like for tablemode.
SMDEBUGLOG << "tpl_close() exception whilst getting stats" << endl;
end_query(hndl);
sm_cleanup(hndl);
*conn_hdl = 0;
return STATUS_OK;
//throw runtime_error(string("tbl_close catch exception: ") + e.what());
}
}
catch (IDBExcept&)
{
// @bug4732
end_query(hndl);
throw;
}
catch (...)
{
// querystats messed up. close connection.
// no need to throw for querystats protocol error, like for tablemode.
#if IDB_SM_DEBUG
SMDEBUGLOG << "tpl_close() exception whilst getting stats" << endl;
#endif
end_query(hndl);
sm_cleanup(hndl);
*conn_hdl = 0;
return STATUS_OK;
//throw runtime_error(string("tbl_close catch exception: ") + e.what());
}
}
} //stats
end_query(hndl);
}