MXS-2026 Make QC default initialization simpler

In test-programs and alike, QC can now be initialized with
one function instead of three.
This commit is contained in:
Johan Wikman
2018-08-27 16:02:29 +03:00
parent 5c1a1c2700
commit ce715e03aa
2 changed files with 70 additions and 6 deletions

View File

@ -415,6 +415,39 @@ bool qc_setup(const QC_CACHE_PROPERTIES* cache_properties,
return (rv == QC_RESULT_OK) ? true : false;
}
bool qc_init(const QC_CACHE_PROPERTIES* cache_properties,
qc_sql_mode_t sql_mode,
const char* plugin_name,
const char* plugin_args)
{
QC_TRACE();
bool rc = qc_setup(cache_properties, sql_mode, plugin_name, plugin_args);
if (rc)
{
rc = qc_process_init(QC_INIT_BOTH);
if (rc)
{
rc = qc_thread_init(QC_INIT_BOTH);
if (!rc)
{
qc_process_end(QC_INIT_BOTH);
}
}
}
return rc;
}
void qc_end()
{
qc_thread_end(QC_INIT_BOTH);
qc_process_end(QC_INIT_BOTH);
}
bool qc_process_init(uint32_t kind)
{
QC_TRACE();