You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I define a table with fields that have double quotes, and when I insert a record, I get an error using backticks. This bug was introduced in clickhouse-go 2.14.3 which introduced in the PR #1083, and has not been fixed so far. While it's not a good idea to define fields this way, I'm having this issue in production and hope it can be fixed.
Code example
package main
import (
"context""fmt""log""github.com/ClickHouse/clickhouse-go/v2"
)
funcmain() {
conn, err:=clickhouse.Open(&clickhouse.Options{
Addr: []string{"127.0.0.1:9000"},
})
iferr!=nil {
log.Fatal(err)
}
ctx:=context.Background()
_=conn.Exec(ctx, "DROP TABLE IF EXISTS example SYNC")
createSql:="CREATE TABLE IF NOT EXISTS example (`@id` String,`\"@id_with_quotes\"` String) Engine = Memory"err=conn.Exec(ctx, createSql)
iferr!=nil {
log.Fatal(err)
}
_, err=conn.PrepareBatch(ctx, "INSERT INTO example (`@id`, `\"@id_with_quotes\"`)")
iferr!=nil {
log.Fatal(err)
}
}
Error log
2024/03/03 09:13:42 block cannot be sorted - missing columns in requested order: ["@id_with_quotes"]
exit status 1
Configuration
Environment
Client version: 22.8.8.3
Language version: clickhouse-go2.14.3+
OS: CentOS 7 x86_64
Interface: ClickHouse API / database/sql compatible driver
Describe the bug
I define a table with fields that have double quotes, and when I insert a record, I get an error using backticks. This bug was introduced in clickhouse-go 2.14.3 which introduced in the PR #1083, and has not been fixed so far. While it's not a good idea to define fields this way, I'm having this issue in production and hope it can be fixed.
Code example
Error log
Configuration
Environment
ClickHouse server
CREATE TABLE
statements for tables involved:The text was updated successfully, but these errors were encountered: