Return-Path: X-Original-To: apmail-db-torque-dev-archive@www.apache.org Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3423C9D6C for ; Sun, 4 Mar 2012 13:58:24 +0000 (UTC) Received: (qmail 26051 invoked by uid 500); 4 Mar 2012 13:58:24 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 26023 invoked by uid 500); 4 Mar 2012 13:58:24 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 26015 invoked by uid 99); 4 Mar 2012 13:58:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2012 13:58:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2012 13:58:21 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 91EF381CC for ; Sun, 4 Mar 2012 13:58:00 +0000 (UTC) Date: Sun, 4 Mar 2012 13:58:00 +0000 (UTC) From: "Thomas Fox (Commented) (JIRA)" To: torque-dev@db.apache.org Message-ID: <1180508319.19715.1330869480627.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (TORQUE-110) unique name not parsed when generating mysql (sql/base/mysql/unique.vm) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/TORQUE-110?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1322= 1890#comment-13221890 ]=20 Thomas Fox commented on TORQUE-110: ----------------------------------- fixed for mysql, also check other databases =20 > unique name not parsed when generating mysql (sql/base/mysql/unique.vm) > ----------------------------------------------------------------------- > > Key: TORQUE-110 > URL: https://issues.apache.org/jira/browse/TORQUE-110 > Project: Torque > Issue Type: Bug > Components: Generator > Affects Versions: 3.3-RC3 > Environment: debian etch linux > Reporter: Peter Fr=C3=BChberger > Assignee: Thomas Fox > Priority: Minor > > The following snippet of code: > > =20 > > Schema: > > name CDATA #IMPLIED > generates the following mysql code (the name is totally ignored), but the= schema allows it. > Create ... > ... > UNIQUE (NAME) > ); > The unique index name (NAME_IDX) is missing, it should correctly be: > Create ... > UNIQUE NAME_IDX (NAME); > ); > changing the unique.vm in sql/base/mysql/unique.vm from > #foreach ($unique in $table.Unices)=20 > UNIQUE($unique.ColumnList),=20 > #end > to > #foreach ($unique in $table.Unices)=20 > UNIQUE $unique.Name ($unique.ColumnList),=20 > #end > I think we have to change unique.vm to do the following semantics: > if ("unique name" is specified) { > unique $uniq.name ('column') > } > else { > unique ('column') > } > We could also set the name whenever creating an sql unique column For exa= mple, if you have to maintain two different databases (i.e. oracle and mysq= l), both generated from the same xml file, you have probably written a tool= which compares both databases. Oracle always uses an unique index name (af= aik), mysql can do without, but comparisson from your tool failes. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org