forked from mirror/go-sqlite3
Use GoBytes
This commit is contained in:
parent
6de94b0b99
commit
2364b288cc
|
@ -1990,13 +1990,8 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
|
||||||
dest[i] = nil
|
dest[i] = nil
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
|
n := C.sqlite3_column_bytes(rc.s.s, C.int(i))
|
||||||
switch dest[i].(type) {
|
dest[i] = C.GoBytes(p, n)
|
||||||
default:
|
|
||||||
slice := make([]byte, n)
|
|
||||||
copy(slice[:], (*[1 << 30]byte)(p)[0:n])
|
|
||||||
dest[i] = slice
|
|
||||||
}
|
|
||||||
case C.SQLITE_NULL:
|
case C.SQLITE_NULL:
|
||||||
dest[i] = nil
|
dest[i] = nil
|
||||||
case C.SQLITE_TEXT:
|
case C.SQLITE_TEXT:
|
||||||
|
|
Loading…
Reference in New Issue