75720 {
75722 const auto compressed_string_ptr = (const unsigned char *)compressed_string;
75723 StringWithExtraSpace result;
75724 const auto target_ptr = (unsigned char *)result.str.GetPrefixWriteable();
75725 const auto decompressed_string_size =
75726 duckdb_fsst_decompress(fsst_decoder, compressed_string_len, compressed_string_ptr,
75727 string_t::INLINE_LENGTH + sizeof(StringWithExtraSpace::extra_space), target_ptr);
75728 if (decompressed_string_size > string_t::INLINE_LENGTH) {
75729 throw IOException("Corrupt database file: decoded FSST string of >=%llu bytes (should be <=%llu bytes)",
75730 decompressed_string_size, string_t::INLINE_LENGTH);
75731 }
75732 D_ASSERT(decompressed_string_size <= string_t::INLINE_LENGTH);
75733 result.str.SetSizeAndFinalize(UnsafeNumericCast<uint32_t>(decompressed_string_size), string_t::INLINE_LENGTH);
75734 return result.str;
75735 }