From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5A076469719 for ; Fri, 21 Feb 2020 18:20:24 +0300 (MSK) Date: Fri, 21 Feb 2020 18:20:23 +0300 From: Nikita Pettik Message-ID: <20200221152023.GC51816@tarantool.org> References: <2637883c072d078cf970a90a9d5b21164380ebd1.1581972845.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2637883c072d078cf970a90a9d5b21164380ebd1.1581972845.git.v.shpilevoy@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/3] upgrade: add missing sys triggers off and erasure List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org 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 >