[tarantool-patches] [PATCH v1 1/2] box: refactor index termination on space drop

Kirill Shcherbatov kshcherbatov at tarantool.org
Sat Nov 17 16:16:54 MSK 2018


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





More information about the Tarantool-patches mailing list