diff --git a/src/iproto_constants.h b/src/iproto_constants.h index 07b0180ac76b9d6e9c3bc6dec4cefb5289efce6d..e6f6241e2ede147c1998c82168bb475a311f0006 100644 --- a/src/iproto_constants.h +++ b/src/iproto_constants.h @@ -78,8 +78,8 @@ enum iproto_key { #define IPROTO_HEAD_BMAP (bit(CODE) | bit(SYNC) | bit(NODE_ID) | bit(LSN)) #define IPROTO_BODY_BMAP (bit(SPACE_ID) | bit(INDEX_ID) | bit(LIMIT) |\ - bit(OFFSET) | bit(KEY) | bit(TUPLE) | \ - bit(FUNCTION_NAME) | bit(USER_NAME)) + bit(OFFSET) | bit(ITERATOR) | bit(KEY) | \ + bit(TUPLE) | bit(FUNCTION_NAME) | bit(USER_NAME)) static inline bool iproto_header_has_key(const char *pos, const char *end) { diff --git a/test/box/protocol.result b/test/box/protocol.result new file mode 100644 index 0000000000000000000000000000000000000000..2a2f36c19a7d46daf87bbf9b24ecae6232466e15 --- /dev/null +++ b/test/box/protocol.result @@ -0,0 +1,47 @@ +box.schema.user.grant('guest', 'read,write,execute', 'universe') +--- +... +-------------------------------------------------------------------------------- +-- Test case for #273: IPROTO_ITERATOR ignored in network protocol +-------------------------------------------------------------------------------- +space = box.schema.create_space('tweedledum') +--- +... +space:create_index('primary', { type = 'tree'}) +--- +... +for i=1,5 do space:insert{i} end +--- +... +conn = box.net.box.new('127.0.0.1', tonumber(box.cfg.primary_port)) +--- +... +conn:select(space.n, 3, { iterator = 'GE' }) +--- +- - [3] + - [4] + - [5] +... +conn:select(space.n, 3, { iterator = 'LE' }) +--- +- - [3] + - [2] + - [1] +... +conn:select(space.n, 3, { iterator = 'GT' }) +--- +- - [4] + - [5] +... +conn:select(space.n, 3, { iterator = 'LT' }) +--- +- - [2] + - [1] +... +conn:close() +--- +- true +... +space:drop() +--- +... diff --git a/test/box/protocol.test.lua b/test/box/protocol.test.lua new file mode 100644 index 0000000000000000000000000000000000000000..ccddac4f7c9b48ccb1ef041b2105e27bc1f5e0e0 --- /dev/null +++ b/test/box/protocol.test.lua @@ -0,0 +1,18 @@ +box.schema.user.grant('guest', 'read,write,execute', 'universe') + +-------------------------------------------------------------------------------- +-- Test case for #273: IPROTO_ITERATOR ignored in network protocol +-------------------------------------------------------------------------------- + +space = box.schema.create_space('tweedledum') +space:create_index('primary', { type = 'tree'}) +for i=1,5 do space:insert{i} end + +conn = box.net.box.new('127.0.0.1', tonumber(box.cfg.primary_port)) +conn:select(space.n, 3, { iterator = 'GE' }) +conn:select(space.n, 3, { iterator = 'LE' }) +conn:select(space.n, 3, { iterator = 'GT' }) +conn:select(space.n, 3, { iterator = 'LT' }) +conn:close() + +space:drop()