Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 2/3] box: forbid to update/replace _space_sequence
Date: Sat, 22 Feb 2020 17:16:49 +0100	[thread overview]
Message-ID: <5b5028aa-e86a-d9a3-26f0-881da87b0ff5@tarantool.org> (raw)
In-Reply-To: <20200221152934.GD51816@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;

  reply	other threads:[~2020-02-22 16:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 20:57 [Tarantool-patches] [PATCH 0/3] Fix upgrade from 2.1 sequence Vladislav Shpilevoy
2020-02-17 20:57 ` [Tarantool-patches] [PATCH 1/3] upgrade: add missing sys triggers off and erasure Vladislav Shpilevoy
2020-02-21 15:20   ` Nikita Pettik
2020-02-22 16:17     ` Vladislav Shpilevoy
2020-02-17 20:57 ` [Tarantool-patches] [PATCH 2/3] box: forbid to update/replace _space_sequence Vladislav Shpilevoy
2020-02-21 15:29   ` Nikita Pettik
2020-02-22 16:16     ` Vladislav Shpilevoy [this message]
2020-02-17 20:57 ` [Tarantool-patches] [PATCH 3/3] upgrade: fix generated sequence upgrade from 2.1 Vladislav Shpilevoy
2020-02-21 15:42   ` Nikita Pettik
2020-02-22 16:16     ` Vladislav Shpilevoy
2020-02-24 19:48 ` [Tarantool-patches] [PATCH 0/3] Fix upgrade from 2.1 sequence Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b5028aa-e86a-d9a3-26f0-881da87b0ff5@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/3] box: forbid to update/replace _space_sequence' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox