mattn / mattn/go-sqlite3

error on ?NNN binding

Open
#584 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug research
Dominant language
C
Stars
9.2k
Forks
1.2k
Avg merge
19m
Merged PRs (30d)
4

Description

This one work:

if _, err := db.Exec(`
	UPDATE tempstorage SET value = ?, expired = ? WHERE key = ?;
	INSERT INTO tempstorage(key, value, expired) SELECT ?, ?, ? WHERE changes() = 0;
`, value, expiredOnMilis, key, key, value, expiredOnMilis); err != nil {
	panic(err)
}

but this one doesn't:

if _, err := db.Exec(`
	UPDATE tempstorage SET value = ?2, expired = ?3 WHERE key = ?1;
	INSERT INTO tempstorage(key, value, expired) SELECT ?1, ?2, ?3 WHERE changes() = 0;
`, key, value, expiredOnMilis); err != nil {
	panic(err)
}

I don't know if this error is from upstream, please investigate.

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the two db.Exec examples from the issue and capture the error from the numbered-parameter form. Trace the driver entry point used by db.Exec and compare its handling with SQLite's parameter binding behavior. Done means identifying whether the problem is in go-sqlite3 or upstream SQLite and recording a reproducible conclusion.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sqlite
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.