Commit ed7af606 authored by gwenn's avatar gwenn

Treat []byte{} as empty BLOB instead of NULL.

parent dd84c727
...@@ -383,7 +383,7 @@ func (s *Stmt) BindByIndex(index int, value interface{}) error { ...@@ -383,7 +383,7 @@ func (s *Stmt) BindByIndex(index int, value interface{}) error {
return s.specificError("blob too big: %d at index %d", len(value), index) return s.specificError("blob too big: %d at index %d", len(value), index)
} }
if len(value) == 0 { if len(value) == 0 {
rv = C.my_bind_blob(s.stmt, i, nil, 0) rv = C.sqlite3_bind_zeroblob(s.stmt, i, 0)
} else { } else {
rv = C.my_bind_blob(s.stmt, i, unsafe.Pointer(&value[0]), C.int(len(value))) rv = C.my_bind_blob(s.stmt, i, unsafe.Pointer(&value[0]), C.int(len(value)))
} }
......
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