Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 42292 invoked from network); 31 Aug 2006 17:52:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Aug 2006 17:52:46 -0000 Received: (qmail 45793 invoked by uid 500); 31 Aug 2006 17:52:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 45762 invoked by uid 500); 31 Aug 2006 17:52:45 -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: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 45753 invoked by uid 99); 31 Aug 2006 17:52:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 10:52:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 10:52:44 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E159941001F for ; Thu, 31 Aug 2006 17:49:23 +0000 (GMT) Message-ID: <6143117.1157046563920.JavaMail.jira@brutus> Date: Thu, 31 Aug 2006 10:49:23 -0700 (PDT) From: "Daniel John Debrunner (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1790) DatabaseMetaData.getTables() with passed in table type of SYNONYM returns system tables and not SYNONYMS In-Reply-To: <3101256.1157046322490.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1790?page=comments#action_12431931 ] Daniel John Debrunner commented on DERBY-1790: ---------------------------------------------- and of course the algorithm is flawed because SYSTEM_TABLE and SYNONYM both start with an 'S' thus always map to the same type in the derby system tables. Another workaround would be to use any word starting with 'A' (I think). > DatabaseMetaData.getTables() with passed in table type of SYNONYM returns system tables and not SYNONYMS > -------------------------------------------------------------------------------------------------------- > > Key: DERBY-1790 > URL: http://issues.apache.org/jira/browse/DERBY-1790 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.1.1.0, 10.2.1.0, 10.1.2.1, 10.1.3.0, 10.3.0.0, 10.1.3.1 > Reporter: Daniel John Debrunner > Priority: Minor > > This database metadata call will not return SYNONYMS in the schema indicated. > rs = dmd.getTables((String) null, schema, (String) null, > new String[] {"SYNONYM"}); > Work around is to pass in null as the last argument and then test for each row > "SYNONYM".equals(rs.getString("TABLE_TYPE")) > Due to code in EmbedDatabasemetaData aorund line 1721 that assume the type character in SYS.SYSTABLES.TABLETYPE > is equal to the first character of the JDBC TABLE_TYPE name. This is true for views and tables, but in the Derby system table > the character 'S' is used for system tables and 'A' for SYNONYMS. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira