diff --git a/maxutils/maxbase/src/format.cc b/maxutils/maxbase/src/format.cc index 8ef1bb28f..b8562ea16 100644 --- a/maxutils/maxbase/src/format.cc +++ b/maxutils/maxbase/src/format.cc @@ -59,7 +59,7 @@ namespace maxbase std::string to_binary_size(int64_t size) { // Calculate log1024(size) and round it up - int idx = ceil(log(size) / log(1024)); + int idx = floor(log(size) / log(1024)); double num = size / pow(1024, idx); char buf[200]; // Enough for all possible values snprintf(buf, sizeof(buf), "%.2lf%s", num, get_binary_size_suffix(idx)); diff --git a/server/core/query_classifier.cc b/server/core/query_classifier.cc index 8adaaaf7c..c53c5058f 100644 --- a/server/core/query_classifier.cc +++ b/server/core/query_classifier.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -396,9 +397,9 @@ bool qc_setup(const QC_CACHE_PROPERTIES* cache_properties, if (cache_max_size) { - MXS_NOTICE("Query classification results are cached and reused, " - "cache max size: %" PRIi64 "", - cache_max_size); + MXS_NOTICE("Query classification results are cached and reused. " + "Memory used per thread: %s", + mxb::to_binary_size(cache_max_size).c_str()); } else {