From e6e74c0be7c2ab22532a768f0276a48bf0a32527 Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Fri, 24 Feb 2023 14:29:26 +0000 Subject: [PATCH] MCOL-5437 Fixes to follow the charset_info api change introduced by MDEV-30661 --- utils/funcexp/func_lcase.cpp | 4 ++++ utils/funcexp/func_ucase.cpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/utils/funcexp/func_lcase.cpp b/utils/funcexp/func_lcase.cpp index 66d96c68c..674a4b044 100644 --- a/utils/funcexp/func_lcase.cpp +++ b/utils/funcexp/func_lcase.cpp @@ -53,7 +53,11 @@ std::string Func_lcase::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& is CHARSET_INFO* cs = colType.getCharset(); uint64_t inLen = tstr.length(); +#if MYSQL_VERSION_ID >= 101004 + uint64_t bufLen = inLen * cs->casedn_multiply(); +#else uint64_t bufLen = inLen * cs->casedn_multiply; +#endif char* outBuf = new char[bufLen]; uint64_t outLen = cs->casedn(tstr.str(), inLen, outBuf, bufLen); diff --git a/utils/funcexp/func_ucase.cpp b/utils/funcexp/func_ucase.cpp index 815bb2194..5e9602643 100644 --- a/utils/funcexp/func_ucase.cpp +++ b/utils/funcexp/func_ucase.cpp @@ -62,7 +62,11 @@ std::string Func_ucase::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& is CHARSET_INFO* cs = colType.getCharset(); uint64_t inLen = tstr.length(); - uint64_t bufLen = inLen * cs->caseup_multiply; +#if MYSQL_VERSION_ID >= 101004 + uint64_t bufLen = inLen * cs->casedn_multiply(); +#else + uint64_t bufLen = inLen * cs->casedn_multiply; +#endif char* outBuf = new char[bufLen]; uint64_t outLen = cs->caseup(tstr.str(), inLen, outBuf, bufLen);