Open joneechua opened 1 month ago
Hello @joneechua
Please provide all details
Hello @joneechua
Please provide all details
i read the clickhouse result by the go code above,get the unexpected result
2024/05/28 17:17:18 1 time.Time DateTime64(8, 'Asia/Shanghai') 1677-09-21 08:18:27.29044838 -> -9223372036
but i read this record from clickhouse client
:) select * from t2 where id=1;
SELECT *
FROM t2
WHERE id = 1
Query id: e2a696c9-5911-4061-ba0d-ca63d561457c
Connecting to database test at ***as user root.
Connected to ClickHouse server version 23.8.9.
ClickHouse server version is older than ClickHouse client. It may indicate that the server is out of date and can be upgraded.
┌─id─┬───────────────────────────dt─┐
1. │ 1 │ 2262-04-12 07:47:18.00000000 │
└────┴──────────────────────────────┘
1 row in set. Elapsed: 0.002 sec.
Hello @joneechua Please provide all details
i read the clickhouse result by the go code above,get the unexpected result
2024/05/28 17:17:18 1 time.Time DateTime64(8, 'Asia/Shanghai') 1677-09-21 08:18:27.29044838 -> -9223372036
but i read this record from clickhouse client
:) select * from t2 where id=1; SELECT * FROM t2 WHERE id = 1 Query id: e2a696c9-5911-4061-ba0d-ca63d561457c Connecting to database test at ***:3395 as user root. Connected to ClickHouse server version 23.8.9. ClickHouse server version is older than ClickHouse client. It may indicate that the server is out of date and can be upgraded. ┌─id─┬───────────────────────────dt─┐ 1. │ 1 │ 2262-04-12 07:47:18.00000000 │ └────┴──────────────────────────────┘ 1 row in set. Elapsed: 0.002 sec.
how can i get the correct string result by go driver? thx.
@joneechua please have a look into a "Details" section of issue content. Please provide a driver version and other missing values. Thank you.
@joneechua please have a look into a "Details" section of issue content. Please provide a driver version and other missing values. Thank you.
sorry about that, I've revised this section.
Observed
CREATE TABLE t2 (
idUInt8,
dtDateTime64(8, 'Asia/Shanghai') ) ENGINE = MergeTree ORDER BY id SETTINGS index_granularity = 8192
insert into t2 values(1,'2262-04-12 07:47:18'),(2,'2262-04-12 07:47:16.854750000')
rows.Scan(var interface{}...) b, _ := val.(time.Time) log.Println(b.Format("2006-01-02 15:04:05.00000000"), b.Unix())
Expected behaviour
get Expected Result
1, 2262-04-12 07:47:18.00000000 2, 2262-04-12 07:47:16.85475000
Code example
Error log
get the Unexpected results, and it appears that an overflow value is returned by time.Time.Unix()
Details
Environment
clickhouse-go
version: v2.24.0database/sql
compatible driverCREATE TABLE
statements for tables involved: See No. 1 above