Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 78576 invoked from network); 23 May 2009 14:43:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 May 2009 14:43:56 -0000 Received: (qmail 21883 invoked by uid 500); 23 May 2009 14:44:08 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 21809 invoked by uid 500); 23 May 2009 14:44:08 -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 21801 invoked by uid 99); 23 May 2009 14:44:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 May 2009 14:44:08 +0000 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; Sat, 23 May 2009 14:44:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3F775234C004 for ; Sat, 23 May 2009 07:43:46 -0700 (PDT) Message-ID: <645723311.1243089826244.JavaMail.jira@brutus> Date: Sat, 23 May 2009 07:43:46 -0700 (PDT) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-4244) ALTER TABLE Sanity ASSERT in add column with autocommit off MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org ALTER TABLE Sanity ASSERT in add column with autocommit off ----------------------------------------------------------- Key: DERBY-4244 URL: https://issues.apache.org/jira/browse/DERBY-4244 Project: Derby Issue Type: Bug Components: SQL Affects Versions: 10.6.0.0 Reporter: Bryan Pendleton Priority: Minor While working with Eranda on DERBY-4187, I stumbled across an apparent ALTER TABLE bug. Here's a script which reproduces the problem for me: autocommit off; create table t0(c1 int not null constraint p1 primary key); alter table t0 add column c1 int; alter table t0 add column c2 int not null default 0 primary key; alter table t0 add column c2 int not null default 0; The "autocommit off" is crucial; otherwise the problem does not reproduce. Here's the detailed assertion failure: 2009-05-23 15:01:17.436 GMT Thread[main,5,main] (XID = 146), (SESSIONID = 1), (DATABASE = brydb), (DRDAID = null), Failed Statement is: alter table t0 add column c2 int not null default 0 org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED column_id = 1format_ids.length = 2format_ids = [I@1321f5 at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162) at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147) at org.apache.derby.impl.store.access.heap.Heap.addColumn(Heap.java:418) at org.apache.derby.impl.store.access.RAMTransaction.addColumnToConglomerate(RAMTransaction.java:618) at org.apache.derby.impl.sql.execute.AlterTableConstantAction.addNewColumnToTable(AlterTableConstantAction.java:1325) at org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(AlterTableConstantAction.java:449) Here's the relevant section of Heap.java: if (column_id != format_ids.length) { if (SanityManager.DEBUG) SanityManager.THROWASSERT( "column_id = " + column_id + "format_ids.length = " + format_ids.length + "format_ids = " + format_ids); throw(StandardException.newException( SQLState.HEAP_TEMPLATE_MISMATCH, new Long(column_id), new Long(this.format_ids.length))); } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.