[tarantool-patches] [PATCH 22/25] vinyl: remove pointless assertion from vy_stmt_new_surrogate_delete

  • From: Vladimir Davydov <vdavydov.dev@xxxxxxxxx>
  • To: kostja@xxxxxxxxxxxxx
  • Date: Fri, 27 Jul 2018 14:30:02 +0300

For some reason, vy_stmt_new_surrogate_delete() checks that the source
tuple has all fields mandated by the space format (min_field_count).
This is pointless, because to generate a surrogate DELETE statement, we
don't need all tuple fields - if a field is absent it will be replaced
with NULL. We haven't stepped on this assertion, because we always
create surrogate DELETEs from full tuples. However, to implement #2129
we need to be able to create surrogate DELETEs from tuples that only
have indexed fields. So let's remove this assertion.

Needed for #2129
---
 src/box/vy_stmt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/box/vy_stmt.c b/src/box/vy_stmt.c
index f4c3dd18..0bf53cbf 100644
--- a/src/box/vy_stmt.c
+++ b/src/box/vy_stmt.c
@@ -404,7 +404,6 @@ vy_stmt_new_surrogate_delete_raw(struct tuple_format 
*format,
 
        const char *src_pos = src_data;
        uint32_t src_count = mp_decode_array(&src_pos);
-       assert(src_count >= format->min_field_count);
        uint32_t field_count;
        if (src_count < format->index_field_count) {
                field_count = src_count;
-- 
2.11.0


Other related posts:

  • » [tarantool-patches] [PATCH 22/25] vinyl: remove pointless assertion from vy_stmt_new_surrogate_delete - Vladimir Davydov