aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gmail.com>2013-10-24 22:25:07 +0900
committerAkinori Hattori <hattya@gmail.com>2013-10-24 22:25:07 +0900
commitef9b514cad40dfe50cf087cc309295cf28ca2557 (patch)
tree7a3ca67de99b0b1951a2e75e75966efa43d6454a /sqlite3.go
parentInclude errno.h when build on cygwin. Closes #87 (diff)
downloadgolite-ef9b514cad40dfe50cf087cc309295cf28ca2557.tar.gz
golite-ef9b514cad40dfe50cf087cc309295cf28ca2557.tar.xz
sqlite3_column_blob() returns NULL for zero-length BLOB
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/sqlite3.go b/sqlite3.go
index df3ad10..0012aa2 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -493,6 +493,10 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
dest[i] = float64(C.sqlite3_column_double(rc.s.s, C.int(i)))
case C.SQLITE_BLOB:
p := C.sqlite3_column_blob(rc.s.s, C.int(i))
+ if p == nil {
+ dest[i] = nil
+ continue
+ }
n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
switch dest[i].(type) {
case sql.RawBytes: