Replace index:iterator() API with Lua-compatible pairs()
This patch converts space:iterator() to be compatible with Lua for-in loop conventions. The most important change is that generating function now returns *state* as its first result: for _state, val in space.index[0]:pairs() do work(val) end New syntax follows the best practices of Lua community and makes index API to be more consistent with pairs() and tuple iterators. This change partially restores pairs() logic as it was implemented before 49875615.
Showing
- src/box/lua/schema.lua 54 additions, 25 deletionssrc/box/lua/schema.lua
- test/big/hash_multipart.result 2 additions, 1 deletiontest/big/hash_multipart.result
- test/big/hash_multipart.test.lua 2 additions, 1 deletiontest/big/hash_multipart.test.lua
- test/big/iterator.result 2 additions, 2 deletionstest/big/iterator.result
- test/big/iterator.test.lua 2 additions, 2 deletionstest/big/iterator.test.lua
- test/big/lua.result 17 additions, 11 deletionstest/big/lua.result
- test/big/lua.test.lua 12 additions, 10 deletionstest/big/lua.test.lua
- test/big/lua/utils.lua 2 additions, 1 deletiontest/big/lua/utils.lua
- test/big/sql.result 1 addition, 1 deletiontest/big/sql.result
- test/big/sql.test.py 1 addition, 1 deletiontest/big/sql.test.py
- test/big/tree_pk.result 33 additions, 12 deletionstest/big/tree_pk.result
- test/big/tree_pk.test.lua 19 additions, 12 deletionstest/big/tree_pk.test.lua
- test/big/tree_pk_multipart.result 4 additions, 4 deletionstest/big/tree_pk_multipart.result
- test/big/tree_pk_multipart.test.lua 4 additions, 4 deletionstest/big/tree_pk_multipart.test.lua
- test/box/crossjoin.result 2 additions, 2 deletionstest/box/crossjoin.result
- test/box/crossjoin.test.lua 2 additions, 2 deletionstest/box/crossjoin.test.lua
- test/box/errinj_index.result 4 additions, 4 deletionstest/box/errinj_index.result
- test/box/errinj_index.test.lua 4 additions, 4 deletionstest/box/errinj_index.test.lua
- test/wal/lua.result 1 addition, 1 deletiontest/wal/lua.result
- test/wal/lua.test.lua 1 addition, 1 deletiontest/wal/lua.test.lua
Loading
Please register or sign in to comment