Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 32000 invoked from network); 14 Jul 2006 17:42:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jul 2006 17:42:07 -0000 Received: (qmail 31282 invoked by uid 500); 14 Jul 2006 17:42:07 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 31058 invoked by uid 500); 14 Jul 2006 17:42:06 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 31049 invoked by uid 99); 14 Jul 2006 17:42:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 10:42:06 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of msatoor@gmail.com designates 66.249.82.202 as permitted sender) Received: from [66.249.82.202] (HELO wx-out-0102.google.com) (66.249.82.202) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 10:42:05 -0700 Received: by wx-out-0102.google.com with SMTP id s13so305696wxc for ; Fri, 14 Jul 2006 10:41:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=HAM/eAUNNPPAFDOvb23vOxYRuPdQH37a8l7W42DUIYq/6xxZ8tNkieERRSLM9EnPYpKzACWOnk/yRlQZsoHlXTMW2Vkf9NO7RfV8UeolDtwAaVkh/ekv+/pUEa5eCW77Stx+jBK/BcJd+VO5yjDxce2OOrPuZH1KJHfnKaksDxM= Received: by 10.70.12.2 with SMTP id 2mr3484070wxl; Fri, 14 Jul 2006 10:41:44 -0700 (PDT) Received: by 10.70.21.10 with HTTP; Fri, 14 Jul 2006 10:41:44 -0700 (PDT) Message-ID: Date: Fri, 14 Jul 2006 10:41:44 -0700 From: "Mamta Satoor" To: derby-dev@db.apache.org Subject: Re: DERBY-396: Drop Column dependency questions In-Reply-To: <44B7CAB9.3060709@apache.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_20229_29174491.1152898904812" References: <1516417.1152061955352.JavaMail.jira@brutus> <44AC9374.8090304@amberpoint.com> <44B283E4.5090504@sun.com> <44B7C722.4000102@amberpoint.com> <44B7CAB9.3060709@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_20229_29174491.1152898904812 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I think in RESTRICT mode, revoking the privileges should be done as one of the last steps, ie after we have checked for dependent objects. If there are dependent objects. DROP COLUMN RESTRICT will fail. If there are no dependent objects, then revoke privileges should simply work because there couldn't be any objects dependent on those privileges at this point in the code. And I tend to agree with Dan that DROP COLUMN RESTRICT shouldn't throw exception just because there are privileges granted on it. If there are no objects based on those privileges, it should be fine to REVOKE them. But, I haven't looked at the spec to verify this behavior. Mamta On 7/14/06, Daniel John Debrunner wrote: > > Bryan Pendleton wrote: > > > Hi Mamta, thank you for investigating this. > > > >> DROP COLUMN will also need to see if there are any privileges granted > >> on it and if yes, then those privileges should be revoked. > > > > > > That makes sense to me, too. > > > > I am proposing to have the ALTER TABLE DROP COLUMN statement call the > > already-existing code in AlterTableConstantAction.java, specifically > > the dropColumnFromTable() method. > > > > I am proposing to implement both CASCADE and RESTRICT, using the > existing > > cascade/restrict functionality in the dropColumnFromTable() method. > > > > So I think that we just need to add the appropriate code to this method > > for privileges, and then we should be fine. It sounds like we need some > > code which looks for privileges granted on this column, and if there are > > any, then if this is RESTRICT, throw an exception, otherwise > automatically > > revoke those privileges. > > I don't think that matches the SQL spec. From a quick look I don't see > any text that stops the drop in restrict mode if privileges have been > granted on the column. > > Dan. > > ------=_Part_20229_29174491.1152898904812 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
I think in RESTRICT mode, revoking the privileges should be done as one of the last steps, ie after we have checked for dependent objects. If there are dependent objects. DROP COLUMN RESTRICT will fail. If there are no dependent objects, then revoke privileges should simply work because there couldn't be any objects dependent on those privileges at this point in the code. And I tend to agree with Dan that DROP COLUMN RESTRICT shouldn't throw exception just because there are privileges granted on it. If there are no objects based on those privileges, it should be fine to REVOKE them. But, I haven't looked at the spec to verify this behavior.
 
Mamta

 
On 7/14/06, Daniel John Debrunner <djd@apache.org> wrote:
Bryan Pendleton wrote:

> Hi Mamta, thank you for investigating this.
>
>> DROP COLUMN will also need to see if there are any privileges granted
>> on it and if yes, then those privileges should be revoked.
>
>
> That makes sense to me, too.
>
> I am proposing to have the ALTER TABLE DROP COLUMN statement call the
> already-existing code in AlterTableConstantAction.java, specifically
> the dropColumnFromTable() method.
>
> I am proposing to implement both CASCADE and RESTRICT, using the existing
> cascade/restrict functionality in the dropColumnFromTable() method.
>
> So I think that we just need to add the appropriate code to this method
> for privileges, and then we should be fine. It sounds like we need some
> code which looks for privileges granted on this column, and if there are
> any, then if this is RESTRICT, throw an exception, otherwise automatically
> revoke those privileges.

I don't think that matches the SQL spec. From a quick look I don't see
any text that stops the drop in restrict mode if privileges have been
granted on the column.

Dan.


------=_Part_20229_29174491.1152898904812--