openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Holloway <t...@mousetech.com>
Subject Bug: MySQL unsigned int (round 2)
Date Wed, 26 Dec 2007 20:43:48 GMT
I had an opportunity to do some more work with MySQL unsigned int fields
the other day - this time the offending items are foreign keys.

I'd make a formal request for a Jira incident, but I was pressed for
time and was in a position where I could simply nuke the whole schema
and redefine the offending items as vanilla ints, which was sufficient
to eliminate the problem for the short term.

Later this week/next week, I'll try and find time to recreate the
failing environment and capture the exact details. In the mean time,
this is the essence of it:

OpenJPA was instructed to retrieve a many-columned record with multiple
foreign keys, several of which were the MySQL "int" type with the
"unsigned" attribute (MySQL considers unsigned as a modifer to the int
type, rather than unsigned int as a primitive type in its own right).

A defective SQL select statement was constructed, which subsequently
failed on execution. Examination of the log seemed to indicate that the
foreign key references in SQL joins were being assigned data names based
on their data type, and in the case of unsigned ints, the generated SQL
thus resembled something like "join p0.int unsigned on ...", subject to
my garbled recollection.

As mentioned, changing to ordinary ints made the problem completely
disappear, and I'll try and get a verbatim log capture as soon as I can,
but this may help someone get started.

  Tim Holloway


Mime
View raw message