From 7fca6f756709f9ef953a1300359e357d42207af9 Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Thu, 1 Dec 2011 15:48:24 +0800 Subject: [PATCH] HHH-6870 sysdate function in oracle dialect is a non argu and no parentheses function --- .../java/org/hibernate/test/legacy/SQLFunctionsTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/matrix/java/org/hibernate/test/legacy/SQLFunctionsTest.java b/hibernate-core/src/matrix/java/org/hibernate/test/legacy/SQLFunctionsTest.java index 59baecbf43..ace0447683 100644 --- a/hibernate-core/src/matrix/java/org/hibernate/test/legacy/SQLFunctionsTest.java +++ b/hibernate-core/src/matrix/java/org/hibernate/test/legacy/SQLFunctionsTest.java @@ -74,7 +74,6 @@ public class SQLFunctionsTest extends LegacyTestCase { public void testDialectSQLFunctions() throws Exception { Session s = openSession(); Transaction t = s.beginTransaction(); - Iterator iter = s.createQuery( "select max(s.count) from Simple s" ).iterate(); if ( getDialect() instanceof MySQLDialect ) assertTrue( iter.hasNext() && iter.next()==null ); @@ -101,7 +100,7 @@ public class SQLFunctionsTest extends LegacyTestCase { if ( getDialect() instanceof Oracle9iDialect ) { // Check Oracle Dialect mix of dialect functions - no args (no parenthesis and single arg functions - List rset = s.createQuery( "select s.name, sysdate(), trunc(s.pay), round(s.pay) from Simple s" ).list(); + List rset = s.createQuery( "select s.name, sysdate, trunc(s.pay), round(s.pay) from Simple s" ).list(); assertNotNull("Name string should have been returned",(((Object[])rset.get(0))[0])); assertNotNull("Todays Date should have been returned",(((Object[])rset.get(0))[1])); assertEquals("trunc(45.8) result was incorrect ", Float.valueOf(45), ( (Object[]) rset.get(0) )[2] ); @@ -116,7 +115,7 @@ public class SQLFunctionsTest extends LegacyTestCase { // Test a larger depth 3 function example - Not a useful combo other than for testing assertTrue( - s.createQuery( "select trunc(round(sysdate())) from Simple s" ).list().size() == 1 + s.createQuery( "select trunc(round(sysdate)) from Simple s" ).list().size() == 1 ); // Test the oracle standard NVL funtion as a test of multi-param functions...