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

@ -3648,6 +3648,12 @@ int32_t qc_mysql_set_options(uint32_t options)
return rv;
}
int32_t qc_mysql_get_current_stmt(const char** ppStmt, size_t* pLen)
{
return QC_RESULT_ERROR;
}
/**
* EXPORTS
*/
@ -3684,7 +3690,8 @@ extern "C"
nullptr, // qc_info_dup not supported.
nullptr, // qc_info_close not supported.
qc_mysql_get_options,
qc_mysql_set_options
qc_mysql_set_options,
qc_mysql_get_current_stmt
};
static MXS_MODULE info =

View File

@ -5359,6 +5359,20 @@ int32_t qc_sqlite_set_options(uint32_t options)
return rv;
}
int32_t qc_sqlite_get_current_stmt(const char** ppStmt, size_t* pLen)
{
int32_t rv = QC_RESULT_ERROR;
if (this_thread.pInfo && this_thread.pInfo->m_pQuery && (this_thread.pInfo->m_nQuery != 0))
{
*ppStmt = this_thread.pInfo->m_pQuery;
*pLen = this_thread.pInfo->m_nQuery;
rv = QC_RESULT_OK;
}
return rv;
}
/**
* EXPORTS
*/
@ -5395,7 +5409,8 @@ extern "C"
qc_sqlite_info_dup,
qc_sqlite_info_close,
qc_sqlite_get_options,
qc_sqlite_set_options
qc_sqlite_set_options,
qc_sqlite_get_current_stmt
};
static MXS_MODULE info =