diff --git a/test/big/lua.result b/test/big/lua.result index 5c680343cd5579a7371a65075d853fdbfbf80200..046b4acd132099c3899cb025a39209688d7eae41 100644 --- a/test/big/lua.result +++ b/test/big/lua.result @@ -113,6 +113,50 @@ lua num == tonumber64('18446744073709551615') --- - true ... +lua box.delete(8, 18446744073709551615ULL) +--- + - 18446744073709551615: {'magic'} +... +lua box.insert('8', 125ULL, 'magic') +--- + - 125: {'magic'} +... +lua tu = box.select('8', '0', 125) +--- +... +lua tu2 = box.select('8', '0', 125LL) +--- +... +lua num = box.unpack('l', tu[0]) +--- +... +lua num2 = box.unpack('l', tu2[0]) +--- +... +lua print(num) +--- +125 +... +lua print(num2) +--- +125 +... +lua type(num) == 'cdata' +--- + - true +... +lua type(num2) == 'cdata' +--- + - true +... +lua num == tonumber64('125') +--- + - true +... +lua num2 == tonumber64('125') +--- + - true +... lua box.space[8]:truncate() --- ... diff --git a/test/big/lua.test b/test/big/lua.test index db6058da97502e97115505962b0d2ab7b7af19c6..76eb8f0a147595809da602a4a355602392691029 100644 --- a/test/big/lua.test +++ b/test/big/lua.test @@ -62,6 +62,18 @@ exec admin "lua type(num) == 'cdata'" exec admin "lua num == tonumber64('18446744073709551615')" exec admin "lua num = box.unpack('l', tu[0])" exec admin "lua num == tonumber64('18446744073709551615')" +exec admin "lua box.delete(8, 18446744073709551615ULL)" +exec admin "lua box.insert('8', 125ULL, 'magic')" +exec admin "lua tu = box.select('8', '0', 125)" +exec admin "lua tu2 = box.select('8', '0', 125LL)" +exec admin "lua num = box.unpack('l', tu[0])" +exec admin "lua num2 = box.unpack('l', tu2[0])" +exec admin "lua print(num)" +exec admin "lua print(num2)" +exec admin "lua type(num) == 'cdata'" +exec admin "lua type(num2) == 'cdata'" +exec admin "lua num == tonumber64('125')" +exec admin "lua num2 == tonumber64('125')" exec admin "lua box.space[8]:truncate()" # diff --git a/test/big/tree_variants.result b/test/big/tree_variants.result index e01d32f1c37bdbec640e4d351e2dd6ea91762378..67947a75c44a748a4505b737427533aaf218cbbc 100644 --- a/test/big/tree_variants.result +++ b/test/big/tree_variants.result @@ -68,6 +68,44 @@ delete from t6 where k0 = 8 Delete OK, 1 row affected delete from t6 where k0 = 9 Delete OK, 1 row affected +lua box.insert(6, 6, 6ULL, 400ULL, 'John', 'Smoker', 'Hits', 'A Pipe', 'foo', 2006 ) +--- + - 6: {6, 400, 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006} +... +lua box.insert(6, 7, 7ULL, 400ULL, 'John', 'Smoker', 'Hits', 'A Bong', 'foo', 2007 ) +--- + - 7: {7, 400, 1852337994, 'Smoker', 1937008968, 'A Bong', 'foo', 2007} +... +lua box.insert(6, 8, 8ULL, 400ULL, 'John', 'Smoker', 'Rolls', 'A Joint', 'foo', 2008 ) +--- + - 8: {8, 400, 1852337994, 'Smoker', 'Rolls', 'A Joint', 'foo', 2008} +... +lua box.insert(6, 9, 9ULL, 400ULL, 'John', 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009 ) +--- + - 9: {9, 400, 1852337994, 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009} +... +lua box.select(6, 1, 6ULL) +--- + - 6: {6, 400, 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006} +... +lua box.select(6, 1, 6) +--- + - 6: {6, 400, 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006} +... +lua box.select(6, 2, 400ULL) +--- + - 6: {6, 400, 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006} + - 7: {7, 400, 1852337994, 'Smoker', 1937008968, 'A Bong', 'foo', 2007} + - 8: {8, 400, 1852337994, 'Smoker', 'Rolls', 'A Joint', 'foo', 2008} + - 9: {9, 400, 1852337994, 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009} +... +lua box.select(6, 2, 400) +--- + - 6: {6, 400, 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006} + - 7: {7, 400, 1852337994, 'Smoker', 1937008968, 'A Bong', 'foo', 2007} + - 8: {8, 400, 1852337994, 'Smoker', 'Rolls', 'A Joint', 'foo', 2008} + - 9: {9, 400, 1852337994, 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009} +... lua for k,v in box.space[6]:pairs() do print(v) end --- 0: {3472328296227680304, 3472329395739308080, 'Joe', 'Sixpack', 'Drinks', 'Amstel', 'bar', 2000} @@ -76,4 +114,8 @@ lua for k,v in box.space[6]:pairs() do print(v) end 3: {3688501078341464112, 3472331594762563632, 'Joe', 'Sixpack', 'Drinks', 'Corona Extra', 'bar', 2003} 4: {3760558672379392048, 3472331594762563632, 'Joe', 'Sixpack', 'Drinks', 'Stella Artois', 'bar', 2004} 5: {3832616266417319984, 3472331594762563632, 'Joe', 'Sixpack', 'Drinks', 'Miller Genuine Draft', 'bar', 2005} +6: {6, 400, 1852337994, 'Smoker', 1937008968, 'A Pipe', 'foo', 2006} +7: {7, 400, 1852337994, 'Smoker', 1937008968, 'A Bong', 'foo', 2007} +8: {8, 400, 1852337994, 'Smoker', 'Rolls', 'A Joint', 'foo', 2008} +9: {9, 400, 1852337994, 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009} ... diff --git a/test/big/tree_variants.test b/test/big/tree_variants.test index 9c26aa3ac1aecb26e1195e401f188d4fa9327115..a2c442d86a5e2dbb0fd9b025ccccb9406d12f113 100644 --- a/test/big/tree_variants.test +++ b/test/big/tree_variants.test @@ -27,5 +27,14 @@ exec sql "delete from t6 where k0 = 7" exec sql "delete from t6 where k0 = 8" exec sql "delete from t6 where k0 = 9" -exec admin "lua for k,v in box.space[6]:pairs() do print(v) end" +exec admin "lua box.insert(6, 6, 6ULL, 400ULL, 'John', 'Smoker', 'Hits', 'A Pipe', 'foo', 2006 )" +exec admin "lua box.insert(6, 7, 7ULL, 400ULL, 'John', 'Smoker', 'Hits', 'A Bong', 'foo', 2007 )" +exec admin "lua box.insert(6, 8, 8ULL, 400ULL, 'John', 'Smoker', 'Rolls', 'A Joint', 'foo', 2008 )" +exec admin "lua box.insert(6, 9, 9ULL, 400ULL, 'John', 'Smoker', 'Rolls', 'A Blunt', 'foo', 2009 )" + +exec admin "lua box.select(6, 1, 6ULL)" +exec admin "lua box.select(6, 1, 6)" +exec admin "lua box.select(6, 2, 400ULL)" +exec admin "lua box.select(6, 2, 400)" +exec admin "lua for k,v in box.space[6]:pairs() do print(v) end"