Skip to content
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

ReturnStrings issue with quoted stings #36

Open
dizzyfool opened this issue Mar 30, 2021 · 0 comments
Open

ReturnStrings issue with quoted stings #36

dizzyfool opened this issue Mar 30, 2021 · 0 comments

Comments

@dizzyfool
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant