[Tarantool-patches] [PATCH] box: disallow to modify format of a view
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Thu Sep 24 23:59:19 MSK 2020
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.
More information about the Tarantool-patches
mailing list