Repository navigation
Add test: Duplicate TLS argument rejection and positional-arity stripping untested - #114580
Conversation
Pre-PR validation: 6/6 ✅a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [3888bf7] Summary: ✅ AI ReviewSummaryThis PR adds a stateless PostgreSQL regression test for duplicate trailing TLS arguments and the positional-argument stripping that follows them. The duplicate-argument checks are useful, but the positive Findings
Final Verdict
|
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units6 translation units recompiled, 5 s compile time in total, 6 of them have a recent master baseline. |
|
@clickgapai check the CI failures |
…el and a fixed name collides across runs
|
@PedroTadim the flaky-check failures were this PR's own test: it created a fixed-name database ( |
| CREATE DATABASE {CLICKHOUSE_DATABASE_1:Identifier} ENGINE = PostgreSQL('127.0.0.1:1', 'd', 'u', 'p', 'sch', 1, sslmode = 'require'); | ||
| SELECT engine FROM system.databases WHERE name = {CLICKHOUSE_DATABASE_1:String} ORDER BY 1; | ||
|
|
||
| CREATE TABLE t_04869 (x Int32) ENGINE = PostgreSQL('127.0.0.1:1', 'd', 't', 'u', 'p', 'sch', sslmode = 'require'); |
There was a problem hiding this comment.
StoragePostgreSQL::getConfiguration accepts 5 to 7 positional arguments, so this case is still valid even if extractSSLParamsFromArguments stops stripping the trailing sslmode: it would arrive as seven arguments (host, db, table, user, password, schema, sslmode = ...) and keep passing. That means the table-engine half of "trailing arguments must not count towards the positional ones" is not actually observable here. Could we spend the last positional slot too, for example by adding an on_conflict argument before sslmode, so a regression turns into NUMBER_OF_ARGUMENTS_DOESNT_MATCH?
Test-only PR. Review: are the gaps real, is the test right.
Adds test coverage for 1 untested code path, found during automated review of PR #110615.
That PR: (1) Adds TLS/SSL to every PostgreSQL integration:
sslmodeplus certificate/key either as server-local paths (sslrootcert/sslcert/sslkey, config-only) or as literal contents (*_pem, accepted from SQL, materialized intoTemporarySecretFileand masked as secrets). New code: …1. Duplicate TLS argument rejection and positional-arity stripping untested
src/Storages/StoragePostgreSQL.cpp:726,src/Databases/PostgreSQL/DatabasePostgreSQL.cpp:573Risk:
StoragePostgreSQL::extractSSLParamsFromArgumentsstrips trailing TLSkey = valuepairs and rejects repeats atStoragePostgreSQL.cpp:726-727; the stripped list then feeds the arity check atDatabasePostgreSQL.cpp:573. Risk if broken: a repeatedsslmode = 'require', sslmode = 'disable'…Unique vs PR tests: 04820 formats queries with distinct TLS keys and checks masking plus path rejection; 04846 checks query-tree masking; test_postgresql_ssl exercises real handshakes through named collections. None repeats a TLS key (the
specified more than oncebranch) and none combines the maximum positional …Tags:
-- Tags: no-fasttest—no-fasttest: the PostgreSQL integration is not built in the fast test build; the PR's own 04820 uses the same tagcc @alexey-milovidov (author of #110615) — could you take a look, and add the
can be testedlabel if this looks good?Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes