Skip to content

ReturnStrings issue with quoted stings  #36

Description

@dizzyfool

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions