Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v2 3/3] schema: expose space_mt and index_mt on box.schema table
Date: Tue, 8 May 2018 20:33:25 +0300	[thread overview]
Message-ID: <a0cf8448-8eee-6fb3-23f1-24b0d9de4032@tarantool.org> (raw)
In-Reply-To: <20180508164814.GC20248@atlas>

Hello. Thanks for review!

On 08/05/2018 19:48, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [18/05/05 23:23]:
> 
> This branch breaks app/luafun.test.lua

Sorry, just noticed that my auto test-runner script skips app/ directory.

Fixed on the branch. The problem was that luafun expects that space/index
metatable contains __ipairs/__pairs metamethods with not proxy via __index.

@@ -1449,7 +1449,12 @@ box.schema.space_mt = space_mt
  -- up at first in self, and only then into the global mt.
  --
  local function wrap_schema_object_mt(name)
-    local mt = { __index = box.schema[name] }
+    local global_mt = box.schema[name]
+    local mt = {
+        __index = global_mt,
+        __ipairs = global_mt.__ipairs,
+        __pairs = global_mt.__pairs
+    }
      local mt_mt = {}
      mt_mt.__newindex = function(t, k, v)
          mt_mt.__newindex = nil  

> 
>> Users requested to be able to extend spaces individually. The
>> patch was reworked to allow this.
>>
>> On 03/04/2018 19:50, Vladislav Shpilevoy wrote:
>>> This commit allows userland to extend the space and index
>>> metatables with their own functions or even metamethods. Reducing
>>> barriers for this kind of experimentation is vital for user
>>> contribution toward the improvement of Tarantool's API.
>>>
>>> There are 4 metatables available for extending:
>>> box.schema.space_mt - metatable of all spaces;
>>> box.schema.index_mt - base metatable of all indexes - replicated
>>>                        into the vinyl and memtx. See below how.
>>> box.schema.vinyl_index_mt - metatable of all vinyl indexes;
>>> box.schema.memtx_index_mt - metatable of all memtx indexes.
>>>
>>> Closes #3204
> 

  reply	other threads:[~2018-05-08 17:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 13:07 [PATCH 0/2] schema: expose space_mt and index_mt on table Vladislav Shpilevoy
2018-03-23 13:07 ` [PATCH 1/2] schema: expose space_mt and index_mt on `box.schema` table Vladislav Shpilevoy
2018-03-23 13:07 ` [PATCH 2/2] schema: review fixes for box.schema.space/index metatables Vladislav Shpilevoy
2018-03-29 10:54 ` [PATCH 0/2] schema: expose space_mt and index_mt on table Vladimir Davydov
2018-03-29 14:31   ` [PATCH v2 0/2] schema: expose space_mt and index_mt on box.schema table Vladislav Shpilevoy
2018-03-29 14:31     ` [PATCH v2 1/2] schema: move space_mt and index_mt definition out of space bless Vladislav Shpilevoy
2018-04-01  9:33       ` Vladimir Davydov
2018-04-01 11:02         ` [PATCH 0/2] schema: expose space_mt and index_mt on box.schema table Vladislav Shpilevoy
2018-04-01 11:02           ` [PATCH 1/2] schema: move space_mt and index_mt definition out of space bless Vladislav Shpilevoy
2018-04-01 11:02           ` [PATCH 2/2] schema: expose space_mt and index_mt on `box.schema` table Vladislav Shpilevoy
2018-04-02 11:28             ` Vladimir Davydov
2018-04-03 16:50               ` [PATCH v2 0/3] schema: expose space_mt and index_mt on box.schema table Vladislav Shpilevoy
2018-04-03 16:50                 ` [PATCH v2 1/3] schema: move space_mt and index_mt definition out of space bless Vladislav Shpilevoy
2018-04-03 16:50                 ` [PATCH v2 2/3] schema: inherit vinyl/memtx_index_mt from base index mt Vladislav Shpilevoy
2018-04-03 16:50                 ` [PATCH v2 3/3] schema: expose space_mt and index_mt on box.schema table Vladislav Shpilevoy
2018-05-05 12:47                   ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-08 16:48                     ` Konstantin Osipov
2018-05-08 17:33                       ` Vladislav Shpilevoy [this message]
2018-03-29 14:31     ` [PATCH v2 2/2] schema: expose space_mt and index_mt on `box.schema` table Vladislav Shpilevoy
2018-04-01  9:37     ` [PATCH v2 0/2] schema: expose space_mt and index_mt on box.schema table Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0cf8448-8eee-6fb3-23f1-24b0d9de4032@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 3/3] schema: expose space_mt and index_mt on box.schema table' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox