From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7486F20A6D for ; Mon, 10 Dec 2018 06:17:58 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XYZJM5ciWHMw for ; Mon, 10 Dec 2018 06:17:58 -0500 (EST) 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 turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 30857208F9 for ; Mon, 10 Dec 2018 06:17:58 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH] sql: disallow to rename space if it is referenced by view References: <20181209155735.32694-1-korablev@tarantool.org> From: Vladislav Shpilevoy Message-ID: <01a74281-43c6-d68d-1cd5-daecc62071ad@tarantool.org> Date: Mon, 10 Dec 2018 14:17:55 +0300 MIME-Version: 1.0 In-Reply-To: <20181209155735.32694-1-korablev@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: Nikita Pettik , tarantool-patches@freelists.org Hi! Thanks for the patch! LGTM. On 09/12/2018 18:57, Nikita Pettik wrote: > Before this patch it was allowed to rename space which is referenced by > a view. In turn, view contains SELECT statement in a raw form (i.e. as a > string) and it is not modified during renaming routine. Hence, after > renaming space still has referencing counter > 0, but no usage of view > is allowed (since execution of SELECT results in "Space does not > exist"). To avoid such situations, lets ban renaming space if its view > reference counter > 0. > > Note that RENAME is ANSI extension, so different DBs behave in this case > in different ways - some of them allow to rename tables referenced by a > view (PostgreSQL), others - don't (Oracle). > > Closes #3746 > --- > Branch: https://github.com/tarantool/tarantool/tree/np/gh-3746-view-rename > Issue: https://github.com/tarantool/tarantool/issues/3746 >