[Tarantool-patches] [PATCH 2/2] box: introduce "current" for sequence

Nikita Pettik korablev at tarantool.org
Fri Mar 6 16:00:50 MSK 2020


On 06 Mar 14:46, olegrok at tarantool.org wrote:
> From: Oleg Babin <babinoleg at mail.ru>
> 
> diff --git a/test/box/sequence.test.lua b/test/box/sequence.test.lua
> index 8e00571e5..54011225e 100644
> --- a/test/box/sequence.test.lua
> +++ b/test/box/sequence.test.lua
> @@ -780,3 +780,15 @@ pk = s:create_index('pk', {sequence = true})
>  t = box.space._space_sequence:get({s.id})
>  box.space._space_sequence:update({s.id}, {{'=', 2, t[2]}})
>  s:drop()
> +
> +--
> +-- gh-4752 current value of sequence
> +--

Nit: please, write a bit more informative comments. For instance:

--
-- gh-4752: introduce sequence:current() method which
-- fetches current sequence value but doesn't modify
-- sequence itself.
--

> +sq = box.schema.sequence.create('test')
> +sq:current()
> +sq:next()
> +sq:current()
> +sq:set(42)
> +sq:current()
> +sq:current()
> +sq:drop()
> -- 
> 2.23.0
> 


More information about the Tarantool-patches mailing list