From: Timur Safin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: "'Mergen Imeev'" <imeevma@tarantool.org>
Cc: <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v2 1/2] sql: introduce UUID field type
Date: Thu, 3 Jun 2021 12:40:59 +0300 [thread overview]
Message-ID: <08eb01d7585c$8fd6bf10$af843d30$@tarantool.org> (raw)
In-Reply-To: <20210603090455.GA48615@tarantool.org>
: From: Mergen Imeev <imeevma@tarantool.org>
: Sent: Thursday, June 3, 2021 12:05 PM
: To: Timur Safin <tsafin@tarantool.org>
: Cc: tarantool-patches@dev.tarantool.org
: Subject: Re: [PATCH v2 1/2] sql: introduce UUID field type
:
: Hi! Thank you for the review! My answers and diff below.
:
...
:
: Diff:
:
:
: diff --git a/src/box/sql/mem.c b/src/box/sql/mem.c
: index f0dfce395..6f3bf52e5 100644
: --- a/src/box/sql/mem.c
: +++ b/src/box/sql/mem.c
: @@ -612,8 +612,7 @@ str_to_uuid(struct Mem *mem)
: {
: assert(mem->type == MEM_TYPE_STR);
: struct tt_uuid uuid;
: - if (mem->n != UUID_STR_LEN ||
: - tt_uuid_from_string(tt_cstr(mem->z, mem->n), &uuid) != 0)
: + if (tt_uuid_from_strl(mem->z, mem->n, &uuid) != 0)
: return -1;
: mem_set_uuid(mem, &uuid);
: return 0;
Did not know we do have tt_uuid_from_strl() which operates
with view. That's good! And although it's still using unnecessary
buffer copy (implemented in very naïve manner) it's still a good
abstraction here, and we could avoid calls to static_alloc() :)
LGTM
Timur
next prev parent reply other threads:[~2021-06-03 9:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 8:02 [Tarantool-patches] [PATCH v2 0/2] sql: introduce UUID Mergen Imeev via Tarantool-patches
2021-06-02 8:02 ` [Tarantool-patches] [PATCH v2 1/2] sql: introduce UUID field type Mergen Imeev via Tarantool-patches
2021-06-02 20:13 ` Timur Safin via Tarantool-patches
2021-06-03 9:04 ` Mergen Imeev via Tarantool-patches
2021-06-03 9:40 ` Timur Safin via Tarantool-patches [this message]
2021-06-02 8:02 ` [Tarantool-patches] [PATCH v2 2/2] sql: introduce SQL built-in function UUID() Mergen Imeev via Tarantool-patches
2021-06-02 20:13 ` Timur Safin via Tarantool-patches
2021-06-02 20:13 ` [Tarantool-patches] [PATCH v2 0/2] sql: introduce UUID Timur Safin via Tarantool-patches
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='08eb01d7585c$8fd6bf10$af843d30$@tarantool.org' \
--to=tarantool-patches@dev.tarantool.org \
--cc=imeevma@tarantool.org \
--cc=tsafin@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2 1/2] sql: introduce UUID field type' \
/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