Unprotected values.

This commit is contained in:
Nuno Cruces
2023-11-29 16:09:30 +00:00
parent 3f05115cd7
commit dbaf2d99cd
6 changed files with 51 additions and 10 deletions

View File

@@ -254,15 +254,15 @@ type IndexConstraintUsage struct {
// if the right-hand operand is known.
//
// https://sqlite.org/c3ref/vtab_rhs_value.html
func (idx *IndexInfo) RHSValue(column int) (*Value, error) {
func (idx *IndexInfo) RHSValue(column int) (Value, error) {
defer idx.c.arena.mark()()
valPtr := idx.c.arena.new(ptrlen)
r := idx.c.call(idx.c.api.vtabRHSValue,
uint64(idx.handle), uint64(column), uint64(valPtr))
if err := idx.c.error(r); err != nil {
return nil, err
return Value{}, err
}
return &Value{
return Value{
sqlite: idx.c.sqlite,
handle: util.ReadUint32(idx.c.mod, valPtr),
}, nil