Skip to content

Support C# client in postgres protocol - #80785

Merged
alexey-milovidov merged 15 commits into
ClickHouse:masterfrom
scanhex12:dotnet_postgresql
May 21, 2026
Merged

alexey-milovidov merged 15 commits into
ClickHouse:masterfrom
scanhex12:dotnet_postgresql

Conversation

@scanhex12

@scanhex12 scanhex12 commented May 25, 2025 •

Copy link
Copy Markdown
Member

Problems:

  1. The C# client uses PostgreSQL system tables
  2. It also starts interacting with the server with queries in the PostgreSQL dialect. I translated this query into the clickhouse dialect

Initial error from issue is not reproducible

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Support C# client in postgres protocol. This closes #18611

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.924

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 25, 2025
@clickhouse-gh

clickhouse-gh Bot commented May 25, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [94dd541c]

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label May 25, 2025
@alexey-milovidov

Copy link
Copy Markdown
Member

@scanhex12, I really like this! Could you please resolve the conflicts?

Comment thread src/Server/PostgreSQLHandler.cpp Resolved
Comment thread src/Server/PostgreSQLHandler.cpp Resolved
Comment thread src/Server/PostgreSQLHandler.cpp Resolved
@alexey-milovidov alexey-milovidov self-assigned this Oct 26, 2025
@alexey-milovidov

Copy link
Copy Markdown
Member

However, I'm ok keeping this ad-hoc translation.

@clickhouse-gh

clickhouse-gh Bot commented Jan 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2650965]

Summary: ❌

job_name test_name status info comment
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/check_report_messages.py FAIL

AI Review

Summary

This PR improves PostgreSQL wire handling for Npgsql/C# by fixing extended-protocol state transitions (CloseComplete, Close target validation, portal handling) and adding integration coverage. The remaining live issue is a contract mismatch: current implementation/tests validate only the Server Compatibility Mode=NoTypeLoading path, while the PR metadata still claims broad C# support and closure of #18611.

PR Metadata
  • Changelog category: Improvement is acceptable for the implemented scope.
  • Changelog entry is overbroad for current behavior and should explicitly mention the NoTypeLoading requirement instead of implying default Npgsql compatibility.
  • Suggested replacement text: Improves PostgreSQL wire compatibility for Npgsql-based C# clients when using Server Compatibility Mode=NoTypeLoading.
Findings

