From 2c8d4a4a1d2169c5912198c7c0e19f19025275bc Mon Sep 17 00:00:00 2001 From: Roman Tsisyk <roman@tsisyk.com> Date: Fri, 28 Feb 2014 16:37:27 +0400 Subject: [PATCH] select-new-api-v2: review fixes --- src/box/lua/schema.lua | 6 +++--- test/big/sql.result | 2 +- test/big/sql.test.py | 2 +- test/big/tree_pk.result | 4 ++-- test/big/tree_pk.test.lua | 4 ++-- test/big/tree_pk_multipart.result | 18 +++++++++--------- test/big/tree_pk_multipart.test.lua | 18 +++++++++--------- test/big/tree_variants.result | 12 ++++++------ test/big/tree_variants.test.lua | 12 ++++++------ test/wal/lua.result | 2 +- test/wal/lua.test.lua | 2 +- 11 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua index 10c0cf74c9..0eb94162a4 100644 --- a/src/box/lua/schema.lua +++ b/src/box/lua/schema.lua @@ -381,16 +381,16 @@ function box.schema.space.bless(space) if opts ~= nil then if opts.offset ~= nil then - offset = tonumber(opts.offset) + offset = opts.offset end if type(opts.iterator) == "string" then opts.iterator = box.index[opts.iterator] end if opts.iterator ~= nil then - iterator = tonumber(opts.iterator) + iterator = opts.iterator end if opts.limit ~= nil then - limit = tonumber(opts.limit) + limit = opts.limit end end diff --git a/test/big/sql.result b/test/big/sql.result index 4f8a570dfe..05185e29cc 100644 --- a/test/big/sql.result +++ b/test/big/sql.result @@ -265,7 +265,7 @@ select * from t0 where k1='part1_a' select * from t0 where k1='part_none' --- ... -box.space[0].index[1]:select({'part1', 'part2'}, { limit = 100 }) +box.space[0].index[1]:select({'part1', 'part2'}) --- - - [1234567, 'part1', 'part2'] - [11234567, 'part1', 'part2'] diff --git a/test/big/sql.test.py b/test/big/sql.test.py index be9de63fb4..7c8b8c52a6 100644 --- a/test/big/sql.test.py +++ b/test/big/sql.test.py @@ -98,7 +98,7 @@ sql("select * from t0 where k0=21234567") sql("select * from t0 where k1='part1'") sql("select * from t0 where k1='part1_a'") sql("select * from t0 where k1='part_none'") -admin("box.space[0].index[1]:select({'part1', 'part2'}, { limit = 100 })") +admin("box.space[0].index[1]:select({'part1', 'part2'})") sql("select * from t0 where k1='part1'") sql("select * from t0 where k1='part2'") # cleanup diff --git a/test/big/tree_pk.result b/test/big/tree_pk.result index 0fd10e8f7e..2a4bc433ae 100644 --- a/test/big/tree_pk.result +++ b/test/big/tree_pk.result @@ -523,7 +523,7 @@ s0:replace{5, 5, 0, 5} --- - [5, 5, 0, 5] ... -box.sort(s0.index['i2']:select(0, { limit = 100 })) +box.sort(s0.index['i2']:select(0)) --- - - [0, 0, 0, 0] - [4, 4, 0, 4] @@ -534,7 +534,7 @@ s0:delete{5} --- - [5, 5, 0, 5] ... -box.sort(s0.index['i2']:select(0, { limit = 100 })) +box.sort(s0.index['i2']:select(0)) --- - - [0, 0, 0, 0] - [4, 4, 0, 4] diff --git a/test/big/tree_pk.test.lua b/test/big/tree_pk.test.lua index 02ae7f4d12..028ec47c6b 100644 --- a/test/big/tree_pk.test.lua +++ b/test/big/tree_pk.test.lua @@ -189,9 +189,9 @@ s0:insert{4, 4, 0, 4} s0:insert{5, 5, 0, 5} s0:insert{6, 6, 0, 6} s0:replace{5, 5, 0, 5} -box.sort(s0.index['i2']:select(0, { limit = 100 })) +box.sort(s0.index['i2']:select(0)) s0:delete{5} -box.sort(s0.index['i2']:select(0, { limit = 100 })) +box.sort(s0.index['i2']:select(0)) s0:drop() s0 = nil diff --git a/test/big/tree_pk_multipart.result b/test/big/tree_pk_multipart.result index febbab6bba..efce5b461f 100644 --- a/test/big/tree_pk_multipart.result +++ b/test/big/tree_pk_multipart.result @@ -189,7 +189,7 @@ space.index['primary']:get{'Vincent', 'The Wolf!', 2} of this. So, pretty please... with sugar on top. Clean the fucking car.'] ... -- Select all messages from Vincent to Jules -space.index['primary']:select({'Vincent', 'Jules'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'Jules'}) --- - - ['Vincent', 'Jules', 0, 'Do you know what they call a - a - a Quarter Pounder with cheese in Paris?'] @@ -202,7 +202,7 @@ space.index['primary']:select({'Vincent', 'Jules'}, { limit = 100 }) - ['Vincent', 'Jules', 6, 'I dunno, I didn`t go into Burger King.'] ... -- Select all messages from Jules to Vincent -space.index['primary']:select({'Jules', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'Jules', 'Vincent'}) --- - - ['Jules', 'Vincent', 0, 'They don`t call it a Quarter Pounder with cheese?'] - ['Jules', 'Vincent', 1, 'Then what do they call it?'] @@ -212,7 +212,7 @@ space.index['primary']:select({'Jules', 'Vincent'}, { limit = 100 }) - ['Jules', 'Vincent', 5, 'What do they call a `Whopper`?'] ... -- Select all messages from Vincent to The Wolf -space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'The Wolf!'}) --- - - ['Vincent', 'The Wolf!', 0, 'A please would be nice.'] - ['Vincent', 'The Wolf!', 1, 'I said a please would be nice.'] @@ -221,7 +221,7 @@ space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) of this. So, pretty please... with sugar on top. Clean the fucking car.'] ... -- Select all messages from The Wolf to Vincent -space.index['primary']:select({'The Wolf!', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'The Wolf!', 'Vincent'}) --- - - ['The Wolf!', 'Vincent', 0, 'Jimmie, lead the way. Boys, get to work.'] - ['The Wolf!', 'Vincent', 1, 'Come again?'] @@ -233,7 +233,7 @@ space.index['primary']:select({'The Wolf!', 'Vincent'}, { limit = 100 }) barking orders at me.'] ... -- Select all Vincent messages -space.index['primary']:select({'Vincent'}, { limit = 100 }) +space.index['primary']:select({'Vincent'}) --- - - ['Vincent', 'Jules', 0, 'Do you know what they call a - a - a Quarter Pounder with cheese in Paris?'] @@ -276,7 +276,7 @@ space:update({'Updated', 'The Wolf!', 1}, {{ '=', 0, 'Vincent'}, { '#', 4, 1 }}) - ['Vincent', 'The Wolf!', 1, 'I said a please would be nice.'] ... -- Checking Vincent's last messages -space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'The Wolf!'}) --- - - ['Vincent', 'The Wolf!', 1, 'I said a please would be nice.'] - ['Vincent', 'The Wolf!', 2, 'If I`m curt with you it`s because time is a factor. @@ -284,7 +284,7 @@ space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) of this. So, pretty please... with sugar on top. Clean the fucking car.'] ... -- Checking The Wolf's last messages -space.index['primary']:select({'The Wolf!', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'The Wolf!', 'Vincent'}) --- - - ['The Wolf!', 'Vincent', 1, 'Come again?'] - ['The Wolf!', 'Vincent', 2, 'Get it straight buster - I`m not here to say please, @@ -318,7 +318,7 @@ space:update({'Vincent', 'The Wolf!', 1}, {{'=', 3, '<ooops>'}}) - ['Vincent', 'The Wolf!', 1, '<ooops>'] ... -- Checking Vincent's last messages -space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'The Wolf!'}) --- - - ['Vincent', 'The Wolf!', 1, '<ooops>'] - ['Vincent', 'The Wolf!', 2, 'If I`m curt with you it`s because time is a factor. @@ -326,7 +326,7 @@ space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) of this. So, pretty please... with sugar on top. Clean the fucking car.'] ... -- Checking The Wolf's last messages -space.index['primary']:select({'The Wolf!', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'The Wolf!', 'Vincent'}) --- - - ['The Wolf!', 'Vincent', 1, '<ooops>'] - ['The Wolf!', 'Vincent', 2, 'Get it straight buster - I`m not here to say please, diff --git a/test/big/tree_pk_multipart.test.lua b/test/big/tree_pk_multipart.test.lua index a049313356..942f30c246 100644 --- a/test/big/tree_pk_multipart.test.lua +++ b/test/big/tree_pk_multipart.test.lua @@ -55,19 +55,19 @@ space.index['primary']:get{'The Wolf!', 'Vincent', 3} space.index['primary']:get{'Vincent', 'The Wolf!', 2} -- Select all messages from Vincent to Jules -space.index['primary']:select({'Vincent', 'Jules'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'Jules'}) -- Select all messages from Jules to Vincent -space.index['primary']:select({'Jules', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'Jules', 'Vincent'}) -- Select all messages from Vincent to The Wolf -space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'The Wolf!'}) -- Select all messages from The Wolf to Vincent -space.index['primary']:select({'The Wolf!', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'The Wolf!', 'Vincent'}) -- Select all Vincent messages -space.index['primary']:select({'Vincent'}, { limit = 100 }) +space.index['primary']:select({'Vincent'}) -- -- Delete test @@ -81,9 +81,9 @@ space:delete{'Vincent', 'The Wolf!', 0} space:update({'Vincent', 'The Wolf!', 1}, {{ '=', 0, 'Updated' }, {'=', 4, 'New'}}) space:update({'Updated', 'The Wolf!', 1}, {{ '=', 0, 'Vincent'}, { '#', 4, 1 }}) -- Checking Vincent's last messages -space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'The Wolf!'}) -- Checking The Wolf's last messages -space.index['primary']:select({'The Wolf!', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'The Wolf!', 'Vincent'}) -- try to delete nonexistent message space:delete{'Vincent', 'The Wolf!', 3} @@ -99,9 +99,9 @@ space:update({'The Wolf!', 'Vincent', 1}, {{'=', 3, '<ooops>'}}) space:update({'Vincent', 'The Wolf!', 1}, {{'=', 3, '<ooops>'}}) -- Checking Vincent's last messages -space.index['primary']:select({'Vincent', 'The Wolf!'}, { limit = 100 }) +space.index['primary']:select({'Vincent', 'The Wolf!'}) -- Checking The Wolf's last messages -space.index['primary']:select({'The Wolf!', 'Vincent'}, { limit = 100 }) +space.index['primary']:select({'The Wolf!', 'Vincent'}) -- try to update a nonexistent message space:update({'Vincent', 'The Wolf!', 3}, {{'=', 3, '<ooops>'}}) diff --git a/test/big/tree_variants.result b/test/big/tree_variants.result index 2df5f482ff..95bfdf7e22 100644 --- a/test/big/tree_variants.result +++ b/test/big/tree_variants.result @@ -70,21 +70,21 @@ space.index['i1']:select{2} --- - - [2, 2, 200, 'Joe', 'Sixpack', 'Drinks', 'Carlsberg', 'bar', 2002] ... -space.index[2]:select({300}, { limit = 100 }) +space.index[2]:select({300}) --- - - [3, 3, 300, 'Joe', 'Sixpack', 'Drinks', 'Corona Extra', 'bar', 2003] - [4, 4, 300, 'Joe', 'Sixpack', 'Drinks', 'Stella Artois', 'bar', 2004] - [5, 5, 300, 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005] ... -#space.index['i3']:select({'Joe', 'Sixpack'}, { limit = 100 }) +#space.index['i3']:select({'Joe', 'Sixpack'}) --- - 6 ... -#space.index['i3']:select('John', { limit = 100 }) +#space.index['i3']:select('John') --- - 4 ... -#space.index['i4']:select('A Pipe', { limit = 100 }) +#space.index['i4']:select('A Pipe') --- - 1 ... @@ -140,14 +140,14 @@ space.index['i1']:select{6} --- - - [6, 6, 400, 'John', 'Smoker', 'Hits', 'A Pipe', 'foo', 2006] ... -space.index['i2']:select(400ULL, { limit = 100 }) +space.index['i2']:select(400ULL) --- - - [6, 6, 400, 'John', 'Smoker', 'Hits', 'A Pipe', 'foo', 2006] - [7, 7, 400, 'John', 'Smoker', 'Hits', 'A Bong', 'foo', 2007] - [8, 8, 400, 'John', 'Smoker', 'Rolls', 'A Joint', 'foo', 2008] - [9, 9, 400, 'John', 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009] ... -space.index['i2']:select(400, { limit = 100}) +space.index['i2']:select(400) --- - - [6, 6, 400, 'John', 'Smoker', 'Hits', 'A Pipe', 'foo', 2006] - [7, 7, 400, 'John', 'Smoker', 'Hits', 'A Bong', 'foo', 2007] diff --git a/test/big/tree_variants.test.lua b/test/big/tree_variants.test.lua index a7d4899982..046480ed55 100644 --- a/test/big/tree_variants.test.lua +++ b/test/big/tree_variants.test.lua @@ -20,10 +20,10 @@ space:insert{9, 9, 400, 'John', 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009} space.index['primary']:get{1} space.index['i1']:select{2} -space.index[2]:select({300}, { limit = 100 }) -#space.index['i3']:select({'Joe', 'Sixpack'}, { limit = 100 }) -#space.index['i3']:select('John', { limit = 100 }) -#space.index['i4']:select('A Pipe', { limit = 100 }) +space.index[2]:select({300}) +#space.index['i3']:select({'Joe', 'Sixpack'}) +#space.index['i3']:select('John') +#space.index['i4']:select('A Pipe') {space.index['i4']:select{'Miller Genuine Draft', 'Drinks'}} space.index['i5']:select{2007} space.index[6]:select{'Miller Genuine Draft', 'Drinks'} @@ -40,8 +40,8 @@ space:insert{9, 9ULL, 400ULL, 'John', 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009} space.index['i1']:select{6ULL} space.index['i1']:select{6} -space.index['i2']:select(400ULL, { limit = 100 }) -space.index['i2']:select(400, { limit = 100}) +space.index['i2']:select(400ULL) +space.index['i2']:select(400) space:select{} diff --git a/test/wal/lua.result b/test/wal/lua.result index 181dc461e4..599b03be4b 100644 --- a/test/wal/lua.result +++ b/test/wal/lua.result @@ -37,7 +37,7 @@ space:truncate() for i = 1, 100000, 1 do space:insert{tostring(i), i} end --- ... -local t1 = space.index['secondary']:select({}, { limit = 100000 }) +local t1 = space.index['secondary']:select() --- ... space:drop() diff --git a/test/wal/lua.test.lua b/test/wal/lua.test.lua index a7e6e59b91..6895ce5339 100644 --- a/test/wal/lua.test.lua +++ b/test/wal/lua.test.lua @@ -27,7 +27,7 @@ space:truncate() -- 5.4 -- for i = 1, 100000, 1 do space:insert{tostring(i), i} end -local t1 = space.index['secondary']:select({}, { limit = 100000 }) +local t1 = space.index['secondary']:select() space:drop() -- -- GitLab