db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r599973 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Fri, 30 Nov 2007 21:42:56 GMT
Author: mamta
Date: Fri Nov 30 13:42:55 2007
New Revision: 599973

URL: http://svn.apache.org/viewvc?rev=599973&view=rev
Log:
Merging change(599933) from 10.3 codeline into trunk for DERBY-3222 The commit comment for
checkin into 10.3 
codeline was as follows

The test will fail depending on the timing. It inserts CURRENT_DATE into a column and then
compares that
column with whatever the CURRENT_DATE might be during the run of compare sql. If the insert
happened right before
midnight and comparison happens right after midnight, the comparison of the dates will return
FALSE. Since the main 
purpose of the test is to make sure that Derby derives correct collation type for CURRENT_DATE
and 
UPPER(CURRENT_DATE), it really does not matter if the 2 current dates actually match or not.
Because of this, I 
have changed the test to look for <= while doing date comparison rather than =. This should
resolve the timing 
related fact of the test.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java?rev=599973&r1=599972&r2=599973&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Fri Nov 30 13:42:55 2007
@@ -1110,19 +1110,19 @@
     
     s.executeUpdate("create table a (vc varchar(30))");
     s.executeUpdate("insert into a values(CURRENT_DATE)");
-    rs = s.executeQuery("select vc from a where vc = CURRENT_DATE");
+    rs = s.executeQuery("select vc from a where vc <= CURRENT_DATE");
     
     assertEquals(1,JDBC.assertDrainResults(rs));
-    rs = s.executeQuery("select vc from a where vc = UPPER(CURRENT_DATE)");
+    rs = s.executeQuery("select vc from a where vc <= UPPER(CURRENT_DATE)");
     
     JDBC.assertDrainResults(rs,1);
-    rs = s.executeQuery("select vc from a where vc = LOWER(CURRENT_DATE)");
+    rs = s.executeQuery("select vc from a where vc <= LOWER(CURRENT_DATE)");
     
     JDBC.assertDrainResults(rs,1);    
-    rs = s.executeQuery("select vc from a where vc =  '' || CURRENT_DATE");
+    rs = s.executeQuery("select vc from a where vc <=  '' || CURRENT_DATE");
     
     JDBC.assertDrainResults(rs,1);
-    rs = s.executeQuery("select vc from a where '' || CURRENT_DATE = vc");
+    rs = s.executeQuery("select vc from a where '' || CURRENT_DATE >= vc");
     JDBC.assertDrainResults(rs,1);
     
     assertStatementError("42818",s,"select TABLENAME FROM SYS.SYSTABLES WHERE UPPER(CURRENT_DATE)
= TABLENAME");



Mime
View raw message