diff --git a/server/modules/filter/cache/rules.cc b/server/modules/filter/cache/rules.cc index e7feb9f56..1983862f4 100644 --- a/server/modules/filter/cache/rules.cc +++ b/server/modules/filter/cache/rules.cc @@ -537,6 +537,7 @@ static CACHE_RULE *cache_rule_create_regexp(cache_rule_attribute_t attribute, pcre2_jit_compile(code, PCRE2_JIT_COMPLETE); int n_threads = config_threadcount(); + ss_dassert(n_threads > 0); pcre2_match_data **datas = alloc_match_datas(n_threads, code); diff --git a/server/modules/filter/cache/test/testrules.cc b/server/modules/filter/cache/test/testrules.cc index 32f72cd2a..932b51870 100644 --- a/server/modules/filter/cache/test/testrules.cc +++ b/server/modules/filter/cache/test/testrules.cc @@ -236,6 +236,9 @@ int main() if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT)) { + MXS_CONFIG* pConfig = config_get_global_options(); + pConfig->n_threads = 1; + set_libdir(MXS_STRDUP_A("../../../../../query_classifier/qc_sqlite/")); if (qc_setup("qc_sqlite", "") && qc_process_init(QC_INIT_BOTH)) {