Hibernate SVN: r20710 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-09-26 11:39:58 -0400 (Sun, 26 Sep 2010)
New Revision: 20710
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java
core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java
Log:
HHH-5598 sybase ASE cannot handle select count(distinct c1, c2, c3) from t1.
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java 2010-09-26 15:32:06 UTC (rev 20709)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java 2010-09-26 15:39:58 UTC (rev 20710)
@@ -265,4 +265,7 @@
public boolean doesRepeatableReadCauseReadersToBlockWriters() {
return true;
}
+ public boolean supportsTupleDistinctCounts() {
+ return false;
+ }
}
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java 2010-09-26 15:32:06 UTC (rev 20709)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java 2010-09-26 15:39:58 UTC (rev 20710)
@@ -160,7 +160,4 @@
return false; // here assume SQLServer2005 using snapshot isolation, which does not have this problem
}
- public boolean supportsTupleDistinctCounts() {
- return false;
- }
}
14 years, 2 months
Hibernate SVN: r20709 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-09-26 11:32:06 -0400 (Sun, 26 Sep 2010)
New Revision: 20709
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java
core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java
Log:
HHH-5598 sybase supports grid id generate strategy
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java 2010-09-26 15:28:34 UTC (rev 20708)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java 2010-09-26 15:32:06 UTC (rev 20709)
@@ -240,8 +240,10 @@
public boolean dropTemporaryTableAfterUse() {
return true; // sql-server, at least needed this dropped after use; strange!
}
+ public String getSelectGUIDString() {
+ return "select newid()";
+ }
-
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean supportsEmptyInList() {
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java 2010-09-26 15:28:34 UTC (rev 20708)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java 2010-09-26 15:32:06 UTC (rev 20709)
@@ -124,10 +124,6 @@
}
}
- public String getSelectGUIDString() {
- return "select newid()";
- }
-
// The current_timestamp is more accurate, but only known to be supported
// in SQL Server 7.0 and later (i.e., Sybase not known to support it at all)
public String getCurrentTimestampSelectString() {
14 years, 2 months
Hibernate SVN: r20708 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-09-26 11:28:34 -0400 (Sun, 26 Sep 2010)
New Revision: 20708
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java
Log:
HHH-5598 sybase and ms sql server do support union all
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java 2010-09-25 16:27:09 UTC (rev 20707)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java 2010-09-26 15:28:34 UTC (rev 20708)
@@ -248,6 +248,10 @@
return false;
}
+ public boolean supportsUnionAll() {
+ return true;
+ }
+
public boolean supportsExistsInSelect() {
return false;
}
14 years, 2 months
Hibernate SVN: r20707 - in core/trunk: testsuite/src/test/java/org/hibernate/test/hql and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-09-25 12:27:09 -0400 (Sat, 25 Sep 2010)
New Revision: 20707
Modified:
core/trunk/core/src/main/antlr/hql-sql.g
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
HHH-2917 - Using subselects as operands for arithmetic operations causes NullPointerException
Modified: core/trunk/core/src/main/antlr/hql-sql.g
===================================================================
--- core/trunk/core/src/main/antlr/hql-sql.g 2010-09-25 15:47:57 UTC (rev 20706)
+++ core/trunk/core/src/main/antlr/hql-sql.g 2010-09-25 16:27:09 UTC (rev 20707)
@@ -579,11 +579,11 @@
;
arithmeticExpr
- : #(PLUS expr expr) { prepareArithmeticOperator( #arithmeticExpr ); }
- | #(MINUS expr expr) { prepareArithmeticOperator( #arithmeticExpr ); }
- | #(DIV expr expr) { prepareArithmeticOperator( #arithmeticExpr ); }
- | #(MOD expr expr) { prepareArithmeticOperator( #arithmeticExpr ); }
- | #(STAR expr expr) { prepareArithmeticOperator( #arithmeticExpr ); }
+ : #(PLUS exprOrSubquery exprOrSubquery) { prepareArithmeticOperator( #arithmeticExpr ); }
+ | #(MINUS exprOrSubquery exprOrSubquery) { prepareArithmeticOperator( #arithmeticExpr ); }
+ | #(DIV exprOrSubquery exprOrSubquery) { prepareArithmeticOperator( #arithmeticExpr ); }
+ | #(MOD exprOrSubquery exprOrSubquery) { prepareArithmeticOperator( #arithmeticExpr ); }
+ | #(STAR exprOrSubquery exprOrSubquery) { prepareArithmeticOperator( #arithmeticExpr ); }
// | #(CONCAT expr (expr)+ ) { prepareArithmeticOperator( #arithmeticExpr ); }
| #(UNARY_MINUS expr) { prepareArithmeticOperator( #arithmeticExpr ); }
| caseExpr
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2010-09-25 15:47:57 UTC (rev 20706)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2010-09-25 16:27:09 UTC (rev 20707)
@@ -110,6 +110,24 @@
return new FunctionalTestClassTestSuite( ASTParserLoadingTest.class );
}
+ public void testSubSelectAsArtithmeticOperand() {
+ Session s = openSession();
+ s.beginTransaction();
+
+ // first a control
+ s.createQuery( "from Zoo z where ( select count(*) from Zoo ) = 0" ).list();
+
+ // now as operands singly:
+ s.createQuery( "from Zoo z where ( select count(*) from Zoo ) + 0 = 0" ).list();
+ s.createQuery( "from Zoo z where 0 + ( select count(*) from Zoo ) = 0" ).list();
+
+ // and doubly:
+ s.createQuery( "from Zoo z where ( select count(*) from Zoo ) + ( select count(*) from Zoo ) = 0" ).list();
+
+ s.getTransaction().commit();
+ s.close();
+ }
+
public void testJpaTypeOperator() {
// just checking syntax here...
Session s = openSession();
14 years, 2 months
Hibernate SVN: r20706 - core/trunk/core/src/main/java/org/hibernate/stat.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-09-25 11:47:57 -0400 (Sat, 25 Sep 2010)
New Revision: 20706
Modified:
core/trunk/core/src/main/java/org/hibernate/stat/ConcurrentStatisticsImpl.java
Log:
HHH-5591 - ConcurrentStatisticsImpl#queryExecuted() does not update queryExecutionMaxTimeQueryString
Modified: core/trunk/core/src/main/java/org/hibernate/stat/ConcurrentStatisticsImpl.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/stat/ConcurrentStatisticsImpl.java 2010-09-25 15:35:02 UTC (rev 20705)
+++ core/trunk/core/src/main/java/org/hibernate/stat/ConcurrentStatisticsImpl.java 2010-09-25 15:47:57 UTC (rev 20706)
@@ -320,7 +320,7 @@
queryExecutionCount.getAndIncrement();
boolean isLongestQuery = false;
for ( long old = queryExecutionMaxTime.get();
- ( time > old ) && ( isLongestQuery = !queryExecutionMaxTime.compareAndSet( old, time ) );
+ ( isLongestQuery = time > old ) && ( !queryExecutionMaxTime.compareAndSet( old, time ) );
old = queryExecutionMaxTime.get() ) {
// nothing to do here given the odd loop structure...
}
14 years, 2 months
Hibernate SVN: r20705 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-09-25 11:35:02 -0400 (Sat, 25 Sep 2010)
New Revision: 20705
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/InformixDialect.java
Log:
HHH-5581 - Improve InformixDialect sequence support
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/InformixDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/InformixDialect.java 2010-09-25 10:41:36 UTC (rev 20704)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/InformixDialect.java 2010-09-25 15:35:02 UTC (rev 20705)
@@ -86,8 +86,8 @@
public String getIdentitySelectString(String table, String column, int type)
throws MappingException {
return type==Types.BIGINT ?
- "select dbinfo('serial8') from systables where tabid=1" :
- "select dbinfo('sqlca.sqlerrd1') from systables where tabid=1";
+ "select dbinfo('serial8') from informix.systables where tabid=1" :
+ "select dbinfo('sqlca.sqlerrd1') from informix.systables where tabid=1";
}
public String getIdentityColumnString(int type) throws MappingException {
@@ -146,7 +146,7 @@
}
public String getSequenceNextValString(String sequenceName) {
- return "select " + getSelectSequenceNextValString( sequenceName ) + " from systables where tabid=1";
+ return "select " + getSelectSequenceNextValString( sequenceName ) + " from informix.systables where tabid=1";
}
public String getSelectSequenceNextValString(String sequenceName) {
@@ -157,6 +157,14 @@
return true;
}
+ public boolean supportsPooledSequences() {
+ return true;
+ }
+
+ public String getQuerySequencesString() {
+ return "select tabname from informix.systables where tabtype='Q'";
+ }
+
public boolean supportsLimit() {
return true;
}
14 years, 2 months
Hibernate SVN: r20704 - core/trunk/testsuite/src/test/java/org/hibernate/test/criteria.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-09-25 06:41:36 -0400 (Sat, 25 Sep 2010)
New Revision: 20704
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LikeTest.java
Log:
HHH-5597 org.hibernate.test.criteria.LikeTest.testLike fails on postgresql because of the default escape charactor
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LikeTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LikeTest.java 2010-09-25 10:39:40 UTC (rev 20703)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LikeTest.java 2010-09-25 10:41:36 UTC (rev 20704)
@@ -30,6 +30,7 @@
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
import org.hibernate.dialect.MySQLDialect;
+import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.testing.junit.functional.FunctionalTestCase;
@@ -67,7 +68,7 @@
assertEquals( 1, objects.size() );
session.clear();
- if ( !( getDialect() instanceof MySQLDialect ) ) {
+ if ( !( getDialect() instanceof MySQLDialect ) && ! ( getDialect() instanceof PostgreSQLDialect )) {
// retrieve object - case insensitive via custom expression - works
// ok
objects = session.createCriteria( TestObject.class ).add(
14 years, 2 months
Hibernate SVN: r20703 - core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/onetoone.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-09-25 06:39:40 -0400 (Sat, 25 Sep 2010)
New Revision: 20703
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java
Log:
HHH-5596 org.hibernate.test.annotations.onetoone.OneToOneTest.testPkOneToOneSelectStatementDoesNotGenerateExtraJoin() fails on postgresql
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java 2010-09-25 10:34:41 UTC (rev 20702)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java 2010-09-25 10:39:40 UTC (rev 20703)
@@ -354,9 +354,8 @@
}
public String onPrepareStatement(String sql) {
-
int numberOfJoins = 0;
- if (sql.startsWith("select")) {
+ if (sql.startsWith("select") & !sql.contains("nextval")) {
numberOfJoins = count(sql, "join");
TestCase.assertEquals(expectedNumberOfJoins, numberOfJoins);
}
14 years, 2 months
Hibernate SVN: r20702 - in core/trunk/testsuite/src/test/java/org/hibernate/test/annotations: xml/ejb3 and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-09-25 06:34:41 -0400 (Sat, 25 Sep 2010)
New Revision: 20702
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java
Log:
HHH-5595 postgresql jdbc driver does not implement the setQueryTimeout method
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java 2010-09-25 09:22:53 UTC (rev 20701)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/query/QueryAndSQLTest.java 2010-09-25 10:34:41 UTC (rev 20702)
@@ -34,11 +34,13 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
+import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.stat.Statistics;
import org.hibernate.test.annotations.A320;
import org.hibernate.test.annotations.A320b;
import org.hibernate.test.annotations.Plane;
import org.hibernate.test.annotations.TestCase;
+import org.hibernate.testing.junit.SkipForDialect;
/**
* Test named queries
@@ -300,7 +302,7 @@
// s.close();
//
// }
-
+ @SkipForDialect(value = {PostgreSQLDialect.class}, comment = "postgresql jdbc driver does not implement the setQueryTimeout method")
public void testCache() throws Exception {
Session s;
Transaction tx;
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java 2010-09-25 09:22:53 UTC (rev 20701)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/annotations/xml/ejb3/Ejb3XmlTest.java 2010-09-25 10:34:41 UTC (rev 20702)
@@ -6,12 +6,15 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.test.annotations.TestCase;
+import org.hibernate.testing.junit.SkipForDialect;
/**
* @author Emmanuel Bernard
*/
public class Ejb3XmlTest extends TestCase {
+ @SkipForDialect(value = {PostgreSQLDialect.class}, comment = "postgresql jdbc driver does not implement the setQueryTimeout method")
public void testEjb3Xml() throws Exception {
Session s = openSession();
Transaction tx = s.beginTransaction();
14 years, 2 months
Hibernate SVN: r20701 - core/trunk/core/src/main/java/org/hibernate/dialect.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-09-25 05:22:53 -0400 (Sat, 25 Sep 2010)
New Revision: 20701
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/HSQLDialect.java
Log:
HHH-5594 minor improvement
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/HSQLDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/HSQLDialect.java 2010-09-25 09:22:27 UTC (rev 20700)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/HSQLDialect.java 2010-09-25 09:22:53 UTC (rev 20701)
@@ -464,7 +464,7 @@
}
/**
- * Different behaviour for GLOBAL TEMPORARY (1.8) and LOCAL TEMPORARY (2.0)
+ * Different behavior for GLOBAL TEMPORARY (1.8) and LOCAL TEMPORARY (2.0)
* <p/>
* Possible return values and their meanings:<ul>
* <li>{@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL
@@ -653,7 +653,7 @@
}
public String toBooleanValueString(boolean bool) {
- return bool ? "true" : "false";
+ return String.valueOf( bool );
}
public boolean supportsTupleDistinctCounts() {
14 years, 2 months