[Tarantool-patches] [PATCH 1/2] vy_stmt: introduce vy_stmt_is_void() helper

Nikita Pettik korablev at tarantool.org
Wed Jul 29 04:15:41 MSK 2020


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



More information about the Tarantool-patches mailing list