You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ma...@apache.org on 2007/07/31 22:48:40 UTC

svn commit: r561514 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java

Author: mamta
Date: Tue Jul 31 13:48:39 2007
New Revision: 561514

URL: http://svn.apache.org/viewvc?view=rev&rev=561514
Log:
Adding comment to the function that was added for DERBY-2793


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java?view=diff&rev=561514&r1=561513&r2=561514
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java Tue Jul 31 13:48:39 2007
@@ -1155,6 +1155,25 @@
 		return false;
 	}
 	
+	/**
+	 * Compare the collation info on this DTD with the passed DTD. The rules
+	 * are as follows
+	 * 1)If both the DTDs have collation derivation of NONE, then they can't be
+	 * compared and we return false.
+	 * 2)If both the DTDs have same collation derivation (which in Derby's case
+	 * at this point will mean collation derivation of IMPLICIT), then check
+	 * the collation types. If they match, then return true. If they do not 
+	 * match, then they can't be compared and hence return false.
+	 * 
+	 * In future, when we do support collation derivation of EXPLICIT, we will
+	 * need to change this method so that we follow the correct SQL standard
+	 * rules about what should happen if one collation derivation is EXPLICIT
+	 * and other is NONE/IMPLICIT.
+	 * 
+	 * @param compareWithDTD compare this DTD's collation info
+	 *  
+	 * @return value depends on the algorithm above.
+	 */
 	public boolean compareCollationInfo(DataTypeDescriptor compareWithDTD){
 		//both the operands can not have the collation derivation of
 		//NONE. This is because in that case, we do not know what kind



Re: svn commit: r561514 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java

Posted by Mamta Satoor <ms...@gmail.com>.
Yes, that is Jira entry DERBY-2678 (Derby should follow SQL standards when
operand(s) in the collation operation have collation derivation of NONE). I
agree that we should mention that in the method comments and I will also
update DERBY-2678 that changes will be needed in the method when we work on
DERBY-2678.

Mamta


On 7/31/07, Daniel John Debrunner <dj...@apache.org> wrote:
>
> mamta@apache.org wrote:
> > Author: mamta
> > Date: Tue Jul 31 13:48:39 2007
> > New Revision: 561514
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=561514
> > Log:
> > Adding comment to the function that was added for DERBY-2793
> >
> >
> > Modified:
> >
> db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
> >
> > Modified:
> db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
> > URL:
> http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java?view=diff&rev=561514&r1=561513&r2=561514
> >
> ==============================================================================
> > ---
> db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
> (original)
> > +++
> db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
> Tue Jul 31 13:48:39 2007
> > @@ -1155,6 +1155,25 @@
> >               return false;
> >       }
> >
> > +     /**
> > +      * Compare the collation info on this DTD with the passed DTD. The
> rules
> > +      * are as follows
> > +      * 1)If both the DTDs have collation derivation of NONE, then they
> can't be
> > +      * compared and we return false.
> > +      * 2)If both the DTDs have same collation derivation (which in
> Derby's case
> > +      * at this point will mean collation derivation of IMPLICIT), then
> check
> > +      * the collation types. If they match, then return true. If they
> do not
> > +      * match, then they can't be compared and hence return false.
> > +      *
> > +      * In future, when we do support collation derivation of EXPLICIT,
> we will
> > +      * need to change this method so that we follow the correct SQL
> standard
> > +      * rules about what should happen if one collation derivation is
> EXPLICIT
> > +      * and other is NONE/IMPLICIT.
>
> Isn't it true that even without supporting EXPLICT that algorithm in the
> method is a subset of the SQL standard? IMPLICIT,NONE should succeed,
> but will fail with this algorithm.
>
> Dan.
>
>

Re: svn commit: r561514 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java

Posted by Daniel John Debrunner <dj...@apache.org>.
mamta@apache.org wrote:
> Author: mamta
> Date: Tue Jul 31 13:48:39 2007
> New Revision: 561514
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=561514
> Log:
> Adding comment to the function that was added for DERBY-2793
> 
> 
> Modified:
>     db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
> 
> Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
> URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java?view=diff&rev=561514&r1=561513&r2=561514
> ==============================================================================
> --- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java (original)
> +++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java Tue Jul 31 13:48:39 2007
> @@ -1155,6 +1155,25 @@
>  		return false;
>  	}
>  	
> +	/**
> +	 * Compare the collation info on this DTD with the passed DTD. The rules
> +	 * are as follows
> +	 * 1)If both the DTDs have collation derivation of NONE, then they can't be
> +	 * compared and we return false.
> +	 * 2)If both the DTDs have same collation derivation (which in Derby's case
> +	 * at this point will mean collation derivation of IMPLICIT), then check
> +	 * the collation types. If they match, then return true. If they do not 
> +	 * match, then they can't be compared and hence return false.
> +	 * 
> +	 * In future, when we do support collation derivation of EXPLICIT, we will
> +	 * need to change this method so that we follow the correct SQL standard
> +	 * rules about what should happen if one collation derivation is EXPLICIT
> +	 * and other is NONE/IMPLICIT.

Isn't it true that even without supporting EXPLICT that algorithm in the 
method is a subset of the SQL standard? IMPLICIT,NONE should succeed, 
but will fail with this algorithm.

Dan.