Prepare db:
create table test
(
date DateTime,
event String
) engine MergeTree() order by date;
Run go code:
func TestIssue2(t *testing.T) {
conn, _ := dbr.Open("clickhouse", "http://user:pass@localhost:8123/db", nil)
conn.Exec("truncate table test")
// 4 rows
query := `insert into test (date, event) values
('2021-01-01 00:00:00', 'click'),
('2021-01-01 01:00:00', '"" '),
('2021-01-01 02:00:00', '"with quotes" 1'),
('2021-01-01 02:00:00', '"with quotes" 2')`
conn.Exec(query)
sess := conn.NewSession(nil)
res, err := sess.Select("event").From("test").ReturnStrings()
fmt.Println(err)
fmt.Println(len(res))
// 2 rows
}
I expect that it will be 4 rows in result.
Prepare db:
Run go code:
I expect that it will be 4 rows in result.