Return-Path: Delivered-To: apmail-db-ddlutils-user-archive@www.apache.org Received: (qmail 60284 invoked from network); 14 Mar 2007 16:25:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2007 16:25:16 -0000 Received: (qmail 83140 invoked by uid 500); 14 Mar 2007 16:25:25 -0000 Delivered-To: apmail-db-ddlutils-user-archive@db.apache.org Received: (qmail 83122 invoked by uid 500); 14 Mar 2007 16:25:24 -0000 Mailing-List: contact ddlutils-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-user@db.apache.org Delivered-To: mailing list ddlutils-user@db.apache.org Delivered-To: moderator for ddlutils-user@db.apache.org Received: (qmail 68104 invoked by uid 99); 14 Mar 2007 13:51:49 -0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7663F.89C63D59" Subject: DdlUtils insists on altering unchanged columns when using MySql Date: Wed, 14 Mar 2007 14:48:02 +0100 Message-ID: <72326A70FE1B0842A98E27C0CA3F291CBA344E@exchange.mogul.no.> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: DdlUtils insists on altering unchanged columns when using MySql Thread-Index: AcdmP2KXV+vV4V+hRTuuBIg7DQwPpw== From: "Nils Tesdal" To: X-Kantega-MailScanner: Found to be clean X-MailScanner-From: nils.tesdal@kantega.no X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C7663F.89C63D59 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi! =20 I am writing program that uses DdlUtils to create and access a database. With Derby it works ok, but when I switched to MySql I got a problem. When I ask for the alterTablesSql, DdlUtils insists on altering columns that are defined as 'required' without a default value. This seems to be caused by MySql interpreting 'no default value' differently from DdlUtils. The default value in the model read from the database contains an empty string, while the default value in the model read from the xml file has a null-value. =20 An example column definition: =20 =20 I have temporarily fixed the problem by inserting the following code in the postprocessModelFromDatabase method on line 1957 in PlatformImplBase.java: =20 if(column.isRequired() && defaultValue !=3D null && defaultValue.equals("")) { defaultValue =3D null; column.setDefaultValue(defaultValue); } =20 But maybe there is another way to go about it? =20 Nils =20 =20 ------_=_NextPart_001_01C7663F.89C63D59--