Repository navigation
Description
Description
The scheduled Upstream SQL tests workflow is red on main since 2026-12-01. The job Build the shim fails one live test of the core SQL test harness (tests/clickhouse-client), so GitHub skips the upstream SQL test jobs of both backends.
The test is LiveTest.testRenderMatchesServer on the jdbc backend, for toFixedString('ab', 4): the shim writes ab, the server writes ab\0\0. The client backend is not affected. With the build job fixed, 4 allowlisted upstream SQL tests also fail on the jdbc backend for the same cause: 02154_bit_slice_for_fixedstring, 02474_extract_fixedstring_from_json, 02981_translate_fixedstring, 04037_cast_nullable_fixedstring_too_large.
- Failed: run 46574859220 (2026-12-01, 39b4783) and run 46808949476 (2026-12-02, 27d63e9).
- Last pass: run 46352164413 (2026-11-30, 8480ca0).
Root cause. #3427 (merged 2026-11-30, for #3288) makes jdbc-v2 getString and getObject cut the trailing zero bytes of a FixedString value (ResultSetImpl.trimFixedString, jdbc-v2/src/main/java/com/clickhouse/jdbc/ResultSetImpl.java:340). This is the intended jdbc-v2 behavior (docs/features.md, "FixedString text reads"). The shim's jdbc backend reads each value with getObject (tests/clickhouse-client/src/main/java/com/clickhouse/client/cli/JdbcBackend.java:108), and TsvRenderer writes the bytes of that String for a FixedString column (TsvRenderer.java:156-164), so the zero padding that clickhouse-client prints is lost. The workflow runs on a pull request only when tests/clickhouse-client/** changes, so #3427 did not show the failure.
The fix is in the shim: write a FixedString(N) value of the jdbc backend with its zero padding, from the column type. Polyglot AI will open a fix PR for this test defect.
Steps to reproduce
- Start the pinned server:
docker run -d --name clickhouse -p 8123:8123 -e CLICKHOUSE_SKIP_USER_SETUP=1 clickhouse/clickhouse-server:26.10.4.207 - Run the step of the job:
CLICKHOUSE_CLIENT_CLI_LIVE=1 tests/clickhouse-client/scripts/build.sh - Compare one statement on both backends with the server:
Q="SELECT toFixedString('ab', 4), toNullable(toFixedString('y', 2)), toLowCardinality(toFixedString('z', 2)), [toFixedString('x', 3)]" CLICKHOUSE_CLIENT_CLI_IMPL=jdbc tests/clickhouse-client/bin/clickhouse-client --query "$Q" CLICKHOUSE_CLIENT_CLI_IMPL=client tests/clickhouse-client/bin/clickhouse-client --query "$Q" curl -s http://localhost:8123/ --data-binary "$Q"
Error Log or Exception StackTrace
[ERROR] com.clickhouse.client.cli.LiveTest.testRenderMatchesServer[jdbc, 'a\tb\\c\nd''e\0\b\f\v\x01\r', toFixedString('ab', 4), 'ünïcödé'](38)
[ERROR] LiveTest.testRenderMatchesServer:161 expected [a\tb\\c\nd\'e\0\b\f\r ab\0\0 ünïcödé
] but found [a\tb\\c\nd\'e\0\b\f\r ab ünïcödé
]
[ERROR] Tests run: 293, Failures: 1, Errors: 0, Skipped: 0
Step 3 (od -c of the output):
jdbc : a b \t y \t z \t [ ' x \ 0 \ 0 ' ] \n
client: a b \ 0 \ 0 \t y \ 0 \t z \ 0 \t [ ' x \ 0 \ 0 ' ] \n
server: a b \ 0 \ 0 \t y \ 0 \t z \ 0 \t [ ' x \ 0 \ 0 ' ] \n
02981_translate_fixedstring on the jdbc backend:
-AAA\0\0\0\0\0\0\0
+AAA
Expected Behaviour
The shim writes the server's TabSeparated text, as for the client backend: ab\0\0, y\0, z\0 (the curl output above; the server default of output_format_trim_fixed_string is 0). With only ResultSetImpl.java set back to its version before #3427, all 293 tests of the shim pass on the same server.
Code Example
// No other code: LiveTest#testRenderMatchesServer and the commands above.Configuration
Client Configuration
// The shim's jdbc backend: jdbc:clickhouse:http://localhost:8123/default, no other propertiesEnvironment
- Cloud
- Client version:
main27d63e9 (0.12.0-rc1-SNAPSHOT) - Language version: JDK 17 (CI: Temurin 17.0.21)
- OS: Ubuntu 26.04 (CI runner); Linux (local reproduction)
ClickHouse Server
- ClickHouse Server version: 26.10.4.207 (
tests/clickhouse-client/clickhouse-version) - ClickHouse Server non-default settings, if any: none
CREATE TABLEstatements for tables involved: none- Sample data for all these tables: none
Classification: impact: none · area: Docs & project (core SQL test harness)
Found by automated analysis (Polyglot AI) while working on the scheduled CI runs of main (run 46808949476). Verified against a live server.
Activity