From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 393D72DD32 for ; Mon, 29 Oct 2018 15:02:16 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JqFf7xIVtnmN for ; Mon, 29 Oct 2018 15:02:16 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8B6372DCBD for ; Mon, 29 Oct 2018 15:02:15 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH 0/2] Re-implement rowid generation for ephemeral spaces Date: Mon, 29 Oct 2018 22:02:04 +0300 Message-Id: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Nikita Pettik Branch: https://github.com/tarantool/tarantool/tree/np/gh-3297-ephemeral-rowid Issue: https://github.com/tarantool/tarantool/issues/3297 This patch-set fixes incorrect rowid generation for ephemeral spaces. To achieve this, we introduce separate method in space's vtab, which currently available only for memtx engine (as well as ephemeral spaces). It simply increments built-in counter and returs new rowid. It allows us to get rid of calling index_max() which obviously was wrong way at calcucaling next id (since rowid field is taken to be last in stored tuples). Nikita Pettik (2): space: add method to fetch next rowid sql: use vtab::rowid_next() instead of index_max() src/box/blackhole.c | 1 + src/box/errcode.h | 2 ++ src/box/memtx_space.c | 17 ++++++++++++ src/box/memtx_space.h | 7 +++++ src/box/space.c | 9 +++++++ src/box/space.h | 3 +++ src/box/sql.c | 28 +------------------ src/box/sql/insert.c | 17 +++--------- src/box/sql/select.c | 12 ++++----- src/box/sql/tarantoolInt.h | 13 --------- src/box/sql/vdbe.c | 39 +++++++++++++++++---------- src/box/sysview.c | 1 + src/box/vinyl.c | 1 + src/errinj.h | 1 + test/box/errinj.result | 2 ++ test/box/misc.result | 1 + test/sql-tap/gh-3297-ephemeral-rowid.test.lua | 30 +++++++++++++++++++++ test/sql/errinj.result | 15 +++++++++++ test/sql/errinj.test.lua | 7 +++++ 19 files changed, 132 insertions(+), 74 deletions(-) create mode 100755 test/sql-tap/gh-3297-ephemeral-rowid.test.lua -- 2.15.1