[Tarantool-patches] [PATCH 1/3] upgrade: add missing sys triggers off and erasure
Nikita Pettik
korablev at tarantool.org
Fri Feb 21 18:20:23 MSK 2020
On 17 Feb 21:57, Vladislav Shpilevoy wrote:
LGTM
> +local function foreach_system_space(cb)
> + local max = box.schema.SYSTEM_ID_MAX
> + for id, space in pairs(box.space) do
Nit: I'd add brief comment explaining that here we are interested
only in 'native' system spaces skipping sysviews etc.
> + if type(id) == 'number' and
> + (space.engine == 'memtx' or space.engine == 'vinyl') then
> + if id > max then
> + break
> + end
> + cb(space)
> + end
> + end
> +end
> +
> local function set_system_triggers(val)
> - box.space._space:run_triggers(val)
> - box.space._index:run_triggers(val)
> - box.space._user:run_triggers(val)
> - box.space._func:run_triggers(val)
> - box.space._priv:run_triggers(val)
> - box.space._trigger:run_triggers(val)
> - box.space._collation:run_triggers(val)
> - box.space._schema:run_triggers(val)
> - box.space._cluster:run_triggers(val)
> - box.space._fk_constraint:run_triggers(val)
> - box.space._ck_constraint:run_triggers(val)
> + foreach_system_space(function(s) s:run_triggers(val) end)
> end
>
More information about the Tarantool-patches
mailing list