[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5484?page=c...
]
Strong Liu updated HHH-5484:
----------------------------
Description:
[SQL-92
standard|http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt] indicates that
right-padded spaces are part of the char, for example in the definition of the CAST
function on p. 148. When source (SV=source value) and target (TV=target value, LTD=length
of target datatype), then:
{quote}
ii) If the length in characters of SV is larger than LTD, then
TV is the first LTD characters of SV. If any of the re-
maining characters of SV are non-<space> characters, then a
completion condition is raised: warning-string data, right
truncation.
iii) If the length in characters M of SV is smaller than LTD,
then TV is SV extended on the right by LTD-M <space>s.
{quote}
in most dialect, jdbc char type is mapped to char(1) or the default one which means
char(255), so, in these cases, UUIDCharType will not work due the the space padded
character value causing an exception in UUID.fromstring() called from UUID_parse on the
returned value.
org.hibernate.test.id.uuid.sqlrep.sqlchar.UUIDCharTest can be used to reproduce this issue
on other DBs except H2 and MySQL, it is a [MySQL
Gotchas|http://sql-info.de/mysql/gotchas.html#1_6]
was:
testUsage test case errors using the Ingres dialect during the instantiation of the child
node.
The CharacterType mapping for the UUID defaults to a CHAR(255) column and is returned as a
space padded character value causing an exception in UUID.fromstring() called from
UUID_parse on the returned value.
Affects Version/s: 3.6.0.Beta3
3.6.0.Beta4
Fix Version/s: 3.6.0.CR1
Component/s: (was: testsuite)
Environment: (was: Hibernate 3.6.0-SNAPSHOT, Ingres II 10.0.0
(int.lnx/128))
Summary: org.hibernate.type.UUIDCharType incorrectly mapped to char and
causes test fail due to the padding space (was:
org.hibernate.test.id.uuid.sqlrep.sqlchar.UUIDCharTest testUsage errors with
IngresDialect)
org.hibernate.type.UUIDCharType incorrectly mapped to char and causes
test fail due to the padding space
--------------------------------------------------------------------------------------------------------
Key: HHH-5484
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5484
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0.Beta2, 3.6.0.Beta3, 3.6.0.Beta4
Reporter: Ray Fan
Fix For: 3.6.0.CR1
Attachments: UUIDCharType.java.svn.diff
[SQL-92
standard|http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt] indicates
that right-padded spaces are part of the char, for example in the definition of the CAST
function on p. 148. When source (SV=source value) and target (TV=target value, LTD=length
of target datatype), then:
{quote}
ii) If the length in characters of SV is larger than LTD, then
TV is the first LTD characters of SV. If any of the re-
maining characters of SV are non-<space> characters, then a
completion condition is raised: warning-string data, right
truncation.
iii) If the length in characters M of SV is smaller than LTD,
then TV is SV extended on the right by LTD-M <space>s.
{quote}
in most dialect, jdbc char type is mapped to char(1) or the default one which means
char(255), so, in these cases, UUIDCharType will not work due the the space padded
character value causing an exception in UUID.fromstring() called from UUID_parse on the
returned value.
org.hibernate.test.id.uuid.sqlrep.sqlchar.UUIDCharTest can be used to reproduce this
issue on other DBs except H2 and MySQL, it is a [MySQL
Gotchas|http://sql-info.de/mysql/gotchas.html#1_6]
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira