Commit 4aca652e authored by gwenn's avatar gwenn

Fix sqlite3_next_stmt misuse and docs.

parent c45ae22f
......@@ -20,7 +20,7 @@ Stmt#ScanByIndex/ScanByName are added to test NULL value.
Currently, the weak point of the binding is the *Scan* methods:
The original implementation is using this strategy:
- convert the stored value to a []byte by calling sqlite3_column_bytes,
- convert the stored value to a []byte by calling sqlite3_column_blob,
- convert the bytes to the desired Go type with correct feedback in case of illegal conversion,
- but apparently no support for NULL value.
Using the native sqlite3_column_x implies:
......@@ -100,4 +100,4 @@ BenchmarkEnabledCache 1000000 1133 ns/op
BenchmarkLike 1000000 2508 ns/op
BenchmarkHalf 500000 4811 ns/op
BenchmarkRegexp 500000 6170 ns/op
\ No newline at end of file
BenchmarkRegexp 500000 6170 ns/op
......@@ -17,6 +17,7 @@ import (
)
// io.ReadCloser adapter to BLOB
// (See http://sqlite.org/c3ref/blob.html)
type BlobReader struct {
c *Conn
bl *C.sqlite3_blob
......
......@@ -158,6 +158,7 @@ func (c *Conn) LastError() error {
}
// Database connection handle
// (See http://sqlite.org/c3ref/sqlite3.html)
type Conn struct {
db *C.sqlite3
stmtCache *cache
......@@ -501,7 +502,7 @@ func (c *Conn) Close() error {
Log(C.SQLITE_MISUSE, "Dangling statement (not finalize): \""+C.GoString(C.sqlite3_sql(stmt))+"\"")
}
C.sqlite3_finalize(stmt)
stmt = C.sqlite3_next_stmt(c.db, stmt)
stmt = C.sqlite3_next_stmt(c.db, nil)
}
rv := C.sqlite3_close(c.db)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment