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
bug: with clickhouse tcp mode, insert a timestamp type value with ns the ck client will hang #6951
Comments
I try to insert with select , it can be successed. databend :) insert into t select 10, to_datetime('2022-02-01 00:00:01.123');
INSERT INTO t SELECT
10,
to_datetime('2022-02-01 00:00:01.123')
Query id: 611c7996-bc17-4e8c-bf87-a9f377055d33
Ok.
0 rows in set. Elapsed: 0.038 sec.
databend :) select * from t where id=10;
SELECT *
FROM t
WHERE id = 10
Query id: df020b78-a810-47ce-94b8-351cadb52362
┌─id─┬───────────────────a─┐
│ 10 │ 2022-02-01 00:00:01 │
└────┴─────────────────────┘
┌─id─┬───────────────────a─┐
│ 10 │ 2022-02-01 00:00:01 │
└────┴─────────────────────┘
2 rows in set. Elapsed: 0.055 sec.
|
Reproduced on current main branch feee0dc SQL I executed: -- for databend
select version();
show tables; -- I've created table t with create table t(id int, n datetime);
insert into t values(1, '2022-02-02 00:01:02.123'); -- client hang here
-- if you wait long enough the client will raise a SOCKET_TIMEOUT error
-- for clickhouse
select version();
show tables; -- nothing
create table t(id int, n datetime) ENGINE=Memory; -- create successful
insert into t values(1, '2022-02-02 00:01:02.123'); -- clickhouse complain about exception on client TCP stream tracing by Wireshark:
From the picture, there is one more segment from the server at last, in the ClickHouse-ClickHouse scene. After sending byte string "\2 id \5 Int32 \8 DateTime", the ClickHouse server sent "\5" and "\4", while the Databend ClickHouse handler sent "\4" only. The version of DataBend:
The version of ClickHouse server:
The version of ClickHouse client:
|
The real problem seems larger than this issue described. When executing malformed insert into t values (1, '2020'); -- insert string
insert into t values (1); -- insert int only
-- and even incomplete SQLs
-- unclosed bracket
insert into t values (1
-- missing the corresponding comma
insert into t values (1, '2020); will hang the ClickHouse client. Since these hangings all come with nothing (equal or above |
DateTime/Timestamp is mapping to ClickHouse 's DateTime.
|
ClickHouse client version 21.12.1.1. This version could throw errors.
|
Search before asking
Version
854fc4d
What's Wrong?
with clickhouse tcp mode, insert a timestamp type value with ns the ck client will hang
How to Reproduce?
run databend-query
use clickhouse-client connect the server:
mysql
andhttp
andclickhouse http
is ok.So I think the hang is the ck client hang with some reason.
Because the datetime type in clickhouse just support second precision
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: