Author: stliu
Date: 2010-03-28 11:48:54 -0400 (Sun, 28 Mar 2010)
New Revision: 19122
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/IngresDialect.java
Log:
HHH-4998 org.hibernate.test.hql.ASTParserLoadingTest failure running testStr with Ingres
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/IngresDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/IngresDialect.java 2010-03-28
14:39:15 UTC (rev 19121)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/IngresDialect.java 2010-03-28
15:48:54 UTC (rev 19122)
@@ -41,9 +41,10 @@
* <li> Only supports simple constants or columns on the left side of an IN, making
(1,2,3) in (...) or (<subselect>) in (...) non-supported.
* <li> Supports only 39 digits in decimal.
* <li> Explicitly set USE_GET_GENERATED_KEYS property to false.
+ * <li> Perform string casts to varchar; removes space padding.
* </ul>
*
- * @author Ian Booth, Bruce Lunsford, Max Rydahl Andersen
+ * @author Ian Booth, Bruce Lunsford, Max Rydahl Andersen, Raymond Fan
*/
public class IngresDialect extends Dialect {
@@ -139,6 +140,10 @@
registerFunction( "uuid_from_char", new StandardSQLFunction(
"uuid_from_char", Hibernate.BYTE ) );
registerFunction( "uuid_to_char", new StandardSQLFunction(
"uuid_to_char", Hibernate.STRING ) );
registerFunction( "year", new StandardSQLFunction( "year",
Hibernate.INTEGER ) );
+ // Casting to char of numeric values introduces space padding up to the
+ // maximum width of a value for that return type. Casting to varchar
+ // does not introduce space padding.
+ registerFunction( "str", new SQLFunctionTemplate(Hibernate.STRING,
"cast(?1 as varchar)") );
// Ingres driver supports getGeneratedKeys but only in the following
// form:
// The Ingres DBMS returns only a single table key or a single object
Show replies by date