From: Nikita Pettik <korablev@tarantool.org> To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org Subject: [Tarantool-patches] [PATCH 1/2] vy_stmt: introduce vy_stmt_is_void() helper Date: Wed, 29 Jul 2020 04:15:41 +0300 [thread overview] Message-ID: <47d124c6ace031a2fdf342ae45d68212cf84db07.1595985135.git.korablev@tarantool.org> (raw) In-Reply-To: <cover.1595985135.git.korablev@tarantool.org> In-Reply-To: <cover.1595985135.git.korablev@tarantool.org> Sometimes it is quite useful to know whether vy_stmt is void (meaning that statement is NULL or corresponds to delete statement) or not. So let's add such method and use it in upcoming refactoring of upsert operation. Needed for #5107 --- src/box/vy_stmt.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/box/vy_stmt.h b/src/box/vy_stmt.h index 25219230d..1b718e26b 100644 --- a/src/box/vy_stmt.h +++ b/src/box/vy_stmt.h @@ -300,6 +300,12 @@ vy_stmt_is_empty_key(struct tuple *stmt) return tuple_field_count(stmt) == 0; } +static inline bool +vy_stmt_is_void(struct tuple *stmt) +{ + return stmt == NULL || vy_stmt_type(stmt) == IPROTO_DELETE; +} + /** * Duplicate the statememnt. * -- 2.15.1
next prev parent reply other threads:[~2020-07-29 1:15 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-29 1:15 [Tarantool-patches] [PATCH 0/2] vinyl: rework upsert internals Nikita Pettik 2020-07-29 1:15 ` Nikita Pettik [this message] 2020-07-29 1:15 ` [Tarantool-patches] [PATCH 2/2] vinyl: rework upsert operation Nikita Pettik 2020-07-30 23:31 ` Vladislav Shpilevoy 2020-08-02 14:44 ` Vladislav Shpilevoy 2020-08-08 14:51 ` Nikita Pettik 2020-07-30 23:32 ` [Tarantool-patches] [PATCH 0/2] vinyl: rework upsert internals Vladislav Shpilevoy 2020-08-08 14:23 ` Nikita Pettik
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=47d124c6ace031a2fdf342ae45d68212cf84db07.1595985135.git.korablev@tarantool.org \ --to=korablev@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/2] vy_stmt: introduce vy_stmt_is_void() helper' \ /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