================================================================================ Changed-lines coverage summary ================================================================================ Denominator: lines added/modified by this PR in C/C++ source files that LCOV considers coverable (excludes blank lines, braces, comments, header-only declarations, and error-path noise such as `LOGICAL_ERROR`, `UNREACHABLE()`, `abort()`). Numerator: of those coverable lines, the number actually executed by the test suite during this coverage run. PR changed C/C++ lines covered by tests: 84.16% (1567/1862) Uncovered changed code (with context): ================================================================================ base/base/JSON.cpp ================================================================================ --- uncovered block 606-612 --- 604 | 605 | ++s; >> 606 | checkPos(s + 4); >> 607 | std::string hex(s, 4); >> 608 | s += 3; >> 609 | int unicode = {}; >> 610 | try 611 | { >> 612 | unicode = Poco::NumberParser::parseHex(hex); 613 | } 614 | catch (const Poco::SyntaxException &) ================================================================================ base/base/getMemoryAmount.cpp ================================================================================ --- uncovered block 30-36 --- 28 | while (current_cgroup != default_cgroups_mount.parent_path()) 29 | { >> 30 | std::ifstream setting_file(current_cgroup / "memory.max"); >> 31 | if (setting_file.is_open()) 32 | { >> 33 | uint64_t value = {}; >> 34 | if (setting_file >> value) >> 35 | return {value}; >> 36 | return {}; /// e.g. the cgroups default "max" 37 | } 38 | current_cgroup = current_cgroup.parent_path(); ================================================================================ base/base/sleep.cpp ================================================================================ --- uncovered block 53-53 --- 51 | struct timespec current_time{}; 52 | if (0 != clock_gettime(clock_type, ¤t_time)) >> 53 | throw std::system_error(std::error_code(errno, std::system_category())); 54 | 55 | constexpr uint64_t resolution = 1'000'000'000; ================================================================================ base/base/wide_integer_to_string.cpp ================================================================================ --- uncovered block 15-21 --- 13 | { 14 | std::string res; >> 15 | if (integer::_impl::operator_eq(n, 0U)) >> 16 | return "0"; 17 | >> 18 | integer t{}; >> 19 | bool is_neg = integer::_impl::is_negative(n); >> 20 | if (is_neg) >> 21 | t = integer::_impl::operator_unary_minus(n); 22 | else 23 | t = n; ================================================================================ programs/docker-init/docker-init.cpp ================================================================================ --- uncovered block 136-141 --- 134 | (void)close(pipefd[1]); 135 | >> 136 | std::string output; >> 137 | char buf[4096]; >> 138 | ssize_t n = 0; >> 139 | while ((n = read(pipefd[0], buf, sizeof(buf))) > 0) >> 140 | output.append(buf, static_cast(n)); >> 141 | (void)close(pipefd[0]); 142 | 143 | int status = 0; --- uncovered block 444-450 --- 442 | { 443 | std::string_view src = clickhouse_password; >> 444 | const std::string_view needle = "]]>"; >> 445 | const std::string_view replacement = "]]]]>"; >> 446 | size_t pos = 0; >> 447 | size_t found = 0; >> 448 | while ((found = src.find(needle, pos)) != std::string_view::npos) 449 | { >> 450 | escaped_password.append(src, pos, found - pos); 451 | escaped_password += replacement; 452 | pos = found + needle.size(); --- uncovered block 880-885 --- 878 | 879 | /// --- Resolve identity --- >> 880 | uid_t current_uid = getuid(); >> 881 | uid_t run_uid = 0; >> 882 | gid_t run_gid = 0; >> 883 | bool do_chown = true; 884 | >> 885 | if (getEnv("CLICKHOUSE_RUN_AS_ROOT") == "1" || getEnv("CLICKHOUSE_DO_NOT_CHOWN") == "1") 886 | do_chown = false; 887 | ================================================================================ programs/install/Install.cpp ================================================================================ --- uncovered block 1024-1030 --- 1022 | int start(const std::string & user, const std::string & group, const fs::path & binary, const fs::path & executable, const fs::path & config, const fs::path & pid_file, unsigned max_tries, bool no_sudo) 1023 | { >> 1024 | if (fs::exists(pid_file)) 1025 | { >> 1026 | ReadBufferFromFile in(pid_file.string()); >> 1027 | Int32 pid = {}; >> 1028 | if (tryReadIntText(pid, in)) 1029 | { >> 1030 | fmt::print("{} file exists and contains pid = {}.\n", pid_file.string(), pid); 1031 | 1032 | if (0 == kill(pid, 0)) ================================================================================ programs/keeper-bench/Generator.h ================================================================================ --- uncovered block 224-224 --- 222 | ZooKeeperRequestWithCallbacks generate(); 223 | >> 224 | uint64_t getSeed() const { return seed; } 225 | private: 226 | uint64_t seed = 0; ================================================================================ programs/local/LocalServer.cpp ================================================================================ --- uncovered block 691-691 --- 689 | rlimit rlim{}; 690 | if (getrlimit(RLIMIT_NOFILE, &rlim)) >> 691 | throw Poco::Exception("Cannot getrlimit"); 692 | 693 | if (rlim.rlim_cur < rlim.rlim_max) ================================================================================ programs/server/Server.cpp ================================================================================ --- uncovered block 1863-1863 --- 1861 | rlimit rlim{}; 1862 | if (getrlimit(RLIMIT_NOFILE, &rlim)) >> 1863 | throw Poco::Exception("Cannot getrlimit"); 1864 | 1865 | if (rlim.rlim_cur == rlim.rlim_max) --- uncovered block 1886-1886 --- 1884 | rlimit rlim{}; 1885 | if (getrlimit(RLIMIT_NPROC, &rlim)) >> 1886 | throw Poco::Exception("Cannot getrlimit"); 1887 | 1888 | if (rlim.rlim_cur == rlim.rlim_max) ================================================================================ src/Access/AccessRights.cpp ================================================================================ --- uncovered block 1778-1778 --- 1776 | root->modifyFlags(function, false, flags_added, flags_removed); 1777 | if (flags_removed && root_with_grant_option) >> 1778 | root_with_grant_option->makeIntersection(*root); 1779 | 1780 | if (root_with_grant_option) ================================================================================ src/Access/LDAPClient.cpp ================================================================================ --- uncovered block 263-277 --- 261 | #endif 262 | >> 263 | #ifdef LDAP_OPT_TIMEOUT 264 | { >> 265 | ::timeval operation_timeout{}; >> 266 | operation_timeout.tv_sec = params.operation_timeout.count(); >> 267 | operation_timeout.tv_usec = 0; >> 268 | handleError(ldap_set_option(handle, LDAP_OPT_TIMEOUT, &operation_timeout)); 269 | } 270 | #endif 271 | >> 272 | #ifdef LDAP_OPT_NETWORK_TIMEOUT 273 | { >> 274 | ::timeval network_timeout{}; >> 275 | network_timeout.tv_sec = params.network_timeout.count(); >> 276 | network_timeout.tv_usec = 0; >> 277 | handleError(ldap_set_option(handle, LDAP_OPT_NETWORK_TIMEOUT, &network_timeout)); 278 | } 279 | #endif --- uncovered block 361-365 --- 359 | switch (params.sasl_mechanism) 360 | { >> 361 | case LDAPClient::Params::SASLMechanism::SIMPLE: 362 | { >> 363 | ::berval cred{}; >> 364 | cred.bv_val = const_cast(params.password.c_str()); >> 365 | cred.bv_len = params.password.size(); 366 | 367 | { --- uncovered block 476-480 --- 474 | ber = nullptr; 475 | } >> 476 | }); 477 | >> 478 | ::berval bv{}; 479 | >> 480 | handleError(ldap_get_dn_ber(handle, msg, &ber, &bv)); 481 | 482 | if (bv.bv_val && bv.bv_len > 0) ================================================================================ src/AggregateFunctions/AggregateFunctionDistinctDynamicTypes.cpp ================================================================================ --- uncovered block 52-55 --- 50 | void deserialize(ReadBuffer & buf) 51 | { >> 52 | size_t size = 0; >> 53 | readVarUInt(size, buf); >> 54 | if (size > MAX_ARRAY_SIZE) >> 55 | throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size (maximum: {}): {}", MAX_ARRAY_SIZE, size); 56 | 57 | data.reserve(size); ================================================================================ src/AggregateFunctions/AggregateFunctionDistinctJSONPaths.cpp ================================================================================ --- uncovered block 93-96 --- 91 | void deserialize(ReadBuffer & buf) 92 | { >> 93 | size_t size = 0; >> 94 | readVarUInt(size, buf); >> 95 | if (size > DISTINCT_JSON_PATHS_MAX_ARRAY_SIZE) >> 96 | throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size (maximum: {}): {}", DISTINCT_JSON_PATHS_MAX_ARRAY_SIZE, size); 97 | 98 | String path; --- uncovered block 203-207 --- 201 | void deserialize(ReadBuffer & buf) 202 | { >> 203 | size_t paths_size = 0; >> 204 | size_t types_size = 0; >> 205 | readVarUInt(paths_size, buf); >> 206 | if (paths_size > DISTINCT_JSON_PATHS_MAX_ARRAY_SIZE) >> 207 | throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size for paths (maximum: {}): {}", DISTINCT_JSON_PATHS_MAX_ARRAY_SIZE, paths_size); 208 | 209 | data.reserve(paths_size); ================================================================================ src/AggregateFunctions/AggregateFunctionGroupBitmapData.h ================================================================================ --- uncovered block 855-855 --- 853 | roaring::internal::container_t * large_bm_c = large_bm.ra_get_container(container_id, &large_bm_c_typecode); 854 | if (!large_bm_c) >> 855 | return 0; 856 | int num_added = 0; 857 | for (const auto ele : small_set.small) ================================================================================ src/AggregateFunctions/AggregateFunctionGroupNumericIndexedVector.cpp ================================================================================ --- uncovered block 73-73 --- 71 | 72 | if (!parameters.empty() && parameters.size() != 3) >> 73 | throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "AggregateFunction {} requires zero/three parameters", name); 74 | 75 | if (parameters.size() == 3) ================================================================================ src/AggregateFunctions/AggregateFunctionIntervalLengthSum.cpp ================================================================================ --- uncovered block 118-123 --- 116 | void deserialize(ReadBuffer & buf) 117 | { >> 118 | readBinary(sorted, buf); 119 | >> 120 | size_t size = 0; >> 121 | readBinary(size, buf); 122 | >> 123 | if (unlikely(size > MAX_ARRAY_SIZE)) 124 | throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size (maximum: {})", MAX_ARRAY_SIZE); 125 | ================================================================================ src/AggregateFunctions/AggregateFunctionQuantileGK.cpp ================================================================================ --- uncovered block 39-39 --- 37 | Int64 delta{}; // The maximum span of the rank 38 | >> 39 | Stats() = default; 40 | Stats(T value_, Int64 g_, Int64 delta_) : value(value_), g(g_), delta(delta_) { } 41 | }; --- uncovered block 198-203 --- 196 | { 197 | const Stats & self_sample = sampled[self_idx]; >> 198 | const Stats & other_sample = other.sampled[other_idx]; 199 | 200 | // Detect next sample >> 201 | Stats next_sample{}; >> 202 | Int64 additional_delta = 0; >> 203 | if (self_sample.value < other_sample.value) 204 | { 205 | ++self_idx; ================================================================================ src/AggregateFunctions/AggregateFunctionRetention.cpp ================================================================================ --- uncovered block 55-57 --- 53 | void deserialize(ReadBuffer & buf) 54 | { >> 55 | UInt32 event_value = 0; >> 56 | readBinary(event_value, buf); >> 57 | events = event_value; 58 | } 59 | }; ================================================================================ src/AggregateFunctions/AggregateFunctionSparkbar.cpp ================================================================================ --- uncovered block 124-124 --- 122 | for (size_t i = 0; i < size; ++i) 123 | { >> 124 | readBinary(x, buf); 125 | readBinary(y, buf); 126 | insert(x, y); --- uncovered block 199-199 --- 197 | bool has_overfllow = false; 198 | if constexpr (is_floating_point) >> 199 | res = histogram[index] + point.getMapped(); 200 | else 201 | has_overfllow = common::addOverflow(histogram[index], point.getMapped(), res); ================================================================================ src/AggregateFunctions/AggregateFunctionWindowFunnel.cpp ================================================================================ --- uncovered block 246-261 --- 244 | void deserialize(ReadBuffer & buf) 245 | { >> 246 | readBinary(sorted, buf); 247 | >> 248 | size_t events_size = 0; >> 249 | readBinary(events_size, buf); 250 | >> 251 | if (events_size > 100'000'000) /// Arbitrary limit to prevent excessive memory allocation 252 | throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large size of the state of windowFunnel"); 253 | >> 254 | events_list.clear(); >> 255 | events_list.reserve(events_size); 256 | >> 257 | T timestamp{}; >> 258 | UInt8 event_type = 0; >> 259 | UInt64 unique_id = 0; 260 | >> 261 | for (size_t i = 0; i < events_size; ++i) 262 | { 263 | readBinary(timestamp, buf); ================================================================================ src/AggregateFunctions/DDSketch/Store.h ================================================================================ --- uncovered block 179-179 --- 177 | readFloatBinary(bin_count, buf); 178 | if (!std::isfinite(bin_count) || bin_count < 0) >> 179 | throw Exception(ErrorCodes::INCORRECT_DATA, "Invalid bin count in DDSketch dense store: {}", bin_count); 180 | if (bin_count > 0) 181 | add(start_key, bin_count); --- uncovered block 190-190 --- 188 | readVarUInt(num_non_empty_bins, buf); 189 | if (num_non_empty_bins > max_bins_deserialize) >> 190 | throw Exception(ErrorCodes::INCORRECT_DATA, "Too many bins in DDSketch sparse store: {}", num_non_empty_bins); 191 | 192 | int previous_index = 0; ================================================================================ src/AggregateFunctions/SingleValueData.h ================================================================================ --- uncovered block 391-391 --- 389 | size_t row_number{}; 390 | >> 391 | bool has() const override { return column_ref != nullptr; } 392 | void insertResultInto(IColumn & to, const DataTypePtr & type) const override; 393 | void write(WriteBuffer & buf, const ISerialization & /*serialization*/) const override; ================================================================================ src/AggregateFunctions/TimeSeries/AggregateFunctionTimeSeriesGroupArray.h ================================================================================ --- uncovered block 389-389 --- 387 | ErrorCodes::INCORRECT_DATA, 388 | "Cannot deserialize data with different format version, expected {}, got {}", >> 389 | FORMAT_VERSION, format_version); 390 | 391 | Data & data = this->data(place); ================================================================================ src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesBase.h ================================================================================ --- uncovered block 433-433 --- 431 | 432 | if (format_version != FORMAT_VERSION) >> 433 | throw Exception(ErrorCodes::INCORRECT_DATA, "Cannot deserialize data with different format version"); 434 | 435 | size_t size = 0; ================================================================================ src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesChanges.h ================================================================================ --- uncovered block 91-93 --- 89 | void deserializeBucket(Bucket & bucket, ReadBuffer & buf, const size_t bucket_index) const 90 | { >> 91 | size_t sample_count = 0; >> 92 | readBinaryLittleEndian(sample_count,buf); >> 93 | bucket.samples.reserve(sample_count); 94 | 95 | for (size_t s = 0; s < sample_count; ++s) ================================================================================ src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesLinearRegression.h ================================================================================ --- uncovered block 101-103 --- 99 | void deserializeBucket(Bucket & bucket, ReadBuffer & buf, const size_t bucket_index) const 100 | { >> 101 | size_t sample_count = 0; >> 102 | readBinaryLittleEndian(sample_count,buf); >> 103 | bucket.samples.reserve(sample_count); 104 | 105 | for (size_t s = 0; s < sample_count; ++s) ================================================================================ src/Analyzer/Passes/RewriteSumFunctionWithSumAndCountPass.cpp ================================================================================ --- uncovered block 52-52 --- 50 | const auto & func_plus_minus_nodes = func_plus_minus_node->getArguments().getNodes(); 51 | if (func_plus_minus_nodes.size() != 2) >> 52 | return; 53 | 54 | size_t column_id = 0; ================================================================================ src/Analyzer/QueryTreeBuilder.cpp ================================================================================ --- uncovered block 229-229 --- 227 | 228 | if (select_lists.size() == 1) >> 229 | return buildSelectExpression(select_lists[0], is_subquery, cte_data, nullptr /*aliases*/, context); 230 | 231 | SelectUnionMode union_mode = {}; ================================================================================ src/Backups/RestorerFromBackup.cpp ================================================================================ --- uncovered block 641-641 --- 639 | tables_dependencies.getNumberOfAdjacents(table_id, num_dependencies, num_dependents); 640 | if (num_dependencies || !num_dependents) >> 641 | throw Exception( 642 | ErrorCodes::LOGICAL_ERROR, 643 | "Table {} in backup doesn't have dependencies and dependent tables as it expected to. It's a bug", ================================================================================ src/BridgeHelper/CatBoostLibraryBridgeHelper.cpp ================================================================================ --- uncovered block 93-107 --- 91 | .create(credentials); 92 | >> 93 | ExternalModelInfos result; 94 | >> 95 | UInt64 num_rows = 0; >> 96 | readIntBinary(num_rows, *buf); 97 | >> 98 | for (UInt64 i = 0; i < num_rows; ++i) 99 | { 100 | ExternalModelInfo info; 101 | >> 102 | readStringBinary(info.model_path, *buf); >> 103 | readStringBinary(info.model_type, *buf); 104 | >> 105 | UInt64 t = 0; >> 106 | readIntBinary(t, *buf); >> 107 | info.loading_start_time = std::chrono::system_clock::from_time_t(t); 108 | 109 | readIntBinary(t, *buf); --- uncovered block 170-175 --- 168 | os << "library_path=" << escapeForFileName(*library_path) << "&"; 169 | os << "model_path=" << escapeForFileName(*model_path); >> 170 | }) >> 171 | .create(credentials); 172 | >> 173 | size_t result = 0; >> 174 | readIntBinary(result, *buf); >> 175 | return result; 176 | } 177 | ================================================================================ src/BridgeHelper/ExternalDictionaryLibraryBridgeHelper.cpp ================================================================================ --- uncovered block 98-99 --- 96 | if (result.size() != 1) 97 | throw Exception(ErrorCodes::LOGICAL_ERROR, >> 98 | "Unexpected message from library bridge: {}. " >> 99 | "Check that bridge and server have the same version.", result); 100 | 101 | UInt8 dictionary_id_exists = 0; ================================================================================ src/Client/Connection.cpp ================================================================================ --- uncovered block 1365-1365 --- 1363 | /// Have we already read packet type? 1364 | if (last_input_packet_type) >> 1365 | return *last_input_packet_type; 1366 | 1367 | UInt64 type = 0; ================================================================================ src/Client/ConnectionPoolWithFailover.cpp ================================================================================ --- uncovered block 215-215 --- 213 | if (pool_mode == PoolMode::GET_ALL) 214 | { >> 215 | min_entries = nested_pools.size(); 216 | max_entries = nested_pools.size(); 217 | } ================================================================================ src/Client/JWTProvider.cpp ================================================================================ --- uncovered block 222-232 --- 220 | #endif 221 | >> 222 | if (command.empty()) >> 223 | return; 224 | >> 225 | pid_t pid = 0; >> 226 | const char * argv[] = {command.c_str(), url.c_str(), nullptr}; >> 227 | int status = posix_spawnp(&pid, command.c_str(), nullptr, nullptr, const_cast(argv), nullptr); 228 | >> 229 | if (status == 0) 230 | { >> 231 | int wait_status = 0; >> 232 | waitpid(pid, &wait_status, 0); 233 | } 234 | #elif defined(OS_WINDOWS) ================================================================================ src/Client/ReplxxLineReader.cpp ================================================================================ --- uncovered block 203-203 --- 201 | tm broken{}; 202 | if (!localtime_r(&t, &broken)) >> 203 | return {}; 204 | 205 | static int const BUFF_SIZE(32); ================================================================================ src/Client/TestHint.cpp ================================================================================ --- uncovered block 148-148 --- 146 | auto [p, ec] = std::from_chars(token.begin, token.end, code); 147 | if (p == token.begin) >> 148 | throw DB::Exception( 149 | DB::ErrorCodes::CANNOT_PARSE_TEXT, 150 | "Could not parse integer number for errorcode: {}", ================================================================================ src/Columns/ColumnDynamic.cpp ================================================================================ --- uncovered block 791-791 --- 789 | readBinaryLittleEndian(type_and_value_size, in); 790 | if (in.available() < type_and_value_size) >> 791 | throw Exception(ErrorCodes::ATTEMPT_TO_READ_AFTER_EOF, "Attempt to read after eof when deserializing ColumnDynamic"); 792 | 793 | std::string_view type_and_value(in.position(), type_and_value_size); ================================================================================ src/Columns/ColumnLowCardinality.cpp ================================================================================ --- uncovered block 154-154 --- 152 | size_t index = 0; 153 | if (!dictionary.getColumnUnique().tryUniqueInsert(x, index)) >> 154 | return false; 155 | 156 | idx.insertIndex(index); ================================================================================ src/Columns/ColumnTuple.cpp ================================================================================ --- uncovered block 597-597 --- 595 | int res = 0; 596 | if (collator && columns[i]->isCollationSupported()) >> 597 | res = columns[i]->compareAtWithCollation(n, m, *assert_cast(rhs).columns[i], nan_direction_hint, *collator); 598 | else 599 | res = columns[i]->compareAt(n, m, *assert_cast(rhs).columns[i], nan_direction_hint); ================================================================================ src/Columns/ColumnUnique.h ================================================================================ --- uncovered block 555-555 --- 553 | readBinaryLittleEndian(string_size, in); 554 | if (in.available() < string_size) >> 555 | throw Exception(ErrorCodes::ATTEMPT_TO_READ_AFTER_EOF, "Not enough data to deserialize string value in ColumnUnique."); 556 | 557 | size_t ret = uniqueInsertData(in.position(), string_size - serialize_string_with_zero_byte); --- uncovered block 565-570 --- 563 | size_t ColumnUnique::uniqueDeserializeAndInsertAggregationStateValueFromArena(ReadBuffer & in) 564 | { >> 565 | if (is_nullable) 566 | { >> 567 | UInt8 val = 0; >> 568 | readBinaryLittleEndian(val, in); 569 | >> 570 | if (val) 571 | return getNullValueIndex(); 572 | --- uncovered block 589-592 --- 587 | /// String 588 | /// For compatibility, serialized string value contains zero byte at the end, we just ignore this byte. >> 589 | size_t string_size_with_zero_byte = 0; >> 590 | readBinaryLittleEndian(string_size_with_zero_byte, in); >> 591 | if (in.available() < string_size_with_zero_byte) >> 592 | throw Exception(ErrorCodes::ATTEMPT_TO_READ_AFTER_EOF, "Not enough data to deserialize string value in ColumnUnique."); 593 | 594 | size_t ret = uniqueInsertData(in.position(), string_size_with_zero_byte - 1); ================================================================================ src/Columns/ColumnVariant.cpp ================================================================================ --- uncovered block 844-847 --- 842 | void ColumnVariant::skipSerializedInArena(ReadBuffer & in) const 843 | { >> 844 | Discriminator global_discr = 0; >> 845 | readBinaryLittleEndian(global_discr, in); 846 | >> 847 | if (global_discr == NULL_DISCRIMINATOR) 848 | return; 849 | ================================================================================ src/Columns/ColumnVector.cpp ================================================================================ --- uncovered block 600-603 --- 598 | { 599 | /// It's also possible to insert boolean values into UInt8 column. >> 600 | bool boolean_value = false; >> 601 | if (x.tryGet(boolean_value)) 602 | { >> 603 | data.push_back(static_cast(boolean_value)); 604 | return true; 605 | } ================================================================================ src/Common/AlignedBuffer.cpp ================================================================================ --- uncovered block 22-22 --- 20 | int res = ::posix_memalign(&new_buf, std::max(alignment, sizeof(void*)), size); 21 | if (0 != res) >> 22 | throw ErrnoException( 23 | ErrorCodes::CANNOT_ALLOCATE_MEMORY, 24 | "Cannot allocate memory (posix_memalign), size: {}, alignment: {}.", ================================================================================ src/Common/Config/ConfigProcessor.cpp ================================================================================ --- uncovered block 440-446 --- 438 | for (const auto & substitution : substitutions) 439 | { >> 440 | std::string value = node->nodeValue(); 441 | >> 442 | bool replace_occurred = false; >> 443 | size_t pos = 0; >> 444 | while ((pos = value.find(substitution.first)) != std::string::npos) 445 | { >> 446 | value.replace(pos, substitution.first.length(), substitution.second); 447 | replace_occurred = true; 448 | } ================================================================================ src/Common/CounterInFile.h ================================================================================ --- uncovered block 155-163 --- 153 | if (file_exists) 154 | { >> 155 | DB::ReadBufferFromFileDescriptor rb(fd, SMALL_READ_WRITE_BUFFER_SIZE); >> 156 | try 157 | { >> 158 | UInt64 current_value = 0; >> 159 | DB::readIntText(current_value, rb); >> 160 | char c = 0; >> 161 | DB::readChar(c, rb); >> 162 | if (rb.count() > 0 && c == '\n' && rb.eof()) >> 163 | broken = false; 164 | } 165 | catch (const DB::Exception & e) ================================================================================ src/Common/Crypto/KeyPair.cpp ================================================================================ --- uncovered block 200-205 --- 198 | throw Exception(ErrorCodes::OPENSSL_ERROR, "BIO_new failed: {}", getOpenSSLErrors()); 199 | >> 200 | if (!PEM_write_bio_PUBKEY(bio.get(), key)) >> 201 | throw Exception(ErrorCodes::OPENSSL_ERROR, "PEM_write_bio_PUBKEY failed: {}", getOpenSSLErrors()); 202 | >> 203 | char * data = nullptr; >> 204 | uint64_t len = BIO_get_mem_data(bio.get(), &data); >> 205 | std::string result(data, len); 206 | 207 | return result; --- uncovered block 218-218 --- 216 | 217 | if (!PEM_write_bio_PrivateKey(bio.get(), key, nullptr, nullptr, 0, nullptr, nullptr)) >> 218 | throw Exception(ErrorCodes::OPENSSL_ERROR, "PEM_write_bio_PrivateKey failed: {}", getOpenSSLErrors()); 219 | 220 | char * data = nullptr; ================================================================================ src/Common/DNSResolver.cpp ================================================================================ --- uncovered block 90-95 --- 88 | } 89 | else >> 90 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Missing port number"); 91 | >> 92 | unsigned port = 0; >> 93 | if (Poco::NumberParser::tryParseUnsigned(port_str, port) && port <= 0xFFFF) 94 | { >> 95 | out_port = static_cast(port); 96 | } 97 | else --- uncovered block 318-322 --- 316 | Poco::Net::SocketAddress DNSResolver::resolveAddress(const std::string & host_and_port) 317 | { >> 318 | String host; >> 319 | UInt16 port = 0; >> 320 | splitHostAndPort(host_and_port, host, port); 321 | >> 322 | if (impl->disable_cache) 323 | return Poco::Net::SocketAddress(pickAddress(getResolvedIPAddressesWithFiltering(host)), port); 324 | ================================================================================ src/Common/Dwarf.cpp ================================================================================ --- uncovered block 1018-1023 --- 1016 | const CompilationUnit & cu, const Die & die, uint64_t attr_name) const 1017 | { >> 1018 | bool found = false; >> 1019 | uint64_t value = 0; >> 1020 | uint64_t form = 0; >> 1021 | forEachAttribute(cu, die, [&](const Attribute & attr) 1022 | { >> 1023 | if (attr.spec.name == attr_name) 1024 | { 1025 | found = true; ================================================================================ src/Common/FrequencyHolder.cpp ================================================================================ --- uncovered block 44-44 --- 42 | std::string_view resource(reinterpret_cast(resource_charset_zst), std::size(resource_charset_zst)); 43 | if (resource.empty()) >> 44 | throw Exception(ErrorCodes::FILE_DOESNT_EXIST, "There is no embedded charset frequencies"); 45 | 46 | String line; ================================================================================ src/Common/HTTPConnectionPool.cpp ================================================================================ --- uncovered block 605-605 --- 603 | auto fd = Session::socket().impl()->sockfd(); 604 | if (fd < 0) >> 605 | return; 606 | struct stat st; // NOLINT(cppcoreguidelines-pro-type-member-init,hicpp-member-init) 607 | if (fstat(fd, &st) == 0) ================================================================================ src/Common/HyperLogLogCounter.h ================================================================================ --- uncovered block 473-473 --- 471 | 472 | if (raw_estimate > (pow2_32 / 30.0)) >> 473 | fixed_estimate = raw_estimate; 474 | else 475 | fixed_estimate = applyCorrection(raw_estimate); ================================================================================ src/Common/MemoryTrackerUtils.cpp ================================================================================ --- uncovered block 11-11 --- 9 | MemoryTracker * query_memory_tracker = nullptr; 10 | if (query_memory_tracker = DB::CurrentThread::getMemoryTracker(); !query_memory_tracker) >> 11 | return {}; 12 | /// query-level memory tracker 13 | if (query_memory_tracker = query_memory_tracker->getParent(); !query_memory_tracker) ================================================================================ src/Common/OptimizedRegularExpression.cpp ================================================================================ --- uncovered block 622-622 --- 620 | if (is_trivial) 621 | { >> 622 | if (required_substring.empty()) 623 | return true; 624 | === Lost Baseline Coverage: 82 lines === ================================================================================ programs/server/Server.cpp ================================================================================ --- lost coverage block 1778-1781 --- 1776 | else 1777 | { >> 1778 | String calculated_binary_hash = getHashOfLoadedBinaryHex(); >> 1779 | if (calculated_binary_hash == stored_binary_hash) 1780 | { >> 1781 | LOG_INFO(log, "Integrity check of the executable successfully passed (checksum: {})", calculated_binary_hash); 1782 | } 1783 | else ================================================================================ src/AggregateFunctions/AggregateFunctionGroupArray.cpp ================================================================================ --- lost coverage block 769-769 --- 767 | == GroupArrayActionWhenLimitReached::DISCARD; 768 | >> 769 | return false; 770 | } 771 | ================================================================================ src/AggregateFunctions/AggregateFunctionGroupUniqArray.cpp ================================================================================ --- lost coverage block 329-330 --- 327 | } 328 | else >> 329 | throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, >> 330 | "Incorrect number of parameters for aggregate function {}, should be 0 or 1", name); 331 | 332 | if (!limit_size) ================================================================================ src/AggregateFunctions/AggregateFunctionIntervalLengthSum.cpp ================================================================================ --- lost coverage block 106-134 --- 104 | void serialize(WriteBuffer & buf) const 105 | { >> 106 | writeBinary(sorted, buf); >> 107 | writeBinary(segments.size(), buf); 108 | >> 109 | for (const auto & time_gap : segments) 110 | { >> 111 | writeBinary(time_gap.first, buf); >> 112 | writeBinary(time_gap.second, buf); 113 | } 114 | } 115 | 116 | void deserialize(ReadBuffer & buf) 117 | { >> 118 | readBinary(sorted, buf); 119 | >> 120 | size_t size = 0; >> 121 | readBinary(size, buf); 122 | >> 123 | if (unlikely(size > MAX_ARRAY_SIZE)) 124 | throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size (maximum: {})", MAX_ARRAY_SIZE); 125 | >> 126 | segments.clear(); >> 127 | segments.reserve(size); 128 | >> 129 | Segment segment; >> 130 | for (size_t i = 0; i < size; ++i) 131 | { >> 132 | readBinary(segment.first, buf); >> 133 | readBinary(segment.second, buf); >> 134 | segments.emplace_back(segment); 135 | } 136 | } --- lost coverage block 220-225 --- 218 | void serialize(ConstAggregateDataPtr __restrict place, WriteBuffer & buf, std::optional /* version */) const override 219 | { >> 220 | this->data(place).serialize(buf); 221 | } 222 | 223 | void deserialize(AggregateDataPtr __restrict place, ReadBuffer & buf, std::optional /* version */, Arena *) const override 224 | { >> 225 | this->data(place).deserialize(buf); 226 | } 227 | ================================================================================ src/AggregateFunctions/AggregateFunctionSequenceMatch.cpp ================================================================================ --- lost coverage block 813-814 --- 811 | { 812 | if (params.size() != 1) >> 813 | throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Aggregate function {} requires exactly one parameter.", >> 814 | name); 815 | 816 | const auto arg_count = argument_types.size(); ================================================================================ src/AggregateFunctions/AggregateFunctionSparkbar.cpp ================================================================================ --- lost coverage block 106-107 --- 104 | for (const auto & elem : points) 105 | { >> 106 | writeBinary(elem.getKey(), buf); >> 107 | writeBinary(elem.getMapped(), buf); 108 | } 109 | } --- lost coverage block 124-126 --- 122 | for (size_t i = 0; i < size; ++i) 123 | { >> 124 | readBinary(x, buf); >> 125 | readBinary(y, buf); >> 126 | insert(x, y); 127 | } 128 | } ================================================================================ src/AggregateFunctions/AggregateFunctionWindowFunnel.cpp ================================================================================ --- lost coverage block 42-42 --- 40 | /// either sort whole container or do so partially merging ranges afterwards 41 | if (!prefix_sorted && !suffix_sorted) >> 42 | std::stable_sort(std::begin(events_list), std::end(events_list)); 43 | else 44 | { ================================================================================ src/AggregateFunctions/SingleValueData.cpp ================================================================================ --- lost coverage block 468-469 --- 466 | else 467 | { >> 468 | auto final_flags = mergeIfAndNullFlags(null_map, if_map, row_begin, row_end); >> 469 | opt = findExtremeMaxIf(vec.getData().data(), final_flags.get(), row_begin, row_end); 470 | } 471 | ================================================================================ src/Analyzer/QueryTreeBuilder.cpp ================================================================================ --- lost coverage block 1305-1306 --- 1303 | if (!second_arg_literal) 1304 | { >> 1305 | throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, >> 1306 | "If groupConcat is used with two arguments, the second argument must be a constant String"); 1307 | } 1308 | ================================================================================ src/Analyzer/Resolve/QueryAnalyzer.cpp ================================================================================ --- lost coverage block 3871-3873 --- 3869 | { 3870 | throw Exception(ErrorCodes::LOGICAL_ERROR, >> 3871 | "Identifier in JOIN TREE '{}' resolved into unexpected table expression. In scope {}", >> 3872 | from_table_identifier.getIdentifier().getFullName(), >> 3873 | scope.scope_node->formatASTForErrorMessage()); 3874 | } 3875 | ================================================================================ src/Backups/BackupCoordinationStageSync.cpp ================================================================================ --- lost coverage block 440-440 --- 438 | if (!zookeeper->tryGet(initiator_start_node_path, initiator_start_node)) 439 | { >> 440 | LOG_TRACE(log, "Couldn't read the initiator's version, assuming {}", kInitialVersion); 441 | } 442 | std::lock_guard lock{mutex}; --- lost coverage block 780-786 --- 778 | /// So here we're writingh the error to the `process_list_element` and let it to be thrown later 779 | /// from `process_list_element->checkTimeLimit()`. >> 780 | String message = fmt::format("The 'alive' node hasn't been updated in ZooKeeper for {} for {} " >> 781 | "which is more than the specified timeout {}. Last time the 'alive' node was detected at {}", >> 782 | getHostDesc(host), disconnected_duration, failure_after_host_disconnected_for_seconds, >> 783 | host_info.last_connection_time); >> 784 | LOG_WARNING(log, "Lost connection to {}: {}", getHostDesc(host), message); >> 785 | exception = std::make_exception_ptr(Exception{ErrorCodes::FAILED_TO_SYNC_BACKUP_OR_RESTORE, "Lost connection to {}: {}", getHostDesc(host), message}); >> 786 | break; 787 | } 788 | --- lost coverage block 837-838 --- 835 | if ((getInitiatorVersion() == kVersionWithoutFinishNode) && (stage == BackupCoordinationStage::COMPLETED)) 836 | { >> 837 | LOG_TRACE(log, "Stopping the watching thread because the initiator uses outdated version {}", getInitiatorVersion()); >> 838 | stopWatchingThread(); 839 | } 840 | --- lost coverage block 853-855 --- 851 | if ((getInitiatorVersion() == kVersionWithoutFinishNode) && (stage == BackupCoordinationStage::COMPLETED)) 852 | { >> 853 | LOG_INFO(log, "Skipped creating the 'finish' node because the initiator uses outdated version {}", getInitiatorVersion()); >> 854 | std::lock_guard lock{mutex}; >> 855 | state.hosts.at(current_host).finished = true; 856 | } 857 | } --- lost coverage block 994-995 --- 992 | if (finishedNoLock()) 993 | { >> 994 | LOG_INFO(log, "The finish node for {} already exists", current_host_desc); >> 995 | return; 996 | } 997 | ================================================================================ src/Backups/BackupsWorker.cpp ================================================================================ --- lost coverage block 976-976 --- 974 | { 975 | if (!is_internal_restore && restore_coordination->isRestoreQuerySentToOtherHosts()) >> 976 | restore_coordination->waitOtherHostsFinish(/* throw_if_error = */ false); 977 | restore_coordination->finish(/* throw_if_error = */ false); 978 | } ================================================================================ src/Columns/ColumnDynamic.cpp ================================================================================ --- lost coverage block 999-1003 --- 997 | if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Unstable) 998 | getPermutationImpl(limit, res, ComparatorAscendingUnstable(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort()); >> 999 | else if (direction == IColumn::PermutationSortDirection::Ascending && stability == IColumn::PermutationSortStability::Stable) 1000 | getPermutationImpl(limit, res, ComparatorAscendingStable(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort()); >> 1001 | else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Unstable) 1002 | getPermutationImpl(limit, res, ComparatorDescendingUnstable(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort()); >> 1003 | else if (direction == IColumn::PermutationSortDirection::Descending && stability == IColumn::PermutationSortStability::Stable) 1004 | getPermutationImpl(limit, res, ComparatorDescendingStable(*this, nan_direction_hint), DefaultSort(), DefaultPartialSort()); 1005 | } --- lost coverage block 1497-1502 --- 1495 | else 1496 | { >> 1497 | VectorWithMemoryTracking> candidates_with_sizes; >> 1498 | candidates_with_sizes.reserve(shared_variant_candidates.size()); >> 1499 | for (const auto & [variant_name, size] : shared_variant_candidates) 1500 | candidates_with_sizes.emplace_back(size, variant_name); >> 1501 | std::sort(candidates_with_sizes.begin(), candidates_with_sizes.end(), std::greater()); >> 1502 | for (size_t i = 0; i < Statistics::MAX_SHARED_VARIANT_STATISTICS_SIZE; ++i) 1503 | new_statistics.shared_variants_statistics.emplace(candidates_with_sizes[i].second, candidates_with_sizes[i].first); 1504 | } ================================================================================ src/Columns/ColumnObject.cpp ================================================================================ --- lost coverage block 1944-1949 --- 1942 | else 1943 | { >> 1944 | VectorWithMemoryTracking> candidates_with_sizes; >> 1945 | candidates_with_sizes.reserve(shared_data_candidates.size()); >> 1946 | for (const auto & [path, size] : shared_data_candidates) 1947 | candidates_with_sizes.emplace_back(size, path); >> 1948 | std::sort(candidates_with_sizes.begin(), candidates_with_sizes.end(), std::greater()); >> 1949 | for (size_t i = 0; i < Statistics::MAX_SHARED_DATA_STATISTICS_SIZE; ++i) 1950 | new_statistics.shared_data_paths_statistics.emplace(candidates_with_sizes[i].second, candidates_with_sizes[i].first); 1951 | } ================================================================================ src/Columns/ReverseIndex.h ================================================================================ --- lost coverage block 363-363 --- 361 | external_saved_hash = std::move(hash); 362 | else >> 363 | ptr = expected; 364 | } 365 | ================================================================================ src/Common/HashTable/TwoLevelStringHashTable.h ================================================================================ --- lost coverage block 98-101 --- 96 | // Strings with trailing zeros are not representable as fixed-size 97 | // string keys. Put them to the generic table. >> 98 | auto res = hash(x); >> 99 | auto buck = getBucketFromHash(res); >> 100 | return func(self.impls[buck].ms, std::forward(key_holder), >> 101 | res); 102 | } 103 | ================================================================================ src/Common/PageCache.cpp ================================================================================ --- lost coverage block 137-149 --- 135 | PageCache::MappedPtr PageCache::get(UInt128 key_hash, bool inject_eviction) 136 | { >> 137 | MemoryTrackerBlockerInThread blocker(VariableContext::Global); 138 | >> 139 | if (inject_eviction && thread_local_rng() % 10 == 0) 140 | return nullptr; 141 | >> 142 | Shard & shard = *shards[getShardIdx(key_hash)]; 143 | >> 144 | const auto result = shard.get(key_hash); 145 | >> 146 | if (result) >> 147 | ProfileEvents::increment(ProfileEvents::PageCacheHits); 148 | >> 149 | return result; 150 | } 151 | ================================================================================ src/Compression/CompressionCodecEncrypted.cpp ================================================================================ --- lost coverage block 116-118 --- 114 | #else 115 | return "AES-256-GCM-SIV"; >> 116 | #endif 117 | else >> 118 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unknown encryption method. Got {}", getMethodName(Method)); 119 | } 120 | WARNING: Failed to get start time for [Print Uncovered Code] - start time and duration won't be set --- Coverage counts --- Lines : baseline 779,406/922,939 -> current 779,590/922,944 (delta +184 / +5) Functions : baseline 886,449/969,985 -> current 886,442/970,017 (delta -7 / +32) Branches : baseline 254,780/330,864 -> current 254,828/330,864 (delta +48 / +0)