Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 83073 invoked from network); 29 Nov 2007 00:39:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Nov 2007 00:39:20 -0000 Received: (qmail 21927 invoked by uid 500); 29 Nov 2007 00:39:08 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 21897 invoked by uid 500); 29 Nov 2007 00:39:08 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 21888 invoked by uid 99); 29 Nov 2007 00:39:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Nov 2007 16:39:08 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [216.199.14.29] (HELO mail2.mousetech.com) (216.199.14.29) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Nov 2007 00:39:10 +0000 Received: from [192.168.10.2] (mail.mousetech.com [216.199.14.19] (may be forged)) (authenticated bits=0) by mail2.mousetech.com (8.13.8/8.13.8) with ESMTP id lAT0bqKe028995 for ; Wed, 28 Nov 2007 19:37:56 -0500 Subject: Re: BUG: MySQL DDL Generation From: Tim Holloway To: dev@openjpa.apache.org In-Reply-To: <72c1350f0711271616m193b90bat54f9e706c3bdb344@mail.gmail.com> References: <1194650044.14040.73.camel@maria2> <1196206764.21916.71.camel@a64.camera.mousetech.com> <72c1350f0711271616m193b90bat54f9e706c3bdb344@mail.gmail.com> Content-Type: text/plain Date: Wed, 28 Nov 2007 19:38:44 -0500 Message-Id: <1196296724.22005.6.camel@a64.camera.mousetech.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks. You might also want to open one on a problem I reported back on Nov 6 where a malformed JDBC URL could throw an exception. This one only happens to us incompetent folks. Also, did I whine about the apparent mandatory requirement to supply a schema to the Reverse Engineering tool (which the documentation doesn't show)? I got bitten by it about a year ago, then again about 2 weeks ago. That time I fixed it by googling the problem and finding my own question in a mail archive. Tim On Tue, 2007-11-27 at 18:16 -0600, Michael Dick wrote: > I went ahead and opened the JIRA for you (OPENJPA-455). I'll take a closer > look tomorrow, sorry for missing it earlier. > > -Mike > > On Nov 27, 2007 5:39 PM, Tim Holloway wrote: > > > I'm repeating this, since it never received action: > > > > On Fri, 2007-11-09 at 18:14 -0500, Tim Holloway wrote: > > > 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 > > > > > > viz: > > > > > > 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 > > > org.apache.openjpa.jdbc.sql.MySQLDictionary.java and the parent class > > > DBDictionary.java. 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. > > > > > > Thanks, > > > > > > Tim Holloway > > > > > > >