From: Oleg Babin <olegrok@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, lvasiliev@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 2/2] uuid: support uuid comparison with strings
Date: Sat, 21 Nov 2020 22:07:47 +0300 [thread overview]
Message-ID: <5c5ca171-106f-2a03-079b-cbb2f42bab80@tarantool.org> (raw)
In-Reply-To: <5dc1f19d-a579-bef0-047b-e467e2d60970@tarantool.org>
Hi! Thanks for your comments. See my answers below.
On 21/11/2020 18:17, Vladislav Shpilevoy wrote:
> Thanks for the patch!
>
> See 2 comments below.
>
> On 18.11.2020 08:56,olegrok@tarantool.org wrote:
>> From: Oleg Babin<babinoleg@mail.ru>
>>
>> Before this patch it was impossible to compare uuid values with
>> string representations of uuid. However we have cases when such
>> comparisons is possible (e.g. "decimal" where we can compare
>> decimal values with strings and numbers).
>>
>> This patch extends uuid comparators (eq, lt, le) and every string
>> argument is tried to be converted to uuid value to compare then.
>>
>> Follow-up #5511
>>
>> @TarantoolBot document
>> Title: uuid values could be compared with strings
>>
>> Currently it's possible to compare uuid values with its string
>> representations:
>> ```lua
>> u1_str = 'aaaaaaaa-aaaa-4000-b000-000000000001'
>> u1 = uuid.fromstr(u1_str)
>> u2_str = 'bbbbbbbb-bbbb-4000-b000-000000000001'
>>
>> u1 == u1_str -- true
>> u1 == u2_str -- false
>>
>> u1 >= u1_str -- true
>> u1 < u2_str -- true
>> ```
> 1. Better use a single docbot request. It will be simpler for the doc
> team to handle it, since both the updates are about the same place.
> But up to you.
Agree. I've merged them.
```
Title: uuid comparison rules
Currently comparison between uuid values is supported.
Example:
```lua
u1 = uuid.fromstr('aaaaaaaa-aaaa-4000-b000-000000000001')
u2 = uuid.fromstr('bbbbbbbb-bbbb-4000-b000-000000000001')
u1 > u2 -- false
u1 >= u2 -- false
u1 <= u2 -- true
u1 < u2 -- true
```
Also it's possible to compare uuid values with its string
representations:
```lua
u1_str = 'aaaaaaaa-aaaa-4000-b000-000000000001'
u1 = uuid.fromstr(u1_str)
u2_str = 'bbbbbbbb-bbbb-4000-b000-000000000001'
u1 == u1_str -- true
u1 == u2_str -- false
u1 >= u1_str -- true
u1 < u2_str -- true
```
```
>> ---
>> Issue:https://github.com/tarantool/tarantool/issues/5511
>> Branch:https://github.com/tarantool/tarantool/tree/olegrok/5511-uuid-cmp-v2
>>
>> diff --git a/test/app/uuid.result b/test/app/uuid.result
>> index e06331001..5b9ffa230 100644
>> --- a/test/app/uuid.result
>> +++ b/test/app/uuid.result
> 2. I don't see a test for == with an incorrect string. Is it
> there?
Yes, it was added before
https://github.com/tarantool/tarantool/blob/e23b14dc23d749d092295a9b84854e1d64b2db27/test/app/uuid.test.lua#L89
next prev parent reply other threads:[~2020-11-21 19:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 7:56 [Tarantool-patches] [PATCH v2 0/2] Make uuid values comparable olegrok
2020-11-18 7:56 ` [Tarantool-patches] [PATCH v2 1/2] uuid: support comparison of uuid values in Lua olegrok
2020-11-21 15:17 ` Vladislav Shpilevoy
2020-11-21 19:07 ` Oleg Babin
2020-11-23 21:58 ` Vladislav Shpilevoy
2020-11-24 5:57 ` Oleg Babin
2020-11-24 13:06 ` Igor Munkin
2020-11-27 15:17 ` Oleg Babin
2020-11-24 15:20 ` Igor Munkin
2020-11-24 19:23 ` Oleg Babin
2020-11-18 7:56 ` [Tarantool-patches] [PATCH v2 2/2] uuid: support uuid comparison with strings olegrok
2020-11-21 15:17 ` Vladislav Shpilevoy
2020-11-21 19:07 ` Oleg Babin [this message]
2020-11-24 15:20 ` Igor Munkin
2020-11-24 19:23 ` Oleg Babin
2020-11-18 8:02 ` [Tarantool-patches] [PATCH v2 0/2] Make uuid values comparable Oleg Babin
2020-11-27 22:39 ` Vladislav Shpilevoy
2020-11-27 22:40 ` Vladislav Shpilevoy
2020-12-04 8:13 ` Oleg Babin
2020-12-07 23:04 ` Alexander V. Tikhonov
2020-12-07 23:24 ` Vladislav Shpilevoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c5ca171-106f-2a03-079b-cbb2f42bab80@tarantool.org \
--to=olegrok@tarantool.org \
--cc=lvasiliev@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2 2/2] uuid: support uuid comparison with strings' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox