Skip to content

Question mark in comment section recognized as query param #1537

Open
@nsbrokeboy

Description

@nsbrokeboy

Hello, I found issue #1489 and it may be similar, but i think my problem need different fix.
driver: clickhouse-go/v2 v2.30.0

Problem: question mark in comment section recognized as query param.

Example

func main() {
	conn, err := clickhouse.Open(&clickhouse.Options{Addr: []string{"localhost:9001"}})
	if err != nil {
		panic(err)
	}

	row := conn.QueryRow(context.TODO(), "select $1 --some comment with ?", "clickhouse")
	fmt.Println(row.Err())
}

Output:

clickhouse [bind]: mixed named, numeric or positional parameters

I think method bind() has incorrect regexps. Need to edit regexp or pass query in it without comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions