Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 61789 invoked from network); 6 Oct 2004 19:28:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Oct 2004 19:28:18 -0000 Received: (qmail 83972 invoked by uid 500); 6 Oct 2004 19:28:17 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 83928 invoked by uid 500); 6 Oct 2004 19:28:16 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 83917 invoked by uid 99); 6 Oct 2004 19:28:16 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=HTML_50_60,HTML_MESSAGE,HTML_TITLE_EMPTY X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [204.146.167.214] (HELO Boron.MeepZor.Com) (204.146.167.214) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 06 Oct 2004 12:28:15 -0700 Received: from [9.30.40.116] (dmz-firewall [206.199.198.4]) by Boron.MeepZor.Com (8.11.6/8.11.6) with ESMTP id i96JSDv22899 for ; Wed, 6 Oct 2004 15:28:13 -0400 Message-ID: <416446A0.1010105@Sourcery.Org> Date: Wed, 06 Oct 2004 12:25:20 -0700 From: Satheesh Bandaram User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: [PATCH] minor bugs in dblook References: <4130DF61.1050505@gluecode.com> <4133A5AC.1070308@Yngvi.Org> <41494EBD.4080208@Yngvi.Org> <414CFAC9.7080609@rogers.com> In-Reply-To: <414CFAC9.7080609@rogers.com> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/alternative; boundary="------------000004040500020106060203" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------000004040500020106060203 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Applied patch 53895 to commit this fix along with my dblook message localization fix. Satheesh Jalud Abdulmenan wrote: >Patch to fix the following minor bugs in dblook tool: >- generates error when correct connection url is specified as >"jdbc:derby:test" > >- generates error when correct connection url is in single quotes as >'jdbc:derby:test' > >- usage text specifies Cloudscape >- error message specifies cslook >- erroneous command line arguments do not generate expected error, e.g. > java org.apache.derby.tools.dblook -d 'jdbc:derby:test' >-oqwerty a.log > generates ddl on the console instead of displaying usage text > > >------------------------- > >Index: java/tools/org/apache/derby/tools/dblook.java >=================================================================== >--- java/tools/org/apache/derby/tools/dblook.java (revision 46313) >+++ java/tools/org/apache/derby/tools/dblook.java (working copy) >@@ -231,16 +231,20 @@ > case 'd': > if (!haveVal) > return -1; >- if (args[start].length() == 2) >- sourceDBUrl = args[++start]; >- return start; >+ if (args[start].length() == 2) { >+ sourceDBUrl = stripQuotes(args[++start]); >+ return start; >+ } >+ return -1; > > case 'z': > if (!haveVal) > return -1; >- if (args[start].length() == 2) >+ if (args[start].length() == 2) { > schemaParam = args[++start]; >- return start; >+ return start; >+ } >+ return -1; > > case 't': > if (!haveVal) >@@ -256,9 +260,11 @@ > case 'o': > if (!haveVal) > return -1; >- if ((args[start].length() == 2) && (args[start+1].length() > 0)) >+ if ((args[start].length() == 2) && (args[start+1].length() > 0)){ > ddlFileName = args[++start]; >- return start; >+ return start; >+ } >+ return -1; > > case 'a': > if (args[start].equals("-append")) { >@@ -342,9 +348,9 @@ > start = dbUrl.indexOf("net://"); > if (start == -1) > // standard url (jdbc:derby:). Database >- // name starts right after "cloudscape:". The "11" in >- // the following line is the length of "cloudscape:". >- start = dbUrl.indexOf("cloudscape:") + 11; >+ // name starts right after "derby:". The "6" in >+ // the following line is the length of "derby:". >+ start = dbUrl.indexOf("derby:") + 6; > else > // Network Server url. Database name starts right > // after next slash (":net://hostname:port/). >Index: java/tools/org/apache/derby/loc/toolsmessages.properties >=================================================================== >--- java/tools/org/apache/derby/loc/toolsmessages.properties (revision 46313) >+++ java/tools/org/apache/derby/loc/toolsmessages.properties (working copy) >@@ -181,7 +181,7 @@ > \ USAGE:\n\ java org.apache.derby.tools.dblook -d [OPTIONS]\n\n\ > \ \twhere the source URL is the full URL, including the connection protocol\n\ > \ \tand any connection attributes that might apply. For example, use\n\ >-\ \t'jdbc:cloudscape:myDB', or 'jdbc:cloudscape:net://localhost:1527/myDB:user=usr;'. \n\n\ >+\ \t'jdbc:derby:myDB', or 'jdbc:derby:net://localhost:1527/myDB:user=usr;'. \n\n\ > \ \toptions include: \n\n\ > \ \t-z to specify a schema to which the DDL generation\n\ > \ \t should be limited. Only database objects with that schema will have\n\ >@@ -199,19 +199,19 @@ > \ \t will be written.\n\ > \ \t\tIf not specified, default is the console.\ > \ \n >-CSLOOK_FileCreation=This file was created using Cloudscape's cslook utility. >+CSLOOK_FileCreation=This file was created using Derby's dblook utility. > CSLOOK_OutputLocation=Output will be sent to file {0}\n > CSLOOK_Timestamp=Timestamp: {0} > CSLOOK_DBName=Source database is: {0} > CSLOOK_DBUrl=Connection URL is: {0} >-CSLOOK_TargetTables=The cslook utility will consider only specified tables. >+CSLOOK_TargetTables=The dblook utility will consider only specified tables. > CSLOOK_TargetSchema=Specified schema is: {0} > # Directory com/ibm/db2j/tools/cslookImpl/... > CSLOOK_Header=DDL Statements for {0} > CSLOOK_Jar_Note=\ > **** NOTE **** In order for jar files to be loaded correctly,\n\ > -- you must either 1) ensure that the CSJARS directory (created\n\ >--- automatically by cslook) exists where it was created (i.e. at\n\ >+-- automatically by dblook) exists where it was created (i.e. at\n\ > -- the path shown in the statements below), or else 2) change the\n\ > -- path in the statements below to reflect the current location of\n\ > -- CSJARS. If the CSJARS directory does not exist, or if it\n\ >@@ -222,6 +222,6 @@ > CSLOOK_DefaultSchema=Reverting back to default schema 'APP' > CSLOOK_AtLeastOneDebug=\ > -- Note: At least one unexpected error/warning message was\n\ >--- encountered during DDL generation. See cslook.log\n\ >+-- encountered during DDL generation. See dblook.log\n\ > -- to review the message(s).\n\ > \n -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBZEafENVNIY6DZ7ERAsNiAJ4w4IPRTjNfemaRcdHV+oXfvSPqFQCghxSS jjjpYnP7ZpmrsSCW4aykrrc= =YhNW -----END PGP SIGNATURE----- --------------000004040500020106060203 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Applied patch 53895 to commit this fix along with my dblook message localization fix.

Satheesh

Jalud Abdulmenan wrote:

>Patch to fix the following minor bugs in dblook tool:
>-  generates error when correct connection url is specified as
>"jdbc:derby:test"
>
>-  generates error when correct connection url is in single quotes as
>'jdbc:derby:test'
>
>-  usage text specifies Cloudscape
>-  error message specifies cslook
>-  erroneous command line arguments do not generate expected error, e.g.
>          java org.apache.derby.tools.dblook -d 'jdbc:derby:test'
>-oqwerty a.log
>          generates ddl on the console instead of displaying usage text
>
>
>-------------------------
>
>Index: java/tools/org/apache/derby/tools/dblook.java
>===================================================================
>--- java/tools/org/apache/derby/tools/dblook.java    (revision 46313)
>+++ java/tools/org/apache/derby/tools/dblook.java    (working copy)
>@@ -231,16 +231,20 @@
>             case 'd':
>                 if (!haveVal)
>                     return -1;
>-                if (args[start].length() == 2)
>-                    sourceDBUrl = args[++start];
>-                return start;
>+                if (args[start].length() == 2) {
>+                    sourceDBUrl = stripQuotes(args[++start]);
>+                    return start;
>+                }
>+                return -1;
>
>             case 'z':
>                 if (!haveVal)
>                     return -1;
>-                if (args[start].length() == 2)
>+                if (args[start].length() == 2) {
>                     schemaParam = args[++start];
>-                return start;
>+                    return start;
>+                }
>+                return -1;
>
>             case 't':
>                 if (!haveVal)
>@@ -256,9 +260,11 @@
>             case 'o':
>                 if (!haveVal)
>                     return -1;
>-                if ((args[start].length() == 2) && (args[start+1].length() > 0))
>+                if ((args[start].length() == 2) && (args[start+1].length() > 0)){
>                     ddlFileName = args[++start];
>-                return start;
>+                    return start;
>+                }
>+                return -1;
>
>             case 'a':
>                 if (args[start].equals("-append")) {
>@@ -342,9 +348,9 @@
>         start = dbUrl.indexOf("net://");
>         if (start == -1)
>         // standard url (jdbc:derby:<dbname>).  Database
>-        // name starts right after "cloudscape:".  The "11" in
>-        // the following line is the length of "cloudscape:".
>-            start = dbUrl.indexOf("cloudscape:") + 11;
>+        // name starts right after "derby:".  The "6" in
>+        // the following line is the length of "derby:".
>+            start = dbUrl.indexOf("derby:") + 6;
>         else
>         // Network Server url.  Database name starts right
>         // after next slash (":net://hostname:port/<dbname>).
>Index: java/tools/org/apache/derby/loc/toolsmessages.properties
>===================================================================
>--- java/tools/org/apache/derby/loc/toolsmessages.properties    (revision 46313)
>+++ java/tools/org/apache/derby/loc/toolsmessages.properties    (working copy)
>@@ -181,7 +181,7 @@
> \ USAGE:\n\ java org.apache.derby.tools.dblook -d <sourceDBUrl> [OPTIONS]\n\n\
> \ \twhere the source URL is the full URL, including the connection protocol\n\
> \ \tand any connection attributes that might apply.  For example, use\n\
>-\ \t'jdbc:cloudscape:myDB', or 'jdbc:cloudscape:net://localhost:1527/myDB:user=usr;'. \n\n\
>+\ \t'jdbc:derby:myDB', or 'jdbc:derby:net://localhost:1527/myDB:user=usr;'. \n\n\
> \ \toptions include: \n\n\
> \ \t-z <schemaName> to specify a schema to which the DDL generation\n\
> \ \t should be limited.  Only database objects with that schema will have\n\
>@@ -199,19 +199,19 @@
> \ \t will be written.\n\
> \ \t\tIf not specified, default is the console.\
> \ \n
>-CSLOOK_FileCreation=This file was created using Cloudscape's cslook utility.
>+CSLOOK_FileCreation=This file was created using Derby's dblook utility.
> CSLOOK_OutputLocation=Output will be sent to file {0}\n
> CSLOOK_Timestamp=Timestamp: {0}
> CSLOOK_DBName=Source database is: {0}
> CSLOOK_DBUrl=Connection URL is: {0}
>-CSLOOK_TargetTables=The cslook utility will consider only specified tables.
>+CSLOOK_TargetTables=The dblook utility will consider only specified tables.
> CSLOOK_TargetSchema=Specified schema is: {0}
> # Directory com/ibm/db2j/tools/cslookImpl/...
> CSLOOK_Header=DDL Statements for {0}
> CSLOOK_Jar_Note=\
> **** NOTE **** In order for jar files to be loaded correctly,\n\
> -- you must either 1) ensure that the CSJARS directory (created\n\
>--- automatically by cslook) exists where it was created (i.e. at\n\
>+-- automatically by dblook) exists where it was created (i.e. at\n\
> -- the path shown in the statements below), or else 2) change the\n\
> -- path in the statements below to reflect the current location of\n\
> -- CSJARS.  If the CSJARS directory does not exist, or if it\n\
>@@ -222,6 +222,6 @@
> CSLOOK_DefaultSchema=Reverting back to default schema 'APP'
> CSLOOK_AtLeastOneDebug=\
> -- Note: At least one unexpected error/warning message was\n\
>--- encountered during DDL generation.  See cslook.log\n\
>+-- encountered during DDL generation.  See dblook.log\n\
> -- to review the message(s).\n\
> \n
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
iD8DBQFBZEafENVNIY6DZ7ERAsNiAJ4w4IPRTjNfemaRcdHV+oXfvSPqFQCghxSS
jjjpYnP7ZpmrsSCW4aykrrc=
=YhNW
-----END PGP SIGNATURE-----

--------------000004040500020106060203--