-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clickhouse crash/data inconsistency if column and nested table have same name #36146
Comments
|
Has it ever really worked? The table definition is wrong, because for parts of So, this definition: CREATE TABLE tst
(
`id` Int,
`col` Array(String),
`col.s` Array(LowCardinality(String)),
`col.u` Array(LowCardinality(String))
)
ENGINE = ReplacingMergeTree(id)
PARTITION BY tuple()
ORDER BY id;is the same as the following, but in flattened form: CREATE TABLE tst
(
`id` Int,
`col` Array(String),
`col` Nested(s LowCardinality(String), u LowCardinality(String))
)
ENGINE = ReplacingMergeTree(id)
PARTITION BY tuple()
ORDER BY id;The last one is obviously wrong. |
|
Yes, it has never worked. I've tried 21.3, 20.3 and 19.3 and your example leads to server crash or reading of wrong data on all of the versions. Just need to check column names on table creation and forbid such ambiguous names. |
|
In our case we hade two subcolumns depth docker run --rm -it docker.io/clickhouse/clickhouse-server:21.3
docker exec -it clickhouse clickhouse-clientCREATE TABLE tst
(
`id` Int,
`col` Array(String),
`col.s.a` Array(LowCardinality(String)),
`col.s.b` Array(LowCardinality(String))
)
ENGINE = ReplacingMergeTree(id)
PARTITION BY tuple()
ORDER BY id;
INSERT INTO tst (id, col, `col.s.a`, `col.s.b`) SELECT
number,
['a', 'b', 'c', 'd'],
[number],
[number]
FROM system.numbers
LIMIT 1;
INSERT INTO tst (id, col, `col.s.a`, `col.s.b`) SELECT
number,
['a', 'b', 'c', 'd'],
[number],
[number]
FROM system.numbers
LIMIT 1000000;
SELECT *
FROM tst
LIMIT 3;
result: But in fresh version this led to crash. |
|
Does not crash in the new version: https://fiddle.clickhouse.com/35719b01-c5aa-45e3-a830-34b57fe4661f |
|
The issue is still relevant. |
|
This is fixed as a side effect of #50612. Now it's not allowed to create such tables that may have collisions in names of column streams. |
Describe what's wrong
If one create table containing column and nested table with same name unexpected thing will happened.
Does it reproduce on recent release?
Yes
How to reproduce
starting from 21.9. Reproduces on 22.3.3.44
CREATE TABLEstatements for all tables involvedExpected behavior
should not crash / should have consistent data
Error message and/or stacktrace
Additional context
This happened after upgrade from old version where those queries works fine. Behavior starts to reproduce from 21.9 (as far as I can debug it)
other issue with same roots (data currupt/ reading outside of buffer?):
The text was updated successfully, but these errors were encountered: