Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Roman Khabibov <roman.habibov@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] box: disallow to modify format of a view
Date: Thu, 24 Sep 2020 22:59:19 +0200	[thread overview]
Message-ID: <0785ca58-7933-0b97-9dba-15882a8b7c75@tarantool.org> (raw)
In-Reply-To: <20200922155903.48421-1-roman.habibov@tarantool.org>

Hi! Thanks for the patch!

> diff --git a/src/box/alter.cc b/src/box/alter.cc
> index ba96d9c62..4d0da347a 100644
> --- a/src/box/alter.cc
> +++ b/src/box/alter.cc
> @@ -2441,6 +2467,20 @@ on_replace_dd_space(struct trigger * /* trigger */, void *event)
>  				  "view");
>  			return -1;
>  		}
> +		if (def->opts.is_view && old_space->def->field_count !=
> +		    def->field_count) {
> +			diag_set(ClientError, ER_ALTER_SPACE,
> +				 space_name(old_space),
> +				 "can not modify field count of a view");
> +			return -1;
> +		}
> +		if (def->opts.is_view && format_is_changed(old_tuple,
> +							   new_tuple)) {
> +			diag_set(ClientError, ER_ALTER_SPACE,
> +				 space_name(old_space),
> +				 "can not modify format of a view");
> +			return -1;
> +		}

Wouldn't it be easier to just prohibit update of such
tuple completely? Raise an error if new_tuple != NULL and
old_tuple != NULL and the space is a view.

  reply	other threads:[~2020-09-24 20:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22 15:59 Roman Khabibov
2020-09-24 20:59 ` Vladislav Shpilevoy [this message]
2020-09-25 10:18   ` Roman Khabibov
2020-09-25 20:14 ` Vladislav Shpilevoy
2020-09-26 13:01   ` Roman Khabibov
2020-09-28 15:52     ` Nikita Pettik
2020-09-28 18:41       ` Vladislav Shpilevoy
2020-09-28 23:50         ` Nikita Pettik
2020-10-01 22:35           ` Vladislav Shpilevoy
2020-10-02 11:13             ` Nikita Pettik

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=0785ca58-7933-0b97-9dba-15882a8b7c75@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=roman.habibov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] box: disallow to modify format of a view' \
    /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