diff --git a/src/Functions/LowerUpperUTF8Impl.h b/src/Functions/LowerUpperUTF8Impl.h index 7d60bd54d2f..f174bcd5f3e 100644 --- a/src/Functions/LowerUpperUTF8Impl.h +++ b/src/Functions/LowerUpperUTF8Impl.h @@ -6,6 +6,7 @@ # include # include +# include # include # include # include @@ -49,6 +50,11 @@ struct LowerUpperUTF8Impl if (U_FAILURE(error_code)) throw DB::Exception(ErrorCodes::LOGICAL_ERROR, "Error calling ucasemap_open: {}", u_errorName(error_code)); + SCOPE_EXIT( + { + ucasemap_close(case_map); + }); + size_t curr_offset = 0; for (size_t row_i = 0; row_i < input_rows_count; ++row_i) {