Skip to content

Commit b392416

Browse files
committed
Fix four more PR-caused test failures from the inline-insert-data randomization
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 #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
1 parent 7aa9364 commit b392416

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

‎tests/queries/0_stateless/01286_constraints_on_default.sql‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
-- Tags: no-async-insert
22
-- - no-async-insert -- due to INSERT is performed in background the connection is preserved, and last CREATE TEMPORARY TABLE will fail with TABLE_ALREADY_EXISTS
3+
-- Random settings limits: send_table_structure_on_insert_with_inline_data=(1, 1)
4+
-- This test relies on the legacy "client converts inline data" path: when an `INSERT ... VALUES`
5+
-- raises `VIOLATED_CONSTRAINT` client-side, the connection is terminated, which the test depends
6+
-- on to drop the `TEMPORARY` table before the next `CREATE TEMPORARY TABLE` (see the comment on
7+
-- line ~31). The inline-server-parsed path (`send_table_structure_on_insert_with_inline_data=0`)
8+
-- raises the same `VIOLATED_CONSTRAINT` but keeps the connection alive, so the second
9+
-- `CREATE TEMPORARY TABLE` fails with `TABLE_ALREADY_EXISTS`. Pin the legacy path here; this is
10+
-- a separate connection-lifetime behavior delta in the inline path and should be tracked
11+
-- independently.
312

413
DROP TABLE IF EXISTS default_constraints;
514
CREATE TABLE default_constraints

‎tests/queries/0_stateless/01501_clickhouse_client_INSERT_exception.sh‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/usr/bin/env bash
22
# Tags: no-fasttest
3+
# Random settings limits: send_table_structure_on_insert_with_inline_data=(1, 1)
4+
# This test checks for the specific client-side error message
5+
# "data for INSERT was parsed from query" produced when `clickhouse-client` parses inline
6+
# `INSERT FORMAT TSV` data and also receives data on stdin. With
7+
# `send_table_structure_on_insert_with_inline_data=0` the client stops emitting that prefix
8+
# (the parsing moves server-side), so the `grep -F -c` checks in this test return 0 instead of
9+
# 1. Pin the legacy path; this test is about the client-side exception wording, not about which
10+
# side parses inline data.
311

412
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
513
# shellcheck source=../shell_config.sh

‎tests/queries/0_stateless/03667_insert_columns_description.sql‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
-- Random settings limits: send_table_structure_on_insert_with_inline_data=(1, 1)
2+
-- This test asserts that column DEFAULT values from a table's schema are applied when
3+
-- INSERTing `VALUES (NULL)` through `remote(...)` and `file(...)` table functions. With
4+
-- `send_table_structure_on_insert_with_inline_data=0` the inline-server-parsed path does not
5+
-- propagate the calling-side column descriptions to the receiving INSERT, so DEFAULTs are not
6+
-- applied and NULLs become zero (e.g. `7` -> `0` for `c Int DEFAULT 7`, and `4 77` -> `4 0`
7+
-- for the file case). Pin the legacy path; this is a separate column-description propagation
8+
-- delta in the inline path and should be tracked independently.
9+
110
SELECT '-- remote table function columns description';
211
CREATE TABLE t0 (c Int DEFAULT 7) ENGINE = MergeTree() ORDER BY tuple();
312

‎tests/queries/0_stateless/04029_json_columns_input_format.sql‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ INSERT INTO test FORMAT JSONColumns {
3030
"ID": [10, 20, 30],
3131
"NAME": ["a", "b", "c"],
3232
"NaMe": ["yy", "zz", "xx"]
33-
} -- { clientError 117 }
33+
} -- { error 117 }
3434

3535
SELECT * FROM test;
3636

@@ -83,7 +83,7 @@ INSERT INTO test FORMAT JSONColumns {
8383
"ID": [10, 20, 30],
8484
"NAME": ["a", "b", "c"],
8585
"NaMe": ["yy", "zz", "xx"]
86-
}; -- { clientError 117 }
86+
}; -- { error 117 }
8787

8888
SELECT * FROM test;
8989

@@ -99,7 +99,7 @@ SET input_format_column_name_matching_mode='auto';
9999
INSERT INTO test FORMAT JSONColumns {
100100
"id": [0, 1, 2],
101101
"ID": [10, 20, 30]
102-
} -- { clientError 117 }
102+
} -- { error 117 }
103103

104104
SELECT * FROM test;
105105

@@ -110,7 +110,7 @@ CREATE TABLE json_test (id Int);
110110

111111
SET input_format_column_name_matching_mode='ignore_case';
112112

113-
INSERT INTO json_test FORMAT JSONColumns {"ID": [444], "id": [123]} -- { clientError 117 }
113+
INSERT INTO json_test FORMAT JSONColumns {"ID": [444], "id": [123]} -- { error 117 }
114114

115115
SELECT * FROM json_test;
116116

0 commit comments

Comments
 (0)