Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 17033 invoked from network); 23 Feb 2008 00:00:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Feb 2008 00:00:01 -0000 Received: (qmail 9646 invoked by uid 500); 22 Feb 2008 23:59:55 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 9613 invoked by uid 500); 22 Feb 2008 23:59:55 -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 9604 invoked by uid 99); 22 Feb 2008 23:59:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Feb 2008 15:59:55 -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; Fri, 22 Feb 2008 23:59:30 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C4F99234C043 for ; Fri, 22 Feb 2008 15:59:19 -0800 (PST) Message-ID: <519410477.1203724759805.JavaMail.jira@brutus> Date: Fri, 22 Feb 2008 15:59:19 -0800 (PST) From: "Daniel John Debrunner (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3310) ASSERT in MergeSort.checkColumnTypes() disallow legal type conversions In-Reply-To: <4068391.1199894734052.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-3310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571647#action_12571647 ] Daniel John Debrunner commented on DERBY-3310: ---------------------------------------------- Looking at NormalizeResultSet I now see that cast nodes are not needed. NormalizeResultSet performs type conversions itself without any need for cast nodes. It needs a set of DataTypeDescriptors that represent the intended types. SO I'm guessing the layout should be something like to say convert our BIGINT into an INT NormalizeNode ResultColumn(BIGINT) -> VirtualColumnNode (??) -> A (below) source result set node A - ResultColumn (INT) -> constant (INT) That's a rough guess, but I think it's beginning to show why the fix works. I think without the change the type of A would be set to BIGINT and with the change it would remain at INT. Not saying I fully understand it yet, but just throwing more info out there from looking at the code. > ASSERT in MergeSort.checkColumnTypes() disallow legal type conversions > ---------------------------------------------------------------------- > > Key: DERBY-3310 > URL: https://issues.apache.org/jira/browse/DERBY-3310 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.4.0.0 > Reporter: Dyre Tjeldvoll > Assignee: Kathey Marsden > Priority: Minor > Attachments: cast-repro.sql, derby-3310_try1_diff.txt > > > The following code > CREATE TABLE U (SNAME VARCHAR(32000), TNAME VARCHAR(32000), C1 BIGINT); > -- This triggers an ASSERT (because 2 is INTEGER and not BIGINT) > INSERT INTO U(SNAME, TNAME, C1) SELECT DISTINCT SCHEMANAME, TABLENAME, 2 > FROM SYS.SYSTABLES T JOIN SYS.SYSSCHEMAS S ON T.SCHEMAID = S.SCHEMAID; > gives > ERROR XJ001: Java exception: 'ASSERT FAILED col1.getClass() (class org.apache.derby.iapi.types.SQLInteger) expected to be the same as col2.getClass() (class org.apache.derby.iapi.types.SQLLongint): org.apache.derby.shared.common.sanity.AssertFailure'. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.