1. OpenJPA
  2. OPENJPA-455

Incorrect MySQL DDL Generation for integer types


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0, 1.0.1
    • Fix Version/s: 1.1.0
    • Component/s: None
    • Labels:


      Opening a JIRA report on Tim's behalf.

      I turned the schema tool loose on a MySQL production database this
      afternoon and it failed. The essence of the problem appears that DDL was
      being generated with a type declaration of this form:

      int unsigned(10)

      In MySQL, the proper form is:

      int(10) unsigned


      ALTER TABLE fubar MODIFY col1 int(10) unsigned;

      Checking other options indicates that similar constructs such as CREATE
      TABLE are likewise defective.

      I looked at the svn trunk head source code in and the parent class The offending method appears to be:

      1508: public String getTypeName(Column col)

      This method has no override in MySQLDictionary, but apparently needs
      one. I think it's a minor mod, but I'm not currently set up to build and
      test in the environment where the offending database exists.

      This is a SEVERE error. It causes generation of defective SQL for
      SQL-generating options and causes live updates to schemas to fail.

      I don't have a Jira login at present, so if someone could log this, it
      would be appreciated.


      Tim Holloway

        Issue Links


          Michael Dick created issue -
          Michael Dick made changes -
          Field Original Value New Value
          Attachment OPENJPA-455.patch.txt [ 12370450 ]
          Michael Dick made changes -
          Resolution Fixed [ 1 ]
          Assignee Michael Dick [ mikedd ]
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.1.0 [ 12312344 ]
          Joe Weinstein made changes -
          Link This issue is cloned as OPENJPA-505 [ OPENJPA-505 ]
          Patrick Linskey made changes -
          Assignee Michael Dick [ mikedd ] Patrick Linskey [ pcl ]
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Patrick Linskey made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Michael Dick made changes -
          Status Resolved [ 5 ] Closed [ 6 ]


            • Assignee:
              Patrick Linskey
              Michael Dick
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: