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 6E7912F4BB for ; Sat, 17 Nov 2018 08:17:01 -0500 (EST) 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 uH603M1gnkZG for ; Sat, 17 Nov 2018 08:17:01 -0500 (EST) 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 F2B5A2F49F for ; Sat, 17 Nov 2018 08:17:00 -0500 (EST) From: Kirill Shcherbatov Subject: [tarantool-patches] [PATCH v1 1/2] box: refactor index termination on space drop Date: Sat, 17 Nov 2018 16:16:54 +0300 Message-Id: <6ceb36f5312d5495efa4823961e41205e6c4a317.1542460247.git.kshcherbatov@tarantool.org> In-Reply-To: References: In-Reply-To: References: 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: georgy@tarantool.org, Kirill Shcherbatov Drop indexes via index object metamethod call instead of direct _index space tuple deletion. With functional indexes patch drop metamethod would be redefined to make an extra service operations during index deletion. Need for #1260 --- src/box/lua/schema.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua index 8a804f0..b6693b1 100644 --- a/src/box/lua/schema.lua +++ b/src/box/lua/schema.lua @@ -524,7 +524,8 @@ box.schema.space.drop = function(space_id, space_name, opts) local keys = _vindex:select(space_id) for i = #keys, 1, -1 do local v = keys[i] - _index:delete{v[1], v[2]} + local index = box.space[space_id].index[v[2]] + index:drop() end for _, t in _fk_constraint.index.child_id:pairs({space_id}) do _fk_constraint:delete({t.name, space_id}) -- 2.7.4