[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5325) Minor issues in test suite and suggestions for improvements
Fred Toussi (JIRA)
noreply at atlassian.com
Sun Jun 27 07:10:11 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37585#action_37585 ]
Fred Toussi commented on HHH-5325:
----------------------------------
Also in this test, the bit_length function is used on a numeric values
org.hibernate.test.hql.ASTParserLoadingTest#testEJBQLFunctions
Query fragment "left outer join Human animal0_7_ on animal0_.id=animal0_7_.mammal where bit_length(animal0_.body_weight)=24"
bit_length is an SQL-92 and SQL:99 function for the BIT data type which is a binary string of bit (it has been removed from later ANSI standards). Only a few databases support this function for numeric values and it is non-standard.
> Minor issues in test suite and suggestions for improvements
> -----------------------------------------------------------
>
> Key: HHH-5325
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5325
> Project: Hibernate Core
> Issue Type: Improvement
> Components: testsuite
> Affects Versions: 3.5.3
> Environment: tested with HSQLDB 2.0
> Reporter: Fred Toussi
> Priority: Minor
>
> hql:ASTParserLoadingTest : testComponentNullnessChecks()
> String query = getDialect() instanceof DB2Dialect ?
> "from Human where cast(? as string) is null" :
> "from Human where ? is null"
> The cast should be made by default. DB2 is highly SQL Standard conformant and displays the correct behaviour.
> (SQL Standard Part 3: Call-Level Interface (SQL/CLI)) Others may "invent" a character type for the dynamic param.
> -----------------------
> legacy:FooBarTest : testFindByCriteria()
> if(!(getDialect() instanceof TimesTenDialect)) {
> list = s.createCriteria(Foo.class).setMaxResults(0).list();
> assertTrue( list.size()==0 );
> }
> The test produces the equivalent to SQL statements with "FETCH 0 ROWS ONLY" or "LIMIT 0" etc. This is explicitly stated to cause a data exception according to SQL:2008. The row count must be at least 1.
> -----------------------
> org.hibernate.test.hql : Animal.hbm.xml
> This snippet is used in several tests. Search for "centimeters".
> <property name="heightInches">
> <column name="height_centimeters" not-null="true"
> read="height_centimeters / 2.54"
> write="? * 2.54"/>
> </property>
> The target SQL column type is created as DOUBLE in most dialects. The dynamic variable in "? * 2.54" first resolves to DECIMAL because the "declared type" of the numeric literal is DECIMAL. It would be better to use "? * 2.54E0" as a hint to use DOUBLE.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list