syncbase: use byte[] for range start/limit in wire API
VDL assumes strings are utf-8, but start and limit are not guaranteed to be
valid utf-8 strings. For example, when using byte-based key ordering (the
default), prefix->range conversion may produce a 'limit' value that ends with a
byte that's not valid utf-8.
Change-Id: I5ff5f29718d76717a21a54a63f998e07224084dc
diff --git a/services/syncbase/server/nosql/table.go b/services/syncbase/server/nosql/table.go
index ca89bcf1..eb2a9c5 100644
--- a/services/syncbase/server/nosql/table.go
+++ b/services/syncbase/server/nosql/table.go
@@ -67,14 +67,14 @@
})
}
-func (t *table) DeleteRowRange(ctx *context.T, call rpc.ServerCall, start, limit string) error {
+func (t *table) DeleteRowRange(ctx *context.T, call rpc.ServerCall, start, limit []byte) error {
return verror.NewErrNotImplemented(ctx)
}
-func (t *table) Scan(ctx *context.T, call wire.TableScanServerCall, start, limit string) error {
+func (t *table) Scan(ctx *context.T, call wire.TableScanServerCall, start, limit []byte) error {
sn := t.d.st.NewSnapshot()
defer sn.Close()
- it := sn.Scan(util.ScanRangeArgs(util.JoinKeyParts(util.RowPrefix, t.name), start, limit))
+ it := sn.Scan(util.ScanRangeArgs(util.JoinKeyParts(util.RowPrefix, t.name), string(start), string(limit)))
sender := call.SendStream()
key, value := []byte{}, []byte{}
for it.Advance() {