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

sergeyb at tarantool.org sergeyb at tarantool.org
Tue Apr 21 17:00:25 MSK 2020


From: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>

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.
---
 src/box/lua/schema.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/box/lua/schema.lua b/src/box/lua/schema.lua
index 0beb66510..4d0451848 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
-- 
2.23.0



More information about the Tarantool-patches mailing list