Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 62542 invoked from network); 15 Nov 2006 15:21:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2006 15:21:05 -0000 Received: (qmail 84746 invoked by uid 500); 15 Nov 2006 15:21:15 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 84725 invoked by uid 500); 15 Nov 2006 15:21:14 -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 84714 invoked by uid 99); 15 Nov 2006 15:21:14 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 07:21:14 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 07:21:04 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D02E9714329 for ; Wed, 15 Nov 2006 07:20:43 -0800 (PST) Message-ID: <5469636.1163604043850.JavaMail.jira@brutus> Date: Wed, 15 Nov 2006 07:20:43 -0800 (PST) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-1495) Attempt to modify an identity column error after resetting identity column In-Reply-To: <11847236.1152568289866.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DERBY-1495?page=3Dall ] Bryan Pendleton updated DERBY-1495: ----------------------------------- Fix Version/s: 10.2.1.8 Adding 10.2.1.8 Fix Version to reflect the merging of this fix to 10.2 bran= ch. Thanks Kristian for catching this. > Attempt to modify an identity column error after resetting identity colum= n > -------------------------------------------------------------------------= - > > Key: DERBY-1495 > URL: http://issues.apache.org/jira/browse/DERBY-1495 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.2.1.6 > Environment: Java 1.5.0_06-b05 on Linux Ubuntu 5.10. Derby versio= n 10.2.0.3-412239 > Reporter: Lars Gr=C3=A5mark > Assigned To: Bryan Pendleton > Priority: Minor > Fix For: 10.3.0.0, 10.2.1.8 > > Attachments: preserveColDefault_v1.diff > > > When an identity counter is altered using the ALTER TABLE statement below= , it seems as if the GENERATED BY DEFAULT behavior is lost. > The following statements will reproduce the error. > CREATE TABLE MYTABLE ( > id INT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1= ) NOT NULL > ,col2 INT NOT NULL > ) > -- Insert using an explicit value on the ID-field > INSERT INTO MYTABLE(ID, COL2) VALUES(2, 2) > -- Reset the identity field > ALTER TABLE mytable ALTER COLUMN id RESTART WITH 3 > -- Try inserting another explicit value and the error below is thrown. > INSERT INTO MYTABLE(ID, COL2) VALUES(4, 4) > Error: SQL Exception: Attempt to modify an identity column 'ID'. , SQL St= ate: 42Z23, Error Code: 30000 > -- Although, this works fine > INSERT INTO MYTABLE(COL2) VALUES(4) --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira