Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 59210 invoked from network); 1 Aug 2005 19:57:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2005 19:57:49 -0000 Received: (qmail 65566 invoked by uid 500); 1 Aug 2005 19:57:47 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 65525 invoked by uid 500); 1 Aug 2005 19:57:47 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 65511 invoked by uid 99); 1 Aug 2005 19:57:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2005 12:57:47 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=HTML_20_30,HTML_MESSAGE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of msatoor@gmail.com designates 64.233.184.204 as permitted sender) Received: from [64.233.184.204] (HELO wproxy.gmail.com) (64.233.184.204) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2005 12:57:37 -0700 Received: by wproxy.gmail.com with SMTP id i17so1067116wra for ; Mon, 01 Aug 2005 12:57:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=WYzbgKnACSgmVHaT8ULFZVPPIQmYDPYZVaYMY/tK/MV1Z6qRDS6AhfXqodlEifK8SrBaZMkB/QeSxO4UyMx55zQ5PusFeTuSP9b+z+j/kBTAyxxg1gNeA/45GM4ATIEM0MsTh+Ghozc0jFL5DyTxLBHrq2lPhnojNnVaB0SHkFA= Received: by 10.54.57.62 with SMTP id f62mr3179951wra; Mon, 01 Aug 2005 12:57:44 -0700 (PDT) Received: by 10.54.146.11 with HTTP; Mon, 1 Aug 2005 12:57:44 -0700 (PDT) Message-ID: Date: Mon, 1 Aug 2005 12:57:44 -0700 From: Mamta Satoor Reply-To: Mamta Satoor To: Derby Development Subject: Re: [PATCH] (DERBY-7) Bug in NULLIF Function In-Reply-To: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2766_6330098.1122926264486" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2766_6330098.1122926264486 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, Just got back from 3-weeks vacation and I see that patch for Derby-7 NULLI= F=20 function is still waiting to be committed/reviewed for a long time now. I= =20 was wondering if someone can take a look and see if it is all ready to be= =20 committed. thanks, Mamta On 6/12/05, Mamta Satoor wrote:=20 >=20 > Hi, > I have attached a patch in JIRA to Derby-7 to fix the NULLIF problem. Th= e=20 > test suites have run fine with the exception of miserrors. Since the time= I=20 > posted the patch, I saw subsequent emails about miscerror failure possibl= y=20 > related to checkin from David Van Couvering. David I think has already=20 > posted a patch on the list to fix the failure.=20 > I have copied the description of the fix from the JIRA here for=20 > reference.=20 > "Following is a brief description of what the proposed fix involves.=20 > For NULLIF(L,R), parser will generate CASE L=3DR then untyped NULL else L= .=20 > Notice that the NULL does not have any type associated with it during=20 > parsing. This change went into sqlgrammar.jj=20 > The existing code in ConditionalNode.bindExpression first binds the=20 > condition L=3DR. At the end of L=3DR condition binding, we will have dete= rmined=20 > the type of operand L. I have added cod into ConditionalNode to CAST unty= ped=20 > NULL to the type of L. The exisiting code for L=3DR binding enforces the= =20 > Reference Guide Table 1. Comparisons allowed by Derby on page 111 and 112= .=20 > So answers for what datatypes can be combined in NULLIF can be explained= =20 > by that table.=20 > I have added some tests to see what the return type of NULLIF would be fo= r=20 > various combinations of :L and R datatypes. I have also added test cases= =20 > where the first operand to NULLIF is a parameter.=20 >=20 > All the tests pass except one failure below which I don't think is relate= d=20 > to my changes=20 > *** Start: miscerrors jdk1.4.2_07 derbyall:derbylang 2005-06-10 01:43:31= =20 > ***=20 > 35 del=20 > < xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |92 |0 | wombat | null=20 > |Cleanup action starting=20 > 36 del=20 > < xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |92 |0 | wombat | null |Faile= d=20 > Statement is: --=20 > 37 del=20 > < xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |97 |0 | wombat | null=20 > |Cleanup action starting=20 > 38 del=20 > < xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |97 |0 | wombat | null |Faile= d=20 > Statement is: create table a (one int, two int)=20 > 39 del=20 > < xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |100 |0 | wombat | null=20 > |Cleanup action starting=20 > 40 del=20 > < xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |100 |0 | wombat | null=20 > |Failed Statement is: create table a (one int)=20 > 40a35,40=20 > > xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |91 |0 | wombat | null=20 > |Cleanup action starting=20 > > xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |91 |0 | wombat | null |Faile= d=20 > Statement is: --=20 > > xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |96 |0 | wombat | null=20 > |Cleanup action starting=20 > > xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |96 |0 | wombat | null |Faile= d=20 > Statement is: create table a (one int, two int)=20 > > xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |99 |0 | wombat | null=20 > |Cleanup action starting=20 > > xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |99 |0 | wombat | null |Faile= d=20 > Statement is: create table a (one int)=20 > Test Failed.=20 > *** End: miscerrors jdk1.4.2_07 derbyall:derbylang 2005-06-10 01:43:48 **= *=20 >=20 >=20 >=20 > Output of svn stat=20 > M java\engine\org\apache\derby\impl\sql\compile\ConditionalNode.java=20 > M java\engine\org\apache\derby\impl\sql\compile\sqlgrammar.jj=20 > M=20 > java\testing\org\apache\derbyTesting\functionTests\tests\lang\coalesceTes= ts.java=20 >=20 > M=20 > java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\resultse= t.java=20 >=20 > M=20 > java\testing\org\apache\derbyTesting\functionTests\master\DerbyNet\result= set.out=20 >=20 > M=20 > java\testing\org\apache\derbyTesting\functionTests\master\DerbyNetClient\= resultset.out=20 >=20 > M java\testing\org\apache\derbyTesting\functionTests\master\resultset.out= =20 > If everything looks good and no one has comments, can a commiter please= =20 > commit this patch? > Mamta > ------=_Part_2766_6330098.1122926264486 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi,
 
Just got back from 3-weeks vacation and I see that patch for Derb= y-7 NULLIF function is still waiting to be committed/reviewed for a long ti= me now. I was wondering if someone can take a look and see if it is all rea= dy to be committed.
 
thanks,
Mamta
 
On 6/12/05, = Mamta Satoor <msatoor@gmail.com= > wrote:
Hi,
 
I have attached a patch in JIRA to Derby-7 to fix the = NULLIF problem. The test suites have run fine with the exc= eption of miserrors. Since the time I posted the=20 patch, I saw subsequent em= ails about miscerror failure possibly related to checkin from David Va= n Couvering. David I think has already posted a patch on the list to fix the failure. 
 
I have copied the description of the fix from the JIRA here for refere= nce.  
 
"Following is a brief description of what the proposed fix involv= es.
For NULLIF(L,R), p= arser will generate CASE L=3DR then untyped NULL else L. Notice that the NU= LL does not have any type associated with it during parsing. This change we= nt into=20 sqlgrammar.jj
The existing code in ConditionalNode.bindExpression first= binds the condition L=3DR. At the end of L=3DR condition binding, we will = have determined the type of operand L. I have added cod into ConditionalNod= e to CAST untyped NULL to the type of L. The exisiting code for L=3DR bindi= ng enforces the Reference Guide Table 1. Comparisons allowed by Derby on pa= ge 111 and 112. So answers for what datatypes can be combined in=20 NULLIF can be explained by= that table.
I have added some tests to see what the return type of NULLIF would be for various c= ombinations of :L and R datatypes. I have also added test cases where the f= irst operand to=20 NULLIF is a parameter.
All the tests pass except one failure below which I don't think is rel= ated to my changes
*** Start: miscerrors jdk1.4.2_07 derbyall:derbylang= 2005-06-10 01:43:31 ***=20
35 del
< xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |92 |0 | womb= at | null |Cleanup action starting
36 del
< xxxxxxFILTERED-TIMES= TAMPxxxxx|main,5,main |92 |0 | wombat | null |Failed Statement is: --
37 del
< xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |97 |0 | wombat |= null |Cleanup action starting
38 del
< xxxxxxFILTERED-TIMESTAMP= xxxxx|main,5,main |97 |0 | wombat | null |Failed Statement is: create table= a (one int, two int)=20
39 del
< xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |100 |0 | wom= bat | null |Cleanup action starting
40 del
< xxxxxxFILTERED-TIME= STAMPxxxxx|main,5,main |100 |0 | wombat | null |Failed Statement is: create= table a (one int)=20
40a35,40
> xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |91 |0 | wo= mbat | null |Cleanup action starting
> xxxxxxFILTERED-TIMESTAMPxxxxx= |main,5,main |91 |0 | wombat | null |Failed Statement is: --
> xxxxx= xFILTERED-TIMESTAMPxxxxx|main,5,main |96 |0 | wombat | null |Cleanup action= starting=20
> xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |96 |0 | wombat | null |= Failed Statement is: create table a (one int, two int)
> xxxxxxFILTE= RED-TIMESTAMPxxxxx|main,5,main |99 |0 | wombat | null |Cleanup action start= ing=20
> xxxxxxFILTERED-TIMESTAMPxxxxx|main,5,main |99 |0 | wombat | null |= Failed Statement is: create table a (one int)
Test Failed.
*** End:= miscerrors jdk1.4.2_07 derbyall:derbylang 2005-06-10 01:43:48 ***


Output of svn stat
M java\engine\org\apache\derby\impl\sql\comp= ile\ConditionalNode.java
M java\engine\org\apache\derby\impl\sql\compil= e\sqlgrammar.jj
M java\testing\org\apache\derbyTesting\functionTests\te= sts\lang\coalesceTests.java=20
M java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\resu= ltset.java
M java\testing\org\apache\derbyTesting\functionTests\master\= DerbyNet\resultset.out
M java\testing\org\apache\derbyTesting\functionT= ests\master\DerbyNetClient\resultset.out=20
M java\testing\org\apache\derbyTesting\functionTests\master\resultset.o= ut
 
If everything looks good and no one has comments, can a commiter pleas= e commit this patch?
=
Mamta

------=_Part_2766_6330098.1122926264486--