From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3D7D8445321 for ; Wed, 29 Jul 2020 04:15:47 +0300 (MSK) From: Nikita Pettik Date: Wed, 29 Jul 2020 04:15:41 +0300 Message-Id: <47d124c6ace031a2fdf342ae45d68212cf84db07.1595985135.git.korablev@tarantool.org> In-Reply-To: References: In-Reply-To: References: Subject: [Tarantool-patches] [PATCH 1/2] vy_stmt: introduce vy_stmt_is_void() helper List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@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