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/11/30 20:53:23 UTC

svn commit: r599933 - /db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java

Author: mamta
Date: Fri Nov 30 11:53:14 2007
New Revision: 599933

URL: http://svn.apache.org/viewvc?rev=599933&view=rev
Log:
DERBY-3222 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. I will soon merge this into trunk as well.


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

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java?rev=599933&r1=599932&r2=599933&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java (original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java Fri Nov 30 11:53:14 2007
@@ -1131,13 +1131,13 @@
     
     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 =  '' || 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");
     assertEquals(1,JDBC.assertDrainResults(rs));
     assertStatementError("42818",s,"select TABLENAME FROM SYS.SYSTABLES WHERE UPPER(CURRENT_DATE) = TABLENAME");
     s.close();