Changed-lines coverage: PR changed C/C++ lines covered by tests: 85.95% (159/185) Uncovered changed code (with context): ================================================================================ src/Core/PostgreSQL/PoolWithFailover.cpp ================================================================================ --- uncovered block 156-156 --- 154 | replicas_with_priority[0].emplace_back(std::make_shared(connection_string, pool_size)); 155 | if (bg_reconnect) >> 156 | DB::ReplicasReconnector::instance().add(connectionReestablisher(std::weak_ptr(replicas_with_priority[0].back()), pool_wait_timeout)); 157 | } 158 | } ================================================================================ src/Core/PostgreSQL/Utils.cpp ================================================================================ --- uncovered block 27-33 --- 25 | /// `sslmode`) and reports a clear error on connect. 26 | if (!ssl_params.ssl_mode.empty()) >> 27 | out << " sslmode=" << DB::quote << ssl_params.ssl_mode; 28 | if (!ssl_params.ssl_root_cert.empty()) >> 29 | out << " sslrootcert=" << DB::quote << ssl_params.ssl_root_cert; 30 | if (!ssl_params.ssl_cert.empty()) >> 31 | out << " sslcert=" << DB::quote << ssl_params.ssl_cert; 32 | if (!ssl_params.ssl_key.empty()) >> 33 | out << " sslkey=" << DB::quote << ssl_params.ssl_key; 34 | 35 | return {out.str(), host + ':' + DB::toString(port)}; ================================================================================ src/Databases/PostgreSQL/DatabaseMaterializedPostgreSQL.cpp ================================================================================ --- uncovered block 233-240 --- 231 | else if (change.name.starts_with("materialized_postgresql_ssl_")) 232 | { >> 233 | throw Exception(ErrorCodes::QUERY_NOT_ALLOWED, >> 234 | "Setting `{}` is part of the PostgreSQL connection parameters, which are fixed when the " >> 235 | "database is created, and cannot be changed for an existing database: the replication " >> 236 | "connection keeps using the original parameters. Recreate the database to change it.", change.name); 237 | } 238 | else if ((change.name != "materialized_postgresql_allow_automatic_update") && (change.name != "materialized_postgresql_max_block_size")) 239 | { >> 240 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unknown setting"); 241 | } 242 | } --- uncovered block 664-670 --- 662 | const auto & ssl_settings = *postgresql_replica_settings; 663 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_mode].isChanged()) >> 664 | configuration.ssl_mode = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_mode]; 665 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_root_cert].isChanged()) >> 666 | configuration.ssl_root_cert = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_root_cert]; 667 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_cert].isChanged()) >> 668 | configuration.ssl_cert = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_cert]; 669 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_key].isChanged()) >> 670 | configuration.ssl_key = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_key]; 671 | 672 | /// The SETTINGS clause could have introduced certificate paths on top of the already ================================================================================ src/Storages/PostgreSQL/StorageMaterializedPostgreSQL.cpp ================================================================================ --- uncovered block 660-666 --- 658 | const auto & ssl_settings = *postgresql_replication_settings; 659 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_mode].isChanged()) >> 660 | configuration.ssl_mode = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_mode]; 661 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_root_cert].isChanged()) >> 662 | configuration.ssl_root_cert = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_root_cert]; 663 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_cert].isChanged()) >> 664 | configuration.ssl_cert = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_cert]; 665 | if (ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_key].isChanged()) >> 666 | configuration.ssl_key = ssl_settings[MaterializedPostgreSQLSetting::materialized_postgresql_ssl_key]; 667 | 668 | /// The SETTINGS clause could have introduced certificate paths on top of the already ================================================================================ src/Storages/StoragePostgreSQL.cpp ================================================================================ --- uncovered block 608-608 --- 606 | /// clickhouse-local runs with the privileges of the user who started it, there is no file boundary to enforce. 607 | if (context->getApplicationType() == Context::ApplicationType::LOCAL) >> 608 | return; 609 | 610 | namespace fs = std::filesystem; --- uncovered block 620-627 --- 618 | /// libpq would resolve a relative path against the working directory of the server process, 619 | /// which the user cannot rely on; resolve it against `user_files_path` instead. >> 620 | if (fs::path(path).is_relative()) >> 621 | path = (fs::path(user_files_path) / path).lexically_normal().string(); 622 | >> 623 | if (!fileOrSymlinkPathStartsWith(path, user_files_path)) >> 624 | throw Exception(ErrorCodes::PATH_ACCESS_DENIED, >> 625 | "The `{}` path {} is not inside the `user_files` directory {}. TLS/SSL certificate and key files " >> 626 | "used for PostgreSQL connections defined through SQL must reside there", >> 627 | option_name, path, user_files_path); 628 | }; 629 | WARNING: Failed to get start time for [Print Uncovered Code] - start time and duration won't be set --- Coverage counts --- Lines : baseline 903,861/1,048,789 -> current 903,941/1,048,900 (delta +80 / +111) Functions : baseline 796,652/865,253 -> current 796,661/865,258 (delta +9 / +5) Branches : baseline 290,675/371,610 -> current 290,738/371,650 (delta +63 / +40)