You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Christopher Fitch <do...@midsouth.rr.com> on 2006/04/13 20:06:27 UTC

Bug with SQL generation for Derby

One of our other developers ran across this problem using Torque 3.2:

The xml schema that starts:
<?xml version="1.0"?>
<!DOCTYPE database SYSTEM 
"http://db.apache.org/torque/dtd/database_3_2.dtd">
<!-- Autogenerated by JDBCToXMLSchema! -->
<database name="somedb">
             <table name="URI">
                         <column name="URI_ID" primaryKey="true" 
required="true" type="NUMERIC" size="10"/>
                         <column name="URI_STRING" required="true" 
size="800" type="VARCHAR"/>
                         <index name="XUID">
                                     <index-column name="URI_ID"/>
                         </index>
                         <index name="XUSTRING">
                                     <index-column name="URI_STRING"/>
                         </index>
             </table>
</database>

Generates the invalid derby sql:
-----------------------------------------------------------------------------
-- URI
-----------------------------------------------------------------------------
drop table URI;

CREATE TABLE URI
(
     URI_ID NUMERIC(10) NOT NULL,
     URI_STRING VARCHAR(800) NOT NULL,
     PRIMARY KEY(URI_ID),
);

CREATE  INDEX XUID ON URI (URI_ID);
CREATE  INDEX XUSTRING ON URI (URI_STRING);


*NOTE* there is a trailing comma that isn’t being trimmed at the end of 
the PRIMARY KEY line.


I noticed in Scarab that there was an entry for this issue with regards 
to foreign keys but it seems that it is still there.

Any thoughts?

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Bug with SQL generation for Derby

Posted by Thomas Fischer <tf...@apache.org>.
This is fixed in svn, but not in 3.2. 3.2 was the first Torque version 
with alpha support for derby, so it is not bug-free. You may want to build 
from svn for derby.

     Thomas

On Thu, 13 Apr 2006, Christopher Fitch wrote:

> One of our other developers ran across this problem using Torque 3.2:
>
> The xml schema that starts:
> <?xml version="1.0"?>
> <!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database_3_2.dtd">
> <!-- Autogenerated by JDBCToXMLSchema! -->
> <database name="somedb">
>            <table name="URI">
>                        <column name="URI_ID" primaryKey="true" 
> required="true" type="NUMERIC" size="10"/>
>                        <column name="URI_STRING" required="true" size="800" 
> type="VARCHAR"/>
>                        <index name="XUID">
>                                    <index-column name="URI_ID"/>
>                        </index>
>                        <index name="XUSTRING">
>                                    <index-column name="URI_STRING"/>
>                        </index>
>            </table>
> </database>
>
> Generates the invalid derby sql:
> -----------------------------------------------------------------------------
> -- URI
> -----------------------------------------------------------------------------
> drop table URI;
>
> CREATE TABLE URI
> (
>    URI_ID NUMERIC(10) NOT NULL,
>    URI_STRING VARCHAR(800) NOT NULL,
>    PRIMARY KEY(URI_ID),
> );
>
> CREATE  INDEX XUID ON URI (URI_ID);
> CREATE  INDEX XUSTRING ON URI (URI_STRING);
>
>
> *NOTE* there is a trailing comma that isn’t being trimmed at the end of the 
> PRIMARY KEY line.
>
>
> I noticed in Scarab that there was an entry for this issue with regards to 
> foreign keys but it seems that it is still there.
>
> Any thoughts?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>