Previously ColumnTypeScanType returned the reflect.Type of [][]byte
for BLOB columns, resulting in a failure to scan when the type was
constructed dynamically based on this return.
test binary compiled for linux/amd64
=== RUN TestIssue153
=== RUN TestIssue153/SELECT_1_WHERE_false
=== RUN TestIssue153/--_just_a_comment
=== RUN TestIssue153/#00
--- PASS: TestIssue153 (0.00s)
--- PASS: TestIssue153/SELECT_1_WHERE_false (0.00s)
--- PASS: TestIssue153/--_just_a_comment (0.00s)
--- PASS: TestIssue153/#00 (0.00s)
PASS
ok modernc.org/sqlite 0.029s
From the issue:
> This issue might be related to this one: #152 (closed)
Confirmed.
Does not fail for 1000 cases without -race, does fail with -race.
jnml@3900x:~/src/modernc.org/sqlite$ go test -v -timeout 24h -run TestIssue142 -race |& tee log-test-issue142
test binary compiled for linux/amd64
=== RUN TestIssue142
all_test.go:3406: 0
all_test.go:3406: 1
all_test.go:3406: 2
all_test.go:3406: 3
all_test.go:3406: 4
all_test.go:3521: database is locked (5) (SQLITE_BUSY)
--- FAIL: TestIssue142 (0.10s)
FAIL
exit status 1
FAIL modernc.org/sqlite 0.110s
jnml@3900x:~/src/modernc.org/sqlite$
Instead of requiring a name arg that may clash with other state, have
New only take the fs.FS and return the value that should be used for
`vfs` in the sql.Open DSN.
This PR adds handling for user defined functions. Initially only the
xFunc parameter will be set, the others will come in subsequent PRs.
A test for a 'regexp' udf was added to check that the query
"SELECT 'seafood' REGEXP 'foo.*'"
works as expected.
Building on the _pragma query param support added in 508747c9, support
a new _time_format query param.
If _time_format is set to "sqlite", written times use the time package
format "2006-01-02 15:04:05.999999999-07:00". This is the format
mattn/go-sqlite3 uses and is format 4 at
https://sqlite.org/lang_datefunc.html#time_values.
By default, times are formatted with time.Time.String. This maintains
compatibility with existing users of the driver.
Fixes#47
In conn.step, use conn.errstr which gets the error from sqlite instead
of looking up the result code in the ErrorCodeString map.
This changes the code 5 (SQLITE_BUSY) message slightly, including
"database is locked" as returned my errstr. "SQLITE_BUSY" is still
added to the message.
Fixes#73