MXS-3121 Expose statement currently being classified

Intended to be used from fatal signal handlers. As the statement will
be returned only while classification is in process, if a statement
is returned, it is an indication that the crash was caused by the
classification.
This commit is contained in:
Johan Wikman
2020-08-20 13:04:02 +03:00
parent bf6ff8a578
commit c5870cbaba
4 changed files with 62 additions and 2 deletions

View File

@ -1313,6 +1313,14 @@ bool qc_set_options(uint32_t options)
return rv == QC_RESULT_OK;
}
bool qc_get_current_stmt(const char** ppStmt, size_t* pLen)
{
QC_TRACE();
mxb_assert(this_unit.classifier);
return this_unit.classifier->qc_get_current_stmt(ppStmt, pLen) == QC_RESULT_OK;
}
void qc_get_cache_properties(QC_CACHE_PROPERTIES* properties)
{
properties->max_size = this_unit.cache_max_size();