[Tarantool-patches] [PATCH v3 8/6] schema: fix internal symbols dangling in _G

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Apr 15 02:30:41 MSK 2020


    
    A couple of functions were mistakenly declared as 'function'
    instead of 'local function' in schema.lua. That led to their
    presence in the global namespace.

diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua
index ad4a5470b..80e67a82a 100644
--- a/src/box/lua/schema.lua
+++ b/src/box/lua/schema.lua
@@ -350,7 +350,7 @@ end
 -- box.commit yields, so it's defined as Lua/C binding
 -- box.rollback and box.rollback_to_savepoint yields as well
 
-function update_format(format)
+local function update_format(format)
     local result = {}
     for i, given in ipairs(format) do
         local field = {}
@@ -2639,7 +2639,7 @@ box.schema.role.drop = function(name, opts)
     return drop(uid)
 end
 
-function role_check_grant_revoke_of_sys_priv(priv)
+local function role_check_grant_revoke_of_sys_priv(priv)
     priv = string.lower(priv)
     if (type(priv) == 'string' and (priv:match("session") or priv:match("usage"))) or
         (type(priv) == "number" and (bit.band(priv, 8) ~= 0 or bit.band(priv, 16) ~= 0)) then


More information about the Tarantool-patches mailing list