⚠️ Majors

  • [ci/docker/integration/mysql_dotnet_client/pg/Program.cs:27] The tested implementation requires Server Compatibility Mode=NoTypeLoading, but the PR contract text still implies generic C# client support and closure of #18611 (which tracks default Npgsql connect behavior). This is a contract/evidence mismatch.
  • Suggested fix: either narrow the PR/changelog contract to the NoTypeLoading mode (and avoid closing #18611), or add support and coverage for the default Npgsql connect path.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
  1. Align PR/changelog contract text with the implemented NoTypeLoading scope and avoid claiming closure of #18611, or
  2. Implement and test default Npgsql connect-path support.

Create temporary views for `pg_type`, `pg_namespace`, `pg_class`, `pg_proc`,
`pg_range`, `pg_attribute`, and `pg_enum` system tables when a PostgreSQL
protocol session starts. This allows C# Npgsql client queries to run as-is
without ad-hoc query translation.

Also fix `deleteStatement` and `resetBindQuery` to properly handle the close
protocol message.

ClickHouse#80785

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…et client test

Instead of creating a separate `clickhouse/postgresql-dotnet-client` Docker image,
add the PostgreSQL test app to the existing `clickhouse/mysql_dotnet_client` image
since both share the same base (ubuntu:22.04 + dotnet-sdk-8.0).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Comment thread src/Server/PostgreSQLHandler.cpp Resolved
alexey-milovidov and others added 2 commits March 20, 2026 11:42
The PostgreSQL system table views (pg_type, pg_namespace, etc.) are created
as temporary views during session initialization. Use the global context
(which has full access) instead of the user's query context, so that the
CREATE TEMPORARY VIEW statements bypass grant checks. The session context
is shared so the views remain visible to subsequent user queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Verify that a user with only SELECT privileges can connect via PostgreSQL
protocol (internal pg_type views are created successfully) but cannot
perform privileged operations like CREATE TABLE.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
alexey-milovidov added a commit that referenced this pull request Mar 23, 2026
Fix three issues causing test failures:

1. `initializeSystemTables` called `executeQuery` without marking queries
   as internal, causing "Query id cannot be empty" fatal error in
   `ProcessList::insert`. Use the `String`-based `executeQuery` overload
   with `QueryFlags{.internal = true}` and generate unique query IDs via
   `setCurrentQueryId`.

2. `processCloseQuery` unconditionally called `deleteStatement` which
   throws if the statement doesn't exist. Now only delete statements
   when the PostgreSQL Close message type is 'S' (statement), not 'P'
   (portal).

3. `CloseQuery` discarded the close target type byte. Store it and
   expose `isStatement`/`isPortal` helpers.

#80785

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Fix two issues in the PostgreSQL wire protocol handler:

1. Set a query ID on the internal context in `initializeSystemTables`
   to avoid "Query id cannot be empty" exception when creating
   temporary pg_* views on connection startup.

2. Parse and store the close target type ('S' for statement, 'P' for
   portal) in `CloseQuery`. Only call `deleteStatement` when the target
   is a prepared statement. Closing a portal should not deallocate the
   prepared statement, otherwise a later Bind/Execute on the same
   statement would fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Comment thread src/Server/PostgreSQLHandler.cpp Resolved
alexey-milovidov and others added 3 commits April 12, 2026 18:00
…ndler

- Rename `spl_query` variable to `sql_query` (typo fix)
- Call `initializeSystemTables` from extended protocol path (`processExecuteQuery`)
  in addition to simple-query path, so clients using Parse/Bind/Execute can
  access `pg_type` and other system views from the first query
- Fix `test_restricted_user_cannot_bypass_grants`: add explicit `dbname="default"`
  to psycopg connection for the restricted user (psycopg defaults to using the
  username as database name, causing "Database pg_restricted does not exist")
- Fix `test_dotnet_client`: initialize C# string properties with defaults to
  suppress CS8618 nullable warnings that polluted test output

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* `test_dotnet_client` failed because Npgsql 9 issues a complex `pg_catalog`
  introspection query on connect (joining `pg_type`, `pg_class`, `pg_proc`,
  `pg_range`, `pg_namespace`) that ClickHouse's analyzer cannot resolve due
  to unqualified column references in JOIN ON clauses. Use
  `Server Compatibility Mode=NoTypeLoading` so Npgsql skips that query while
  still allowing the explicit `SELECT oid, typname FROM pg_type` the test
  verifies.

* `test_restricted_user_cannot_bypass_grants` failed with a `TypeError`
  comparing `str` to `int`: ClickHouse sends scalar values over the
  PostgreSQL protocol in text mode, so `result[0]` arrives as a string.
  Cast to `int` before comparison.

Failing CI report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=80785&sha=adcd2d963f652bc671743fb22ba5fca1defd1f13&name_0=PR
Comment thread src/Server/PostgreSQLHandler.cpp Resolved
alexey-milovidov and others added 3 commits May 17, 2026 18:03
…ocol

C# Npgsql client issues multiple Parse/Bind/Execute/Sync cycles per
connection. The second cycle's `Bind` was rejected with
`UNEXPECTED_PACKET_FROM_CLIENT: Query is already binded` because
`bind_query` was never cleared at the end of a cycle.

Per PostgreSQL extended-query protocol, `Bind` replaces any portal of
the same name, and the unnamed portal is destroyed at the next `Sync`.
This change:

* Makes `attachBindQuery` overwrite the bind slot instead of failing.
* Resets `bind_query` in `processSyncQuery` so each cycle starts from
  a clean state.
* Adds a null check in `getStatmentFromBind` so an out-of-order
  `Execute` (without prior `Bind`) raises a proper exception instead
  of dereferencing a null pointer.

Failing CI report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=80785&sha=41f6306421771a6981fbaea309724474bfd25fbf&name_0=PR

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…e tag

The extended-protocol `Close` request must be acknowledged with a
`CloseComplete` message; otherwise clients tracking the protocol state
machine block waiting for the acknowledgement.

Two related fixes:

* `processCloseQuery` now sends `CloseQueryComplete` after processing the
  close target.
* The `CloseQueryComplete` message previously wrote tag `'C'`, which is
  the `CommandComplete` tag in the PostgreSQL message protocol.
  `CloseComplete` is `'3'`. Fix the tag so clients can actually
  distinguish the message.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

Continuing the PR:

  • Merged latest master into the branch (no conflicts).
  • Fixed the integration test failure test_postgresql_protocol/test.py::test_dotnet_client that was failing across 6 CI shards with DB::Exception: Query is already binded. The Npgsql client issues multiple Parse/Bind/Execute/Sync cycles per connection and the previous code rejected the second Bind because bind_query was never cleared at cycle boundaries. Per PostgreSQL extended-query protocol, Bind replaces any portal of the same name and Sync destroys the unnamed portal — adjusted attachBindQuery, processSyncQuery, and getStatmentFromBind accordingly. Commit: b59d6b9.
  • Addressed the unresolved review comment about processCloseQuery not sending CloseComplete. Also fixed a latent bug where the CloseQueryComplete message wrote tag 'C' (which is CommandComplete) instead of '3' (the actual CloseComplete tag). Commit: 521f945.

The remaining failure AST fuzzer (amd_debug, targeted, old_compatibility) is unrelated to this PR — the same Logical error: Table expression A data must be initialized occurs on master independently (e.g. https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=30287bb9edc2acc07424b4a86de403adf2ee3d31&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_debug%29 on 2026-04-13). The PR does not touch the analyzer code path implicated in the stack trace (QueryAnalyzer::resolveMatcher).

@groeneai, please investigate the AST fuzzer regression: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=80785&sha=41f6306421771a6981fbaea309724474bfd25fbf&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29 and provide a fix in a separate PR if one isn't already in progress.

Comment thread src/Server/PostgreSQLHandler.cpp Resolved
Comment thread src/Core/PostgreSQLProtocol.h Resolved
@groeneai

Copy link
Copy Markdown
Collaborator

Thanks for the heads-up @alexey-milovidov — confirming your attribution. This is an existing chronic master bug, not introduced by this PR.

CIDB cross-PR analysis (90 days)

day                    master_failures  pr_failures  pr
2026-05-16 00:00:00    0                1            #80785 (this PR, sha 41f63064)
2026-04-13 00:00:00    1                0            master sha 30287bb9 (your reference)

Two hits total in 90 days, zero in 30. The master hit and the PR hit are independent. PR #80785 does not touch src/Analyzer/. The triggering queries are fuzzer-generated, but they share the same shape: a qualified matcher (t.*) resolves against a CTE that is itself in the middle of being resolved.

Where it's thrown

Logical error: 'Table expression {} data must be initialized. In scope {}' is raised from IdentifierResolveScope::getTableExpressionDataOrThrow (src/Analyzer/Resolve/IdentifierResolveScope.cpp:91 and :106). The relevant caller on the resolveMatcher path is QueryAnalyzer::getMatchedColumnNodesWithNames (src/Analyzer/Resolve/QueryAnalyzer.cpp:1668), invoked from resolveQualifiedMatcher after tryResolveIdentifier finds a table expression via the TABLE_EXPRESSION context.

Pattern in both failures

Both fuzzer queries use WITH RECURSIVE with a qualified matcher that points at a CTE whose body has not yet been analyzed.

#80785 hit (2026-05-16, qualified matcher x.* inside x's own recursive body):

WITH RECURSIVE x AS (
  SELECT 1 AS id ...
  UNION ALL
  SELECT ..., minus(toDateOrNull(NULL, -1), x.*), ...  -- x.* references x while x is being defined
  FROM x WHERE id < 5
), y AS (...)
SELECT ... FROM y__fuzz_39 LEFT JOIN x USING (id) ...

Master hit (2026-04-13, qualified matcher y.* inside x's body, mutually referenced):

WITH RECURSIVE x AS (
  SELECT -9223372036854775808 AS id GROUP BY 1, 1, if(divide(...), y.*) AS alias384, ...
  UNION ALL SELECT toLowCardinality(65537) / id FROM x WHERE 65537 <= id
), y AS (SELECT DISTINCT -2147483647 AS id ... UNION ALL ... FROM x ...)
SELECT DISTINCT x.* FROM y LEFT JOIN x USING (id) ...

The CTE name is registered in cte_name_to_query_node before resolution begins, so the identifier lookup at line 1888 of QueryAnalyzer.cpp succeeds and returns the CTE's query node. But the corresponding AnalysisTableExpressionData entry in table_expression_node_to_data is only populated once the CTE's body is actually analyzed. Resolving t.* from inside t's own body hits the gap and trips the LOGICAL_ERROR.

History

This shape is older than the current fuzzer hits:

So the engine has rejected related shapes cleanly for a while, but qualified-matcher self/mutual references inside the CTE body still bypass the early checks and fall into the LOGICAL_ERROR path. No in-flight fix PR is targeting this code path (searched resolveQualifiedMatcher, table expression data must be initialized, recursive CTE PRs — nothing pending).

Plan

I will file a follow-up issue with both reproducers and a separate fix PR. The fix direction is to detect this state in resolveQualifiedMatcher (after tryResolveIdentifier returns a CTE) by checking whether the CTE's table expression is currently in the nearest query scope's table_expressions_in_resolve_process set (or, equivalently, whether table_expression_node_to_data has the entry), and throw UNKNOWN_IDENTIFIER with a clean message instead of letting getTableExpressionDataOrThrow raise LOGICAL_ERROR. That matches the old analyzer's behavior per #70177.

I'll link the issue and fix PR back here once filed.

CI report this PR: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=80785&sha=41f6306421771a6981fbaea309724474bfd25fbf&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29
Master report (2026-04-13): https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=30287bb9edc2acc07424b4a86de403adf2ee3d31&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_debug%29

The PR refactored `attachBindQuery` to silently overwrite the single
`bind_query` slot. With the previous strict check removed, a sequence
`Bind(p1, $1=1); Bind(p2, $1=2); Execute(p1)` would have executed the
`p2` bind instead of `p1` without raising an exception, because the
server keeps a single bind slot and `Execute` ignores `ExecuteQuery::portal_name`.

Reject non-empty `portal_name` explicitly in `attachBindQuery`,
`processExecuteQuery`, and `processCloseQuery`. Clients of the simple
extended-query flow (unnamed portal — Npgsql, psycopg, etc.) are
unaffected; clients that need named portals get a clear `NOT_IMPLEMENTED`
error instead of silently wrong results.

Also clarify the `Sync` comment to note that resetting the single bind
slot is equivalent to destroying the unnamed portal here, because the
unnamed portal is the only kind we accept.

Addresses two `clickhouse-gh` review threads on PR ClickHouse#80785.
Comment thread src/Server/PostgreSQLHandler.cpp Resolved
…tement

`processCloseQuery` cleared `bind_query` unconditionally, so a valid
sequence — `Parse s1; Parse s2; Bind(s1); Close('S', 's2'); Execute` —
would fail with `Execute without prior Bind` even though the bind for
`s1` should still be valid.

Now clear bind state only when:
  * the bind currently references the statement being deallocated
    (`Close('S', name)`), or
  * the unnamed portal is closed (`Close('P', '')`), since `attachBindQuery`
    only accepts the unnamed portal.

Add `PreparedStatemetsManager::bindReferencesStatement` to drive the
first condition.

ClickHouse#80785 (review)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
// Server Compatibility Mode=NoTypeLoading: Npgsql 9+ otherwise issues a
// complex `pg_catalog` introspection query on connect (joining pg_type,
// pg_class, pg_proc, pg_range, pg_namespace) that ClickHouse cannot run.
var connectionString = $"Host={options.Host};Port={options.Port};Username={options.Username};Password={options.Password};Database=default;Server Compatibility Mode=NoTypeLoading;";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test hard-codes Server Compatibility Mode=NoTypeLoading, which disables Npgsql's default catalog/type-loading introspection on connect.

So the PR's contract (Support C# client in postgres protocol) is not actually validated for the default Npgsql connection path; it only validates an opt-in compatibility mode.

Please either make the default path work and test it without this flag, or explicitly narrow/document the feature contract to require NoTypeLoading.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scope decision. The PR makes the C# client connect with NoTypeLoading (a single opt-in connection-string flag), which is the documented and tested contract — the inline code comment captures why: Npgsql 9+ otherwise issues a multi-way pg_catalog join (pg_type/pg_class/pg_proc/pg_range/pg_namespace) that we cannot fully execute even with the temporary views in place. Making the default connection path work would require additional pg_catalog views and join-shape support that are out of scope for this PR. The C# integration test exists precisely to pin down the NoTypeLoading contract and prevent regressions; widening Npgsql default-mode support can be a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the scope clarification. I still see a contract mismatch: the PR title/changelog say Support C# client in postgres protocol and the body says this closes #18611, but the implementation and test only support the NoTypeLoading mode (Server Compatibility Mode=NoTypeLoading) while the default Npgsql connection path remains unsupported.

Please either:

  1. narrow the PR contract explicitly (including changelog text) to NoTypeLoading, and avoid closing #18611, or
  2. add support/tests for the default Npgsql connect path.

Comment thread src/Server/PostgreSQLHandler.cpp Resolved
alexey-milovidov and others added 2 commits May 20, 2026 22:17
The previous `processCloseQuery` handler only acted on `'S'` (prepared
statement) and `'P'` (portal) targets, but any other byte fell through
and was silently acknowledged with `CloseComplete`. That violates the
protocol contract for malformed packets and hides client/server state
bugs.

Throw `UNEXPECTED_PACKET_FROM_CLIENT` for unknown `Close` targets so
that protocol violations surface as errors instead of being acked.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The previous diagnostic used `{:02X}` against a `char8_t` argument,
which trips fmtlib's consteval format-string check ("mixing character
types is disallowed" / "unknown format specifier"). Cast the target
byte to `int` (via `unsigned char` for the correct numeric value) and
drop the hex spec — the resulting decimal byte value is enough to
identify a malformed packet.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.10% +0.00%
Functions 91.40% 91.40% +0.00%
Branches 76.50% 76.50% +0.00%

Changed lines: 80.42% (152/189) · Uncovered code

Full report · Diff report

@alexey-milovidov
alexey-milovidov merged commit 1d973ab into ClickHouse:master May 21, 2026
322 of 328 checks passed
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 21, 2026
@Algunenano

Copy link
Copy Markdown
Member

Need to revert this PR, it broke the CI (test_mysql_protocol/test.py::test_mysql_dotnet_client).

This is what Claude thinks:

Confirmed. The PostgreSQL test correctly does cd /pg_testapp && dotnet run, but the MySQL test relies on the default WORKDIR. After PR #80785 (commit 82318c7b995), the Dockerfile's last WORKDIR is /pg_testapp instead of /testapp, so the MySQL test now runs the PostgreSQL app against the MySQL port — producing the Npgsql error Received unknown response X for SSLRequest (expecting S or N).

Root cause

Commit 82318c7b995 ("Reuse existing mysql_dotnet_client Docker image for PostgreSQL dotnet client test") changed the Dockerfile to add a second WORKDIR /pg_testapp block after the MySQL one. Since Docker remembers the last WORKDIR, docker exec ... dotnet run from the MySQL test (tests/integration/test_mysql_protocol/test.py:962) now lands in /pg_testapp and runs the PostgreSQL Npgsql client against the MySQL server port. Npgsql reads MySQL's handshake first byte (often X/Y, etc.) and reports Received unknown response X for SSLRequest (expecting S or N).

The PostgreSQL counterpart at tests/integration/test_postgresql_protocol/test.py:513 was updated to cd /pg_testapp && dotnet run, but the MySQL test wasn't updated to cd /testapp && dotnet run.

Fix

Either:
- Change test_mysql_protocol/test.py:962 to cd /testapp && dotnet run -- ... (symmetric with the PG test), or
- Swap the WORKDIR order in the Dockerfile so /testapp is last.

The first option is cleaner since both tests then explicitly select their app and don't rely on Dockerfile order.

alexbakharew pushed a commit that referenced this pull request May 22, 2026
PR #80785 added a second app under /pg_testapp to the
`clickhouse/mysql_dotnet_client` image, making /pg_testapp the
last WORKDIR. `dotnet run` (no project arg) then launched the
Npgsql client against the MySQL port, producing
"Received unknown response X for SSLRequest (expecting S or N)".

The PR was reverted (#105615) but the cached `:latest` image on
integration runners still has /pg_testapp as the last WORKDIR.
Anchor the command to /testapp so the test passes regardless of
the image's working directory, matching what test_dotnet_client
in test_postgresql_protocol/test.py already does.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
huldarchen pushed a commit to huldarchen/ClickHouse that referenced this pull request May 22, 2026
PR ClickHouse#80785 added a second app under /pg_testapp to the
`clickhouse/mysql_dotnet_client` image, making /pg_testapp the
last WORKDIR. `dotnet run` (no project arg) then launched the
Npgsql client against the MySQL port, producing
"Received unknown response X for SSLRequest (expecting S or N)".

The PR was reverted (ClickHouse#105615) but the cached `:latest` image on
integration runners still has /pg_testapp as the last WORKDIR.
Anchor the command to /testapp so the test passes regardless of
the image's working directory, matching what test_dotnet_client
in test_postgresql_protocol/test.py already does.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
DavidHe-2008 pushed a commit to DavidHe-2008/ClickHouse that referenced this pull request Jun 1, 2026
DavidHe-2008 pushed a commit to DavidHe-2008/ClickHouse that referenced this pull request Jun 1, 2026
PR ClickHouse#80785 added a second app under /pg_testapp to the
`clickhouse/mysql_dotnet_client` image, making /pg_testapp the
last WORKDIR. `dotnet run` (no project arg) then launched the
Npgsql client against the MySQL port, producing
"Received unknown response X for SSLRequest (expecting S or N)".

The PR was reverted (ClickHouse#105615) but the cached `:latest` image on
integration runners still has /pg_testapp as the last WORKDIR.
Anchor the command to /testapp so the test passes regardless of
the image's working directory, matching what test_dotnet_client
in test_postgresql_protocol/test.py already does.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
DavidHe-2008 pushed a commit to DavidHe-2008/ClickHouse that referenced this pull request Jun 1, 2026
PR ClickHouse#80785 added a second app under /pg_testapp to the
`clickhouse/mysql_dotnet_client` image, making /pg_testapp the
last WORKDIR. `dotnet run` (no project arg) then launched the
Npgsql client against the MySQL port, producing
"Received unknown response X for SSLRequest (expecting S or N)".

The PR was reverted (ClickHouse#105615) but the cached `:latest` image on
integration runners still has /pg_testapp as the last WORKDIR.
Anchor the command to /testapp so the test passes regardless of
the image's working directory, matching what test_dotnet_client
in test_postgresql_protocol/test.py already does.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Partial or Full support of extended queries for postgresql wire protocol to allow npgsql.NET to connect

5 participants