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

PrepareBatch fails when insert into has no space before parentheses #1326

Closed
7 tasks
ramzes642 opened this issue Jun 13, 2024 · 0 comments
Closed
7 tasks

PrepareBatch fails when insert into has no space before parentheses #1326

ramzes642 opened this issue Jun 13, 2024 · 0 comments

Comments

@ramzes642
Copy link
Contributor

ramzes642 commented Jun 13, 2024

Observed

PrepareBatch(ctx, "INSERT INTO rowtest(createDt, value)")
Returns error:

code: 62, message: Syntax error: failed at position 20 ('('): (createDt, VALUES. Unmatched parentheses: (

Under debugger I see that query var is cut by insertMatch regexp to INSERT INTO rowtest(createDt,

Expected behaviour

No error

Code example

package code

batch, err := clickhouse.PrepareBatch(ctx, "INSERT INTO rowtest(createDt, value)")
if err != nil {
    log.Println(err) 
}

Error log

code: 62, message: Syntax error: failed at position 20 ('('): (createDt, VALUES. Unmatched parentheses: (

Details

Environment

  • clickhouse-go version: v2.24.0
  • Interface: ClickHouse API
  • Go version: go version go1.22.1 darwin/arm64
  • Operating system: MacOS
  • ClickHouse version: 23.12.2-alpine
  • Is it a ClickHouse Cloud? No
  • CREATE TABLE statements for tables involved:
    create table rowtest(createDt DateTime, value Int64) ENGINE = MergeTree ORDER BY (createDt)
ramzes642 added a commit to ramzes642/clickhouse-go that referenced this issue Jun 13, 2024
@ramzes642 ramzes642 changed the title BatchInsert fails when insert into has no space before parentheses PrepareBatch fails when insert into has no space before parentheses Jun 17, 2024
jkaflik pushed a commit that referenced this issue Jun 20, 2024
* BatchInsert parentheses issue #1326

* BatchInsert backticks issue tests #1329
@jkaflik jkaflik closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants