mirror of https://github.com/mattn/go-sqlite3.git
Merge pull request #67 from dajohi/master
call sqlite3_column_blob() before sqlite3_column_bytes()
This commit is contained in:
commit
c1b0b47cb9
|
@ -373,8 +373,8 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
|
||||||
case C.SQLITE_FLOAT:
|
case C.SQLITE_FLOAT:
|
||||||
dest[i] = float64(C.sqlite3_column_double(rc.s.s, C.int(i)))
|
dest[i] = float64(C.sqlite3_column_double(rc.s.s, C.int(i)))
|
||||||
case C.SQLITE_BLOB:
|
case C.SQLITE_BLOB:
|
||||||
n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
|
|
||||||
p := C.sqlite3_column_blob(rc.s.s, C.int(i))
|
p := C.sqlite3_column_blob(rc.s.s, C.int(i))
|
||||||
|
n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
|
||||||
switch dest[i].(type) {
|
switch dest[i].(type) {
|
||||||
case sql.RawBytes:
|
case sql.RawBytes:
|
||||||
dest[i] = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
|
dest[i] = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
|
||||||
|
|
Loading…
Reference in New Issue