db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: svn commit: r561494 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/types/DataTypeDescriptor.java impl/sql/compile/LikeEscapeOperatorNode.java
Date Tue, 31 Jul 2007 20:35:22 GMT
mamta@apache.org wrote:
> Author: mamta
> Date: Tue Jul 31 13:29:11 2007
> New Revision: 561494
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=561494
> Log:
> DERBY-2793
> 
> Collation comparison algorithm for LIKE is incorrect. Rather than duplicating the code
in 2 places, I am including a genric method in DataTypeDescriptor which can be called whenever
needed.
> 
> 
> Modified:
>     db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java
>     db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.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=561494&r1=561493&r2=561494
> ==============================================================================
> --- 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:29:11 2007



Does this method have any javadoc comments with it? Would be useful to 
indicate what exactly its purpose is, as it still doesn't seem to be 
implementing the required collation determination from 9.13.


>  	
> -		
> +	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
> +		//of collation to use for comparison.
> +		if (getCollationDerivation() == compareWithDTD.getCollationDerivation() &&
> +				getCollationDerivation() == StringDataValue.COLLATION_DERIVATION_NONE)
> +			return false;
> +		if (getCollationDerivation() == compareWithDTD.getCollationDerivation() &&
> +				getCollationType() == compareWithDTD.getCollationType())
> +			return true;//collation matches
> +		else
> +			return false;//collation does not match
> +		}
> +		 				

> 


Mime
View raw message