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

insert into table (field1,field2) VALUES ('a', 'b') -> "column field1 is not present" #848

Closed
wizzard0 opened this issue Dec 13, 2022 · 3 comments

Comments

@wizzard0
Copy link
Contributor

Issue description

Expected: 1 row inserted
What happens:
https://github.com/ClickHouse/clickhouse-go/blob/main/conn_http_batch.go#L92 column %s is not present in the table %s

Looks like it's the cousin of #715 and can be fixed by patching line 48 to

rColumns[i] = strings.TrimSuffix(strings.TrimPrefix(strings.TrimSpace(rColumns[i]),"`"),"`")

if we're to continue with this crazy approach to parsing %)

Example code

stmt := tx.PrepareContext(context.TODO(), "insert into table (`field1`,`field2`) VALUES ('a', 'b')")

Configuration

OS: macOS

Interface: database/sql

Driver version: 2.4.3

Go version: go1.19.4 darwin/arm64

ClickHouse Server version: 22.8.1.1316

@jkaflik
Copy link
Contributor

jkaflik commented Feb 20, 2023

My bad. This was already fixed in #829 and already reported in #828. Closing it.

@jkaflik jkaflik closed this as completed Feb 20, 2023
@wl506
Copy link

wl506 commented Feb 20, 2023

@jkaflik v2.6.2 This error still exists

@jkaflik
Copy link
Contributor

jkaflik commented Feb 20, 2023

@wl506 can you post a minmalistic code snippet that reproduces this error?

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

Successfully merging a pull request may close this issue.

3 participants