db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4117) dblook script fails when URL contains special characters
Date Wed, 25 Mar 2009 09:20:52 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-4117:

    Attachment: d4117.diff

It looks like the problem is caused by the use of eval in bin/dblook, which makes it necessary
to escape each special character twice in order to get it to work. Attached is a patch that
removes the use of eval and instead uses exec directly. Now the examples mentioned in the
bug description work as expected.

> dblook script fails when URL contains special characters
> --------------------------------------------------------
>                 Key: DERBY-4117
>                 URL: https://issues.apache.org/jira/browse/DERBY-4117
>             Project: Derby
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d4117.diff
> This problem was discovered when testing The dblook shell script fails
if the database URL contains characters that have a special meaning to the shell, even if
those characters are properly escaped/quoted on the command line. Example:
> $ ./bin/dblook -d 'jdbc:derby:jar:(demo/databases/toursdb.jar)toursdb'
> ./bin/dblook[29]: eval: syntax error at line 1: `(' unexpected
> Connection attributes, like create=true, will be ignored because the semi-colon makes
the script execute the setting of the connection attribute as a separate shell command:
> $ ./bin/dblook -d 'jdbc:derby:NewDatabase;create=true'                
> -- Timestamp: 2009-03-25 09:54:56.169
> -- Source database is: NewDatabase
> -- Connection URL is: jdbc:derby:NewDatabase
> -- appendLogs: false
> -- Note: At least one unexpected error/warning message was
> -- encountered during DDL generation.  See dblook.log
> -- to review the message(s).
> In dblook.log:
> java.sql.SQLException: Database 'NewDatabase' not found.
>         at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>         at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
> ...

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message