diff options
author | mattn <mattn.jp@gmail.com> | 2013-10-24 16:59:21 -0700 |
---|---|---|
committer | mattn <mattn.jp@gmail.com> | 2013-10-24 16:59:21 -0700 |
commit | 8727f7003821207e653612abcc36c573bbdac0d1 (patch) | |
tree | 7a3ca67de99b0b1951a2e75e75966efa43d6454a | |
parent | Include errno.h when build on cygwin. Closes #87 (diff) | |
parent | sqlite3_column_blob() returns NULL for zero-length BLOB (diff) | |
download | golite-8727f7003821207e653612abcc36c573bbdac0d1.tar.gz golite-8727f7003821207e653612abcc36c573bbdac0d1.tar.xz |
Merge pull request #89 from hattya/blob
sqlite3_column_blob() returns NULL for zero-length BLOB
-rw-r--r-- | sqlite3.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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: |