55 "net"
66 "time"
77
8+ "github.com/tarantool/go-iproto"
89 "github.com/vmihailenco/msgpack/v5"
910)
1011
@@ -25,39 +26,50 @@ func RefImplPingBody(enc *msgpack.Encoder) error {
2526
2627// RefImplSelectBody is reference implementation for filling of a select
2728// request's body.
28- func RefImplSelectBody (enc * msgpack.Encoder , space , index , offset , limit uint32 , iterator Iter ,
29- key , after interface {}, fetchPos bool ) error {
30- return fillSelect (enc , space , index , offset , limit , iterator , key , after , fetchPos )
29+ func RefImplSelectBody (enc * msgpack.Encoder , space , index interface {},
30+ offset , limit uint32 , iterator Iter , key , after interface {}, fetchPos bool ) error {
31+ iprotoSpaceKey := iproto .IPROTO_SPACE_ID
32+ iprotoIndexKey := iproto .IPROTO_INDEX_ID
33+ if _ , ok := space .(string ); ok {
34+ iprotoSpaceKey = iproto .IPROTO_SPACE_NAME
35+ }
36+ if _ , ok := index .(string ); ok {
37+ iprotoIndexKey = iproto .IPROTO_INDEX_NAME
38+ }
39+ return fillSelect (enc , space , index , offset , limit , iterator , key , after ,
40+ fetchPos , iprotoSpaceKey , iprotoIndexKey )
3141}
3242
3343// RefImplInsertBody is reference implementation for filling of an insert
3444// request's body.
3545func RefImplInsertBody (enc * msgpack.Encoder , space uint32 , tuple interface {}) error {
36- return fillInsert (enc , space , tuple )
46+ return fillInsert (enc , space , tuple , iproto . IPROTO_SPACE_ID )
3747}
3848
3949// RefImplReplaceBody is reference implementation for filling of a replace
4050// request's body.
4151func RefImplReplaceBody (enc * msgpack.Encoder , space uint32 , tuple interface {}) error {
42- return fillInsert (enc , space , tuple )
52+ return fillInsert (enc , space , tuple , iproto . IPROTO_SPACE_ID )
4353}
4454
4555// RefImplDeleteBody is reference implementation for filling of a delete
4656// request's body.
4757func RefImplDeleteBody (enc * msgpack.Encoder , space , index uint32 , key interface {}) error {
48- return fillDelete (enc , space , index , key )
58+ return fillDelete (enc , space , index , key ,
59+ iproto .IPROTO_SPACE_ID , iproto .IPROTO_INDEX_ID )
4960}
5061
5162// RefImplUpdateBody is reference implementation for filling of an update
5263// request's body.
5364func RefImplUpdateBody (enc * msgpack.Encoder , space , index uint32 , key , ops interface {}) error {
54- return fillUpdate (enc , space , index , key , ops )
65+ return fillUpdate (enc , space , index , key , ops ,
66+ iproto .IPROTO_SPACE_ID , iproto .IPROTO_INDEX_ID )
5567}
5668
5769// RefImplUpsertBody is reference implementation for filling of an upsert
5870// request's body.
5971func RefImplUpsertBody (enc * msgpack.Encoder , space uint32 , tuple , ops interface {}) error {
60- return fillUpsert (enc , space , tuple , ops )
72+ return fillUpsert (enc , space , tuple , ops , iproto . IPROTO_SPACE_ID )
6173}
6274
6375// RefImplCallBody is reference implementation for filling of a call or call17
0 commit comments