You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fox (JIRA)" <ji...@apache.org> on 2012/10/29 22:26:12 UTC

[jira] [Created] (TORQUE-241) qualified table names cause wrong sql to be created

Thomas Fox created TORQUE-241:
---------------------------------

             Summary: qualified table names cause wrong sql to be created
                 Key: TORQUE-241
                 URL: https://issues.apache.org/jira/browse/TORQUE-241
             Project: Torque
          Issue Type: Bug
          Components: Runtime
    Affects Versions: 4.0-beta1
            Reporter: Thomas Fox


If I use the table name "bookstore.book" and then try to telete all booksby
        Criteria criteria = new Criteria();
        criteria.where(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
        BookPeer.doDelete(criteria);
 the generated sql will be
DELETE FROM bookstore.book, book WHERE book.book_id IS NOT NULL
whereas it should be
DELETE FROM bookstore.book WHERE book.book_id IS NOT NULL

Also other places should be checked for similar errors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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


[jira] [Commented] (TORQUE-241) qualified table names cause wrong sql to be created

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487282#comment-13487282 ] 

Thomas Fox commented on TORQUE-241:
-----------------------------------

Derby does not resolve unqualified table names in select columns to fully qualified table names. In other words, the query
delete from bookstore.book where book.id=1
dies not work, derby needs
delete from bookstore.book where bookstore.book.id=1
Mysql and postgresql accept both variants.
Need to check with mssql, hsqldb and oracle.
                
> qualified table names cause wrong sql to be created
> ---------------------------------------------------
>
>                 Key: TORQUE-241
>                 URL: https://issues.apache.org/jira/browse/TORQUE-241
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 4.0-beta1
>            Reporter: Thomas Fox
>
> If I use the table name "bookstore.book" and then try to telete all booksby
>         Criteria criteria = new Criteria();
>         criteria.where(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
>         BookPeer.doDelete(criteria);
>  the generated sql will be
> DELETE FROM bookstore.book, book WHERE book.book_id IS NOT NULL
> whereas it should be
> DELETE FROM bookstore.book WHERE book.book_id IS NOT NULL
> Also other places should be checked for similar errors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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


[jira] [Commented] (TORQUE-241) qualified table names cause wrong sql to be created

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487623#comment-13487623 ] 

Thomas Fox commented on TORQUE-241:
-----------------------------------

oracle also at least accepts the second (fully qualified column name) variant
                
> qualified table names cause wrong sql to be created
> ---------------------------------------------------
>
>                 Key: TORQUE-241
>                 URL: https://issues.apache.org/jira/browse/TORQUE-241
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 4.0-beta1
>            Reporter: Thomas Fox
>
> If I use the table name "bookstore.book" and then try to telete all booksby
>         Criteria criteria = new Criteria();
>         criteria.where(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
>         BookPeer.doDelete(criteria);
>  the generated sql will be
> DELETE FROM bookstore.book, book WHERE book.book_id IS NOT NULL
> whereas it should be
> DELETE FROM bookstore.book WHERE book.book_id IS NOT NULL
> Also other places should be checked for similar errors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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


[jira] [Commented] (TORQUE-241) qualified table names cause wrong sql to be created

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490308#comment-13490308 ] 

Thomas Fox commented on TORQUE-241:
-----------------------------------

Other errors with schemata:
- in idtable-init.sql the fully qualified name of the table is used, causing the idbroker not to find the table's entry
- in some databases, the schema must be created explicitly by the "create schema" command
- the qualified table name was used in the peer's TABLE_NAME constant
                
> qualified table names cause wrong sql to be created
> ---------------------------------------------------
>
>                 Key: TORQUE-241
>                 URL: https://issues.apache.org/jira/browse/TORQUE-241
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 4.0-beta1
>            Reporter: Thomas Fox
>
> If I use the table name "bookstore.book" and then try to telete all booksby
>         Criteria criteria = new Criteria();
>         criteria.where(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
>         BookPeer.doDelete(criteria);
>  the generated sql will be
> DELETE FROM bookstore.book, book WHERE book.book_id IS NOT NULL
> whereas it should be
> DELETE FROM bookstore.book WHERE book.book_id IS NOT NULL
> Also other places should be checked for similar errors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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


[jira] [Resolved] (TORQUE-241) qualified table names cause wrong sql to be created

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TORQUE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Fox resolved TORQUE-241.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0-beta2

The error in the description and all errors in the comments above were fixed
                
> qualified table names cause wrong sql to be created
> ---------------------------------------------------
>
>                 Key: TORQUE-241
>                 URL: https://issues.apache.org/jira/browse/TORQUE-241
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 4.0-beta1
>            Reporter: Thomas Fox
>             Fix For: 4.0-beta2
>
>
> If I use the table name "bookstore.book" and then try to telete all booksby
>         Criteria criteria = new Criteria();
>         criteria.where(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
>         BookPeer.doDelete(criteria);
>  the generated sql will be
> DELETE FROM bookstore.book, book WHERE book.book_id IS NOT NULL
> whereas it should be
> DELETE FROM bookstore.book WHERE book.book_id IS NOT NULL
> Also other places should be checked for similar errors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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


[jira] [Commented] (TORQUE-241) qualified table names cause wrong sql to be created

Posted by "Thomas Fox (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TORQUE-241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487211#comment-13487211 ] 

Thomas Fox commented on TORQUE-241:
-----------------------------------

Is due to fullTableAdded check fails (BasePeerImpl line 420) because not the fully qualified table name is fetched for comparison from the table map, but the unqualified name.
We need to fetch the fully qualified table name from the table map.
                
> qualified table names cause wrong sql to be created
> ---------------------------------------------------
>
>                 Key: TORQUE-241
>                 URL: https://issues.apache.org/jira/browse/TORQUE-241
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 4.0-beta1
>            Reporter: Thomas Fox
>
> If I use the table name "bookstore.book" and then try to telete all booksby
>         Criteria criteria = new Criteria();
>         criteria.where(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
>         BookPeer.doDelete(criteria);
>  the generated sql will be
> DELETE FROM bookstore.book, book WHERE book.book_id IS NOT NULL
> whereas it should be
> DELETE FROM bookstore.book WHERE book.book_id IS NOT NULL
> Also other places should be checked for similar errors.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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