[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6700) mysql test failures
Strong Liu (JIRA)
noreply at atlassian.com
Tue Nov 8 07:07:20 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44273#comment-44273 ]
Strong Liu commented on HHH-6700:
---------------------------------
org.hibernate.test.id.uuid.sqlrep.sqlbinary.UUIDBinaryTest#testUsage fails on mysql
by default, hibernate create following DDL
{code}
create table Node (
id binary(16) not null,
name varchar(255),
parent binary(16),
primary key (id)
) ENGINE=InnoDB
{code}
but {quote}When BINARY values are stored, they are right-padded with the pad value to the specified length. {quote} (see http://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html)
so, the workaround is add a _length_ to the property and set it to 16 (which is the fixed length for UUID)
another example to show this behavior on mysql
{code}
mysql> create table t(c binary(3));
Query OK, 0 rows affected (0.12 sec)
mysql> insert into t set c ='a';
Query OK, 1 row affected (0.03 sec)
mysql> select hex(c), c='a', c='a\0\0' from t;
+--------+-------+-----------+
| hex(c) | c='a' | c='a\0\0' |
+--------+-------+-----------+
| 610000 | 0 | 1 |
+--------+-------+-----------+
1 row in set (0.00 sec)
mysql> select * from t where c = 'a';
Empty set (0.00 sec)
mysql> select * from t where c = 'a\0\0';
+------+
| c |
+------+
| a |
+------+
1 row in set (0.00 sec)
mysql>
{code}
> mysql test failures
> -------------------
>
> Key: HHH-6700
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6700
> Project: Hibernate Core
> Issue Type: Sub-task
> Environment: MySql 51
> Reporter: Strong Liu
>
> org.hibernate.test.hql.ASTParserLoadingTest.testJPAQLQualifiedIdentificationVariablesControl
> org.hibernate.test.hql.ASTParserLoadingTest.testPaginationWithPolymorphicQuery
> org.hibernate.test.hql.ASTParserLoadingTest.testImplicitPolymorphism
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedManyToOne
> org.hibernate.test.hql.ASTParserLoadingTest.testCachedJoinedAndJoinFetchedOneToMany
> org.hibernate.test.id.uuid.sqlrep.sqlbinary.UUIDBinaryTest.testUsage
> org.hibernate.test.id.uuid.strategy.CustomStrategyTest.testUsage
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazy
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testCustomColumnReadAndWrite
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testFetchAll
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testLazyManyToOne
> org.hibernate.test.instrument.runtime.JavassistInstrumentationTest.testPropertyInitialized
> org.hibernate.test.querycache.QueryCacheTest.testCaseInsensitiveComparison
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testTextTypeInSQLQuery
> org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testImageTypeInSQLQuery
> org.hibernate.test.tm.CMTTest.testConcurrentCachedDirtyQueries
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testScalarStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testParameterHandling
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testEntityStoredProcedure
> org.hibernate.test.sql.hand.custom.mysql.MySQLCustomSQLTest.testHandSQL
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list