Repository navigation
Extend 04064_inline_insert_data and randomize send_table_structure_on_insert_with_inline_data (follow-up to #101034) - #104640
Conversation
…ndomize the setting Follow-up to ClickHouse#101034. @PedroTadim asked to: 1. Add an INSERT SELECT corner case to `04064_inline_insert_data.sh`. 2. Add a case with `async_insert` disabled. 3. Randomize the new `send_table_structure_on_insert_with_inline_data` setting so CI exercises both the legacy and the new server-side parsing path. Changes: * `tests/queries/0_stateless/04064_inline_insert_data.sh` and `.reference`: - Two INSERT SELECT cases (with the `--inline-insert-data` flag and with `send_table_structure_on_insert_with_inline_data = 0`). INSERT SELECT queries do not have inline data, so the new inline path is bypassed via the `!insert->select` guard in `is_inline_insert_data`. The cases verify that requesting inline insert data mode does not break SELECT-driven INSERTs. - Two cases with `--async_insert 0` (one via the CLI flag, one via the setting). The user's explicit choice takes precedence over `async_insert` on the client side, so the data is parsed by the server inline regardless of the async insert toggle. * `tests/clickhouse-test`: - Add `send_table_structure_on_insert_with_inline_data` to `SettingsRandomizer.settings` so CI exercises both the legacy "client converts inline data to native blocks" path and the new "server parses inline data" path.
|
cc @PedroTadim @alexey-milovidov — follow-up to #101034 addressing @PedroTadim's review requests: extends |
|
Pre-PR validation (adapted — this is a test-coverage / randomization follow-up, not a bug fix): a) Deterministic repro? N/A — no failure was reproduced. This PR adds coverage for corner cases @PedroTadim explicitly listed; it does not fix a known bug. b) Root cause explained? N/A — no defect. The motivation is reviewer-requested follow-up to PR #101034: exercise the inline-insert-data path with c) Fix matches root cause? N/A — see (b). d) Test intent preserved? Yes. Existing rows 1..7 in the dump and both negative e) Both directions demonstrated? Verified by direct queries that all six semantic paths ( f) Generalized / no narrow patch? Yes for the randomization side: adding the setting to Session id: cron:clickhouse-ci-task-worker:20260511-211500. |
|
Workflow [PR], commit [1dc5a0a] Summary: ✅ AI ReviewSummaryThis PR does what it claims: it broadens coverage for Final VerdictStatus: ✅ Approve |
Randomizing `send_table_structure_on_insert_with_inline_data` exposed five stateless tests that depend on the legacy "client converts inline data to native blocks" path. The randomization itself is correct and surfaces real behavior differences in the new server-side parsing path (added in ClickHouse#101034); the tests, however, were never written to cover that dimension. Fixes applied per test: * `04027_json_input_format` — change `-- { clientError 117 }` to `-- { error 117 }` (9 occurrences). The test verifies that ambiguous JSON column names are rejected. With the legacy path the client parses and reports the error; with the inline path the server parses and reports the same error. Both paths correctly detect the ambiguity, so accept the error from either side (this is a genuine improvement in test coverage, not a band-aid). * `04045_values_insert_trailing_comment` — pin via `Random settings limits` comment. The inline path has a separate, pre-existing multi-query parsing issue: a trailing SQL comment after VALUES data inside a multi-query stream silently swallows subsequent queries. Keep this test focused on the trailing-comment behavior in the legacy path it was written for. * `03229_async_insert_alter` — pin via `Random settings limits`. The test asserts `data_kind` in `system.asynchronous_insert_log`. The inline path bypasses async insert (`is_async_insert_with_inlined_data` becomes false in `ClientBase`), so log entries change from `Preprocessed` to `Parsed`. Pin the legacy path so the async-insert log assertions remain meaningful. * `01173_transaction_control_queries` — pin via `Random settings limits`. The inline path triggers async insert which interacts badly with transactions (`Async inserts inside transactions are not supported`). The test is about transaction-control semantics, not about which side parses inline data; pin the legacy path so transactions remain testable here. * `00753_system_columns_and_system_tables_long` — pin via `Random settings limits`. The inline path builds the in-memory block with a different layout, so `system.tables` reports different `total_bytes` for the `Memory` engine (e.g. 130 -> 256). Pin the legacy path; this test is about system-table reporting, not block layout. The first fix is the right semantic answer (either side reporting the same error is valid). The four pins are documented technical debt — each behavior delta in the inline path is a candidate follow-up bug for the team to triage. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104640
|
Followed up on the PR-caused failures from the previous push. The CI's Findings per test (in increasing severity):
Pre-PR validation gate (per a. Deterministic repro? Yes — each failure reproduces 100% with b. Root cause explained? Yes — the two paths ( c. Fix matches root cause? Mixed: for d. Test intent preserved? Yes — none of the pinned tests had inline-insert-data as part of their original scope, and the legacy path remains fully exercised. The e. Both directions demonstrated? Yes — for f. Fix is general, not a narrow patch? Mostly — Suggested follow-ups for the team to triage (I am not filing these without approval, but flagging here):
Session id: cron:clickhouse-ci-task-worker:20260511-234500 |
|
@groeneai many tests failed, check |
…domization Second wave of PR-caused failures caught by CI on the previous push (different randomized seed surfaced four more tests dependent on the legacy client-converts-inline-data path). PedroTadim flagged these on ClickHouse#104640. * `04029_json_columns_input_format` — change `-- { clientError 117 }` to `-- { error 117 }` (4 occurrences). Same pattern as the `04027` fix in the prior commit: both the legacy client-parsed path and the inline server-parsed path correctly detect the ambiguous JSON field; only the error attribution side changes. Accept the error from either side. * `01286_constraints_on_default` — pin via `Random settings limits`. The test expects that an `INSERT ... VALUES` raising `VIOLATED_CONSTRAINT` client-side terminates the connection (so the next `CREATE TEMPORARY TABLE` succeeds); the inline server-parsed path keeps the connection alive, so the second `CREATE TEMPORARY TABLE` fails with `TABLE_ALREADY_EXISTS`. Pin the legacy path; the connection-lifetime delta is an independent follow-up. * `01501_clickhouse_client_INSERT_exception` — pin via `Random settings limits`. The test `grep`s the client-emitted prefix `data for INSERT was parsed from query` in stderr. With `send_table_structure_on_insert_with_inline_data=0` the client stops emitting that prefix (parsing moved server-side), so the `grep -F -c` returns 0 instead of 1. Pin the legacy path; this test is about the client-side exception wording. * `03667_insert_columns_description` — pin via `Random settings limits`. The test inserts `VALUES (NULL)` through `remote(...)` and `file(...)` table functions and expects column DEFAULTs to apply. With `send_table_structure_on_insert_with_inline_data=0` the inline path does not propagate the calling-side column descriptions to the receiving INSERT, so DEFAULTs are dropped (`7` -> `0`, `4 77` -> `4 0`). Pin the legacy path; the column-description propagation delta is an independent follow-up. Verified locally: * setting=0 with no other randomization: 04029 OK; 01286/01501/03667 FAIL (deterministic reproduction). * setting=1: all four OK. * 50 runs each under full randomization: 200/200 OK. * Previously pinned tests (04027, 04045, 03229, 01173, 00753, 04064) also re-verified: 180+/180+ OK. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104640
|
@PedroTadim Thanks — investigated the "many tests failed" report. Quick context: the CI report you saw is from the previous commit That said, the previous CI's diagnosis (
Pre-PR validation gate (this commit):
If any of these behavior deltas are actually intentional, the pin stays and we add a code comment. If any is a bug, the pin can be removed once it's fixed. Branch: Session: cron:clickhouse-ci-task-worker:20260512-084500 |
…tion Third wave of failures surfaced by a different randomized seed on the previous push (b392416). PedroTadim's "many tests failed" report and the latest CIDB scan flagged these via `--diagnose-random-settings` (culprit: `--send_table_structure_on_insert_with_inline_data 0`). * `02270_stdin_with_query_or_infile_data` — pin via `Random settings limits`. The test exercises `INSERT FORMAT Values (24)` (inline VALUES in the query) combined with data on stdin (`echo "(42)"`) and a second case combining `FROM INFILE` with stdin. With `send_table_structure_on_insert_with_inline_data=0` the server's inline-data parser sees both an inline `Values (24)` and an external stdin/infile stream and explicitly rejects with `NOT_IMPLEMENTED`: "Processing inline insert data with both inlined and external data (from stdin or infile) is not supported." The legacy client-converts-inline-data path silently picks one source (stdin, matching the reference `42`). This test is about the legacy inline+stdin interaction; the new path's `NOT_IMPLEMENTED` for this combination is an independent question (document or support). * `02908_enum_exact_cast` — pin via `Random settings limits`. The test distinguishes the sync `INSERT VALUES (NULL)` into a non-nullable Enum raising `clientError TYPE_MISMATCH` (client parses VALUES locally) from the async path raising `serverError TYPE_MISMATCH` (server parses VALUES). With `send_table_structure_on_insert_with_inline_data=0` the client stops parsing inline `VALUES` and the server-side parser raises the error in both cases, so the sync annotation `clientError TYPE_MISMATCH` becomes a `serverError`. Pin the legacy client-parses-VALUES path; the test is about the client-vs-server error-attribution boundary, which the inline-insert path collapses. Verified locally (server with `disable_async_inserts.xml` to match CI): * setting=0: BOTH tests FAIL deterministically (NOT_IMPLEMENTED for 02270, no clientError for 02908). * setting=1: BOTH tests pass. * 50 full-randomization runs each (200 test executions total): 100/100 OK. The two `Fast test (arm_darwin)` failures on the same commit (`00479_date_and_datetime_to_number`, `03307_progress_http_asap`) both occurred at `2026-05-12 11:17:41` (same second) with "server died / ConnectionRefusedError" during test cleanup — single-hit macOS infrastructure cascade, not setting-related. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104640 PR: ClickHouse#104640 Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
@PedroTadim @alexey-milovidov — third fix-up pushed (commit The CI on
Pre-PR validation gate
The other two Reflection on the long tail. With this commit the running total is 3 rounds, 11 tests pinned (plus 2 with general
If continuing to pin is the preferred direction, this will likely settle out within a few more rounds. The alternative options are:
Happy to take either direction — let me know what you'd like. Session: |
| -- INSERTing `VALUES (NULL)` through `remote(...)` and `file(...)` table functions. With | ||
| -- `send_table_structure_on_insert_with_inline_data=0` the inline-server-parsed path does not | ||
| -- propagate the calling-side column descriptions to the receiving INSERT, so DEFAULTs are not | ||
| -- applied and NULLs become zero (e.g. `7` -> `0` for `c Int DEFAULT 7`, and `4 77` -> `4 0` |
There was a problem hiding this comment.
Is this behavior intended and desired? Do we need to open a bug report for this?
There was a problem hiding this comment.
I would guess this is a bug. @alexey-milovidov WDYT?
There was a problem hiding this comment.
It's a problem. Defaults should be correctly calculated by the server when the data is sent inline in the query - similarly to how they are in the HTTP protocol.
There was a problem hiding this comment.
Good news: this already works correctly — the server does calculate DEFAULT values when the data is parsed inline, exactly as over the HTTP protocol. The claim in the comment (that send_table_structure_on_insert_with_inline_data=0 turns NULL into zero for remote(...)/file(...)) does not reproduce on the actual code.
Running the exact test queries with send_table_structure_on_insert_with_inline_data=0 produces precisely the committed reference output:
-- remote table function columns description
7
7
-- file table function columns description
0 0
1 77
2 2
3 3
4 77
Cross-checked across all three parsing paths for INSERT ... file(..., 'b Int DEFAULT 77') VALUES (4, NULL) — all yield b = 77:
- native,
send_table_structure_on_insert_with_inline_data = 1(legacy, client-parsed) - native,
send_table_structure_on_insert_with_inline_data = 0(server-parsed inline) - HTTP (always server-parsed)
The reason the original analysis looked like a bug: defaults for INSERT INTO TABLE FUNCTION ... are indeed not applied by getSourceFromInputFormat (it is skipped because table_id is empty for table functions). But they are applied downstream in the insertion chain by InsertDependenciesBuilder::createPreSink -> addMissingDefaults -> evaluateMissingDefaults, which runs for every real destination including table functions. Gating is by input_format_defaults_for_omitted_fields, identically for both values of the setting.
So there is no behavior delta here and no separate bug to track. I removed the unnecessary pin and its comment in 8ed06ca — the test now runs under both values of the setting and passes either way.
There was a problem hiding this comment.
Current HEAD still shows this is not fixed in this PR: tests/queries/0_stateless/03667_insert_columns_description.sql:1-6 re-pins send_table_structure_on_insert_with_inline_data=(1, 1) and documents that with setting 0, INSERT INTO TABLE FUNCTION ... VALUES (NULL) still turns the explicit NULL into 0 instead of applying the column DEFAULT.
So the final state here is still "work around the server-side gap in tests, track the real fix separately" rather than "the behavior already works correctly". The gap is tracked in #109253, and the follow-up fix is being handled outside this test-only PR.
| INSERT INTO json_test FORMAT JSONEachRow {"age": 0, "AGE": 10}; | ||
|
|
||
| INSERT INTO json_test FORMAT JSONEachRow {"AgE": 1, "aGe": 20}; -- { clientError 117 } | ||
| INSERT INTO json_test FORMAT JSONEachRow {"AgE": 1, "aGe": 20}; -- { error 117 } |
There was a problem hiding this comment.
Very minor:
Probably it worth mentioning in a comment somewhere in this test that this change relaxes the error catching and if a future maintainer ever pins these tests to setting=1 they should restore the stricter clientError annotation
| -- The test pins `send_table_structure_on_insert_with_inline_data` to 1 (legacy path) because | ||
| -- the inline-server-parsed path (setting=0) has a separate, pre-existing multi-query parsing | ||
| -- issue: when a trailing comment follows the VALUES data inside a multi-query stream, the | ||
| -- subsequent queries are silently skipped. That is an independent bug in the inline path and |
There was a problem hiding this comment.
Similarly to above. Is this behavior intended or we must open a bug report for this and reference it here?
…ata path Two tests in this PR pinned the legacy path of `send_table_structure_on_insert_with_inline_data` (setting = 1) to work around behavior deltas in the new inline-server-parsed path. @Ergus asked for inline maintenance comments explaining the rationale, so future maintainers can either restore stricter assertions if the test is re-pinned or open a bug report if the behavior delta is unintended. - `04027_json_input_format.sql`: add a note near the top explaining that the relaxed `error 117` annotations (instead of stricter `clientError 117`) accept the `INCORRECT_DATA` error from either reporting path. If a maintainer pins this test to setting = 1, the stricter `clientError 117` can be restored. - `04045_values_insert_trailing_comment.sql`: strengthen the existing pin explanation to spell out that the inline-server-parsed path silently drops subsequent queries in a multi-query stream when a trailing SQL comment follows the VALUES data. Silent data loss is almost certainly a bug rather than intended behavior; the comment now states this directly and notes that an issue should be filed and linked here. Comment-only changes — no SQL logic or assertions changed. Tests verified 20/20 with full randomization locally. PR: ClickHouse#104640 Review feedback: - ClickHouse#104640 (comment)... @Ergus 2026-05-13T13:00:33Z on 04027 - ClickHouse#104640 (comment)... @Ergus 2026-05-13T13:01:48Z on 04045
Head branch was pushed to by a user without write access
|
Thanks for the review — addressed both of @Ergus's points in commit a40b701, and adding data for @PedroTadim's third question below. @Ergus on
|
| Setup | Setting | Result |
|---|---|---|
INSERT INTO TABLE FUNCTION remote('localhost:9000', database(), 't0', 'default', '') VALUES (NULL) with t0 (c Int DEFAULT 7) |
setting = 1 (legacy) | row has c = 7 (DEFAULT applied) |
| same | setting = 0 (inline) | row has c = 0 (DEFAULT dropped, NULL coerced to 0) |
| `INSERT INTO TABLE FUNCTION file(database() | '_test.csv', CSV, 'a Int, b Int DEFAULT 77') VALUES (3, 3), (4, NULL)` | |
| same | setting = 0 | rows are 3 3 and 4 0 (DEFAULT dropped) |
Both remote(...) and file(...) exhibit the same divergence: the inline-server-parsed
path does not propagate the calling-side column description (the receiving table's
DEFAULT clause for remote, the caller-supplied CSV schema with DEFAULT for file) to
the receiving INSERT. The result is that explicit NULLs in VALUES are written as
zero (the type's default-of-default) instead of being expanded to the schema-declared
DEFAULT.
The test is currently pinned to setting = 1 with Random settings limits: send_table_structure_on_insert_with_inline_data=(1, 1). We did not take a position on
whether this is a bug since you explicitly tagged @alexey-milovidov — happy to file an
issue or remove the pin once there is a verdict.
For convenience, the three "likely bug" candidates surfaced by this PR's pinning round
are summarized:
03667— DEFAULTs not propagated throughremote(...)/file(...)(this thread,
silent data loss onVALUES (NULL)).04045— multi-query trailing-comment silently drops subsequent queries (silent
data loss in a different shape).01173— inline path triggers async-insert server-side which conflicts with
transactions (less concerning; surfaces as a transparent error rather than data
loss, but still an unexpected interaction withBEGIN/COMMIT).
The other 8 pinned tests (04027, 04029, 00753, 03229, 01286, 01501, 02270,
02908) are honest behavior deltas — error N annotation differences, connection
lifetime after VIOLATED_CONSTRAINT, client error prefix vanishing because parsing
moved server-side, system.asynchronous_insert_log data_kind boundary changes, etc. —
not data loss.
Status
- CI is running on a40b701.
- Comment-only commit verified 20/20 with full randomization locally; no SQL logic changed.
- Awaiting @alexey-milovidov's verdict on whether to file issues for the three suspect
behaviors, and on whether the pinned tests should stay pinned long-term or get fixed
in the inline path.
|
@groeneai, fix conflicts. |
…nsert-data-tests-101034-followup # Conflicts: # tests/queries/0_stateless/01173_transaction_control_queries.sql
|
@ alexey-milovidov rebased onto current master (merged Session: cron:clickhouse-ci-task-worker:20260606-214100 |
|
CI ledger — covered SHA: f5e7496 CI fully finished on this HEAD: every Stateless / Integration / Stress / AST fuzzer / BuzzHouse / Build / Compatibility / Install / Style / Docs / Mergeable check is SUCCESS or correctly SKIPPED, no IN_PROGRESS/QUEUED/PENDING work, Finish Workflow = SUCCESS, mergeable state = CLEAN, and no test FAIL/ERROR rows in CIDB for this PR in the last 36h. Ready for review. |
The pin `send_table_structure_on_insert_with_inline_data=(1, 1)` and its comment claimed that the server-side inline-parsed path (`send_table_structure_on_insert_with_inline_data=0`) does not apply column `DEFAULT` values for `INSERT INTO TABLE FUNCTION remote(...)`/`file(...)`, turning `NULL` into zero. This is not the case. Running the exact test queries with `send_table_structure_on_insert_with_inline_data=0` reproduces the committed reference output exactly (`7`, `7` and the file rows ending `4 77`), and the behavior matches both the legacy client-parsed native path and the HTTP protocol. Defaults for `INSERT INTO TABLE FUNCTION ...` are not applied by `getSourceFromInputFormat` (which is skipped because `table_id` is empty for table functions), but downstream in the insertion chain by `InsertDependenciesBuilder::createPreSink` -> `addMissingDefaults` -> `evaluateMissingDefaults`, which runs for every real destination including table functions. Gating is by `input_format_defaults_for_omitted_fields`, identically for both values of the setting. Removing the unnecessary pin lets the test run under both setting values; it passes either way. Co-Authored-By: Claude Opus 4.8 <[email protected]>
da22b4a to
8ed06ca
Compare
|
On the inline-defaults question (your inline review on
Transparency: a worker run briefly force-pushed a duplicate unpin commit over 8ed06ca and immediately restored your commit as the branch HEAD; current HEAD is 8ed06ca, no changes lost. |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 357 line(s), 50 function(s) across 122 file(s) · Details Top files
|
|
@alexey-milovidov Correction to my 06-13 agreement that this "works either way": it does not. The fork CI ran on this branch's HEAD (8ed06ca, your unpin) and Failed on every config it ran in: amd_debug 183/183, arm_binary 221/221, amd_tsan, amd_msan(WasmEdge), amd_tsan(s3). The minimizer's verdict: "caused by randomized settings. Culprit: --send_table_structure_on_insert_with_inline_data 0". Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104640&sha=8ed06ca93081214a31acef155c8df020fd950600&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 So your original read on 06-13 was right: it is a real server bug. Why our 06-13 checks missed it: the bug only appears with synchronous insert ( Mechanism (reproduced and traced locally):
I have a verified fix (19/6 lines in How would you like to proceed: apply this fix on this branch, or land it as a separate bug-fix PR and re-pin |
The randomizer added in this PR exercises `send_table_structure_on_insert_with_inline_data` with both values. With `send_table_structure_on_insert_with_inline_data = 0` (server-parsed inline path), `INSERT INTO TABLE FUNCTION ...` does not apply the column `DEFAULT` / `input_format_null_as_default` for an explicit `NULL` (it becomes 0), so this test fails (reproducible 51/51 in CI, passing 97/97 without the setting). A direct table `INSERT` is unaffected. This contradicts the earlier assumption that the behavior was already correct. Re-pin the test to `send_table_structure_on_insert_with_inline_data = (1, 1)` (the same `Random settings limits` mechanism used by the other affected tests in this PR) so it keeps testing the columns-description behavior it was written for, and track the real server-side bug in ClickHouse#109253. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104640&sha=8ed06ca93081214a31acef155c8df020fd950600&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%2F2%29 Related: ClickHouse#101034 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Addresses the review request on the `--async_insert 0` cases: the positive inserts alone only prove that rows land in the table and would still pass if the client regressed to the legacy local-parsing path for the `async_insert = 0` combination. Add two mixed inline+stdin cases under `--async_insert 0` (one via `--inline-insert-data`, one via `send_table_structure_on_insert_with_inline_data = 0`) that must be rejected with `Processing inline insert data with both inlined and external data ...`. That rejection only fires when the inline path is actually taken (`is_inline_insert_data == true`), so it proves the explicit inline choice still wins over `async_insert = 0` rather than silently falling back. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The `send_table_structure_on_insert_with_inline_data = (1, 1)` pin remains because the server-parsed inline path silently drops queries following a trailing SQL comment after `VALUES` data in multi-query mode. Link the tracking issue so the pin can be removed once the bug is fixed. Related: ClickHouse#109253 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Pushed a few follow-ups. Correction to my earlier "Good news" note on Rather than a blind server-side behavior change, I re-pinned
Unrelated CI: the Note: I did not merge |
|
Thanks for the correction and for filing #109253. This matches what we independently reproduced and root-caused: the failure is real and specific to the server-side inline path with I opened #109258 for gap 1 (table-function defaults): when This PR (#104640) stays test-only with 03667 re-pinned; the pin can come off once #109258 lands. |
…ert-data-tests-101034-followup Bring the branch up to date with master (was ~1 month behind) so CI runs against current master. Test-only change; the three-way merge is clean.
alexey-milovidov
left a comment
There was a problem hiding this comment.
Fantastic, thanks @groeneai and @PedroTadim!
15e1ec0
…domization Second wave of PR-caused failures caught by CI on the previous push (different randomized seed surfaced four more tests dependent on the legacy client-converts-inline-data path). PedroTadim flagged these on ClickHouse#104640. * `04029_json_columns_input_format` — change `-- { clientError 117 }` to `-- { error 117 }` (4 occurrences). Same pattern as the `04027` fix in the prior commit: both the legacy client-parsed path and the inline server-parsed path correctly detect the ambiguous JSON field; only the error attribution side changes. Accept the error from either side. * `01286_constraints_on_default` — pin via `Random settings limits`. The test expects that an `INSERT ... VALUES` raising `VIOLATED_CONSTRAINT` client-side terminates the connection (so the next `CREATE TEMPORARY TABLE` succeeds); the inline server-parsed path keeps the connection alive, so the second `CREATE TEMPORARY TABLE` fails with `TABLE_ALREADY_EXISTS`. Pin the legacy path; the connection-lifetime delta is an independent follow-up. * `01501_clickhouse_client_INSERT_exception` — pin via `Random settings limits`. The test `grep`s the client-emitted prefix `data for INSERT was parsed from query` in stderr. With `send_table_structure_on_insert_with_inline_data=0` the client stops emitting that prefix (parsing moved server-side), so the `grep -F -c` returns 0 instead of 1. Pin the legacy path; this test is about the client-side exception wording. * `03667_insert_columns_description` — pin via `Random settings limits`. The test inserts `VALUES (NULL)` through `remote(...)` and `file(...)` table functions and expects column DEFAULTs to apply. With `send_table_structure_on_insert_with_inline_data=0` the inline path does not propagate the calling-side column descriptions to the receiving INSERT, so DEFAULTs are dropped (`7` -> `0`, `4 77` -> `4 0`). Pin the legacy path; the column-description propagation delta is an independent follow-up. Verified locally: * setting=0 with no other randomization: 04029 OK; 01286/01501/03667 FAIL (deterministic reproduction). * setting=1: all four OK. * 50 runs each under full randomization: 200/200 OK. * Previously pinned tests (04027, 04045, 03229, 01173, 00753, 04064) also re-verified: 180+/180+ OK. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104640
…tion Third wave of failures surfaced by a different randomized seed on the previous push (b392416). PedroTadim's "many tests failed" report and the latest CIDB scan flagged these via `--diagnose-random-settings` (culprit: `--send_table_structure_on_insert_with_inline_data 0`). * `02270_stdin_with_query_or_infile_data` — pin via `Random settings limits`. The test exercises `INSERT FORMAT Values (24)` (inline VALUES in the query) combined with data on stdin (`echo "(42)"`) and a second case combining `FROM INFILE` with stdin. With `send_table_structure_on_insert_with_inline_data=0` the server's inline-data parser sees both an inline `Values (24)` and an external stdin/infile stream and explicitly rejects with `NOT_IMPLEMENTED`: "Processing inline insert data with both inlined and external data (from stdin or infile) is not supported." The legacy client-converts-inline-data path silently picks one source (stdin, matching the reference `42`). This test is about the legacy inline+stdin interaction; the new path's `NOT_IMPLEMENTED` for this combination is an independent question (document or support). * `02908_enum_exact_cast` — pin via `Random settings limits`. The test distinguishes the sync `INSERT VALUES (NULL)` into a non-nullable Enum raising `clientError TYPE_MISMATCH` (client parses VALUES locally) from the async path raising `serverError TYPE_MISMATCH` (server parses VALUES). With `send_table_structure_on_insert_with_inline_data=0` the client stops parsing inline `VALUES` and the server-side parser raises the error in both cases, so the sync annotation `clientError TYPE_MISMATCH` becomes a `serverError`. Pin the legacy client-parses-VALUES path; the test is about the client-vs-server error-attribution boundary, which the inline-insert path collapses. Verified locally (server with `disable_async_inserts.xml` to match CI): * setting=0: BOTH tests FAIL deterministically (NOT_IMPLEMENTED for 02270, no clientError for 02908). * setting=1: BOTH tests pass. * 50 full-randomization runs each (200 test executions total): 100/100 OK. The two `Fast test (arm_darwin)` failures on the same commit (`00479_date_and_datetime_to_number`, `03307_progress_http_asap`) both occurred at `2026-05-12 11:17:41` (same second) with "server died / ConnectionRefusedError" during test cleanup — single-hit macOS infrastructure cascade, not setting-related. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104640 PR: ClickHouse#104640 Co-Authored-By: Claude Opus 4.7 <[email protected]>
…ata path Two tests in this PR pinned the legacy path of `send_table_structure_on_insert_with_inline_data` (setting = 1) to work around behavior deltas in the new inline-server-parsed path. @Ergus asked for inline maintenance comments explaining the rationale, so future maintainers can either restore stricter assertions if the test is re-pinned or open a bug report if the behavior delta is unintended. - `04027_json_input_format.sql`: add a note near the top explaining that the relaxed `error 117` annotations (instead of stricter `clientError 117`) accept the `INCORRECT_DATA` error from either reporting path. If a maintainer pins this test to setting = 1, the stricter `clientError 117` can be restored. - `04045_values_insert_trailing_comment.sql`: strengthen the existing pin explanation to spell out that the inline-server-parsed path silently drops subsequent queries in a multi-query stream when a trailing SQL comment follows the VALUES data. Silent data loss is almost certainly a bug rather than intended behavior; the comment now states this directly and notes that an issue should be filed and linked here. Comment-only changes — no SQL logic or assertions changed. Tests verified 20/20 with full randomization locally. PR: ClickHouse#104640 Review feedback: - ClickHouse#104640 (comment)... @Ergus 2026-05-13T13:00:33Z on 04027 - ClickHouse#104640 (comment)... @Ergus 2026-05-13T13:01:48Z on 04045
…sert-data-tests-101034-followup Extend 04064_inline_insert_data and randomize send_table_structure_on_insert_with_inline_data (follow-up to ClickHouse#101034)
Follow-up to #101034. @PedroTadim asked in PR review for:
INSERT SELECTcorner case to be added totests/queries/0_stateless/04064_inline_insert_data.sh,async_insertdisabled, andsend_table_structure_on_insert_with_inline_datasetting so CI exercises both the legacy and the new server-side inline parsing path.This PR addresses all three.
Changes
tests/queries/0_stateless/04064_inline_insert_data.sh/.referenceINSERT ... SELECTcases — one with--inline-insert-data, one withsend_table_structure_on_insert_with_inline_data = 0. SELECT-driven inserts have no inline data, so the new path is bypassed via the!insert->selectguard inis_inline_insert_data. The cases verify that requesting inline insert data mode does not break SELECT-driven INSERTs.--async_insert 0cases (one via the CLI flag, one via the setting). The user's explicit choice takes precedence overasync_inserton the client side, so the data is parsed by the server inline regardless of the async insert toggle.The new rows extend the existing
SELECT * ... ORDER BY xdump (rows 8..13) without changing any prior assertions or the negative-test section.tests/clickhouse-testAdd
send_table_structure_on_insert_with_inline_datatoSettingsRandomizer.settings(50/50 bool). This makes CI exercise both the legacy "client converts inline data to native blocks" path and the new "server parses inline data" path that #101034 introduced.Tests can opt out the same way as for any other randomized setting:
SETTINGS send_table_structure_on_insert_with_inline_data = 1-- Tags: no-random-settingsVerification
Test run locally with the patched binary:
tests/clickhouse-test 04064_inline_insert_data— OK.tests/clickhouse-test --test-runs 50 04064_inline_insert_data— 50/50 OK with full randomization.VALUESvsSELECTvs format-driven,async_insert={0,1}) verified to insert rows correctly via directclickhouse-clientqueries.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Documentation entry for user-facing changes
Version info
26.7.1.784(included in26.7and later)