Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 95296 invoked from network); 26 Feb 2008 23:47:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2008 23:47:45 -0000 Received: (qmail 19884 invoked by uid 500); 26 Feb 2008 23:47:40 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 19854 invoked by uid 500); 26 Feb 2008 23:47:40 -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 19845 invoked by uid 99); 26 Feb 2008 23:47:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 15:47:40 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 23:47:14 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 55EC529A0019 for ; Tue, 26 Feb 2008 15:46:53 -0800 (PST) Message-ID: <1189635031.1204069613350.JavaMail.jira@brutus> Date: Tue, 26 Feb 2008 15:46:53 -0800 (PST) From: "Stephan van Loendersloot (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3458) dblook fails on TERRITORY_BASED databases In-Reply-To: <1330986264.1203794726321.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 [ https://issues.apache.org/jira/browse/DERBY-3458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stephan van Loendersloot updated DERBY-3458: -------------------------------------------- Attachment: DERBY-3458_patch_3.stat DERBY-3458_patch_3_function_tests.txt DERBY-3458_patch_3.txt Attached patch 3, as described in my earlier comment. Instead of returning shortly, I couldn't resist and figured out why my test-environment wasn't setup properly, so I could add function tests to the suite 'derbynetmats' as well. The reason why I couldn't get it right the first time, is because the documentation at testing/README.htm refers to an incorrect download location for 'db2jcc.jar' and 'db2jcc_license_c.jar'. At that location, DB2 drivers for Linux can be downloaded, but they fail the Derby tests. It might be wise to update the readme and point to the right location, but maybe that's something for a new issue. Anyway.. now both 'derbytools' and 'derbynetmats' pass the tests... I will run 'derbyall' later this night and review the outcome in the morning. In the meantime I'd be happy to hear someone else confirming that this patch is working. Thanks, --Stephan. > dblook fails on TERRITORY_BASED databases > ----------------------------------------- > > Key: DERBY-3458 > URL: https://issues.apache.org/jira/browse/DERBY-3458 > Project: Derby > Issue Type: Bug > Components: Tools > Affects Versions: 10.3.2.1 > Reporter: Stephan van Loendersloot > Assignee: Stephan van Loendersloot > Priority: Minor > Fix For: 10.4.0.0 > > Attachments: DERBY-3458_patch_1.stat, DERBY-3458_patch_1.txt, DERBY-3458_patch_2.stat, DERBY-3458_patch_2.txt, DERBY-3458_patch_3.stat, DERBY-3458_patch_3.txt, DERBY-3458_patch_3_function_tests.txt > > > I've created small patches for myself by replacing all related queries in the 'tools' section with CASTs to CHARs and VARCHARs and would like to contribute these to the community in case anyone else can confirm this is a bug. > A small test case to reproduce the problem is provided below, the version of Derby that provides the stacktrace is 10.3.2.1. > Regards, > Stephan van Loendersloot. > Reproduction steps: > ---------- 1: create_territory_db.sql ---------- > CONNECT 'jdbc:derby://localhost/dutch;user=dutch;password=dutch;create=true;territory=nl_NL;collation=TERRITORY_BASED'; > AUTOCOMMIT OFF; > CREATE TABLE AIRLINES > ( > AIRLINE CHAR(2) NOT NULL , > AIRLINE_FULL VARCHAR(24), > BASIC_RATE DOUBLE PRECISION, > DISTANCE_DISCOUNT DOUBLE PRECISION, > BUSINESS_LEVEL_FACTOR DOUBLE PRECISION, > FIRSTCLASS_LEVEL_FACTOR DOUBLE PRECISION, > ECONOMY_SEATS INTEGER, > BUSINESS_SEATS INTEGER, > FIRSTCLASS_SEATS INTEGER > ); > COMMIT; > DISCONNECT; > EXIT; > ---------- 2: use dbloook ---------- > dblook -d "jdbc:derby://localhost/dutch;user=dutch;password=dutch" -o dutch.sql > ---------- 3: stacktrace ---------- > java.sql.SQLSyntaxErrorException: Comparisons between 'CHAR (UCS_BASIC)' and 'CHAR (TERRITORY_BASED)' are not supported. Types must be comparable. String types must also have matching collation. If collation does not match, a possible solution is to cast operands to force them to the default collation (e.g. select tablename from sys.systables where CAST(tablename as VARCHAR(128)) = 'T1') > at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) > at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) > at org.apache.derby.client.am.Statement.executeQuery(Unknown Source) > at org.apache.derby.tools.dblook.prepForDump(Unknown Source) > at org.apache.derby.tools.dblook.go(Unknown Source) > at org.apache.derby.tools.dblook.(Unknown Source) > at org.apache.derby.tools.dblook.main(Unknown Source) > Caused by: org.apache.derby.client.am.SqlException: Comparisons between 'CHAR (UCS_BASIC)' and 'CHAR (TERRITORY_BASED)' are not supported. Types must be comparable. String types must also have matching collation. If collation does not match, a possible solution is to cast operands to force them to the default collation (e.g. select tablename from sys.systables where CAST(tablename as VARCHAR(128)) = 'T1') > at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source) > at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source) > at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source) > at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source) > at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source) > at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source) > at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source) > at org.apache.derby.client.am.Statement.flowExecute(Unknown Source) > at org.apache.derby.client.am.Statement.executeQueryX(Unknown Source) > ... 5 more > -- **--> DEBUG: Comparisons between 'CHAR (UCS_BASIC)' and 'CHAR (TERRITORY_BASED)' are not supported. Types must be comparable. String types must also have matching collation. If collation does not match, a possible solution is to cast operands to force them to the default collation (e.g. select tablename from sys.systables where CAST(tablename as VARCHAR(128)) = 'T1') -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.