From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp62.i.mail.ru (smtp62.i.mail.ru [217.69.128.42]) (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 A16D9469719 for ; Sat, 22 Feb 2020 19:16:52 +0300 (MSK) References: <79a6254a868ee44517921a0c89af29d44dd2c4b8.1581972845.git.v.shpilevoy@tarantool.org> <20200221152934.GD51816@tarantool.org> From: Vladislav Shpilevoy Message-ID: <5b5028aa-e86a-d9a3-26f0-881da87b0ff5@tarantool.org> Date: Sat, 22 Feb 2020 17:16:49 +0100 MIME-Version: 1.0 In-Reply-To: <20200221152934.GD51816@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2/3] box: forbid to update/replace _space_sequence List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org Thanks for the review! On 21/02/2020 16:29, Nikita Pettik wrote: > On 17 Feb 21:57, Vladislav Shpilevoy wrote: >> diff --git a/src/box/alter.cc b/src/box/alter.cc >> index 64af71c61..50121c79c 100644 >> --- a/src/box/alter.cc >> +++ b/src/box/alter.cc >> @@ -4713,9 +4713,13 @@ on_replace_dd_space_sequence(struct trigger * /* trigger */, void *event) >> return -1; >> } > > LGTM > > Nit: as always I'd only add brief comment like: Done. New hunk is below. Also I changed (stmt->new_tuple != NULL) == (stmt->old_tuple != NULL) to stmt->new_tuple != NULL && stmt->old_tuple != NULL Because both of the tuples can't be NULL anyway. diff --git a/src/box/alter.cc b/src/box/alter.cc index 64af71c61..d73679fb8 100644 --- a/src/box/alter.cc +++ b/src/box/alter.cc @@ -4712,10 +4712,17 @@ on_replace_dd_space_sequence(struct trigger * /* trigger */, void *event) diag_set(ClientError, ER_NO_SUCH_SEQUENCE, int2str(sequence_id)); return -1; } - + if (stmt->new_tuple != NULL && stmt->old_tuple != NULL) { + /* + * Makes no sense to support update, it would + * complicate the code, and won't simplify + * anything else. + */ + diag_set(ClientError, ER_UNSUPPORTED, + "space \"_space_sequence\"", "update"); + return -1; + } enum priv_type priv_type = stmt->new_tuple ? PRIV_C : PRIV_D; - if (stmt->new_tuple && stmt->old_tuple) - priv_type = PRIV_A;