Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 24438 invoked from network); 3 Aug 2006 14:21:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Aug 2006 14:21:52 -0000 Received: (qmail 82627 invoked by uid 500); 3 Aug 2006 14:21:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 82602 invoked by uid 500); 3 Aug 2006 14:21:51 -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 82591 invoked by uid 99); 3 Aug 2006 14:21:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 07:21:51 -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, 03 Aug 2006 07:21:50 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D6D1941001E for ; Thu, 3 Aug 2006 14:19:15 +0000 (GMT) Message-ID: <30216672.1154614755877.JavaMail.jira@brutus> Date: Thu, 3 Aug 2006 07:19:15 -0700 (PDT) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-353) It is desirable to have IDENTITY_VAL_LOCAL() function return last recent user specified value or system generated value for BY DEFAULT identity columns. In-Reply-To: <723128757.1118706406593.JavaMail.jira@ajax.apache.org> 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-353?page=comments#action_12425528 ] Kathey Marsden commented on DERBY-353: -------------------------------------- I received a request from a user to put this issue in 10.1. I think though that this issue is an improvement and not a straight bug fix so wanted to mention that in case anyone has concerns. I would like to do the following: 1) Change this issue to improvement. 2) File a doc issue to change the IDENTIY_VAL_LOCAL doc to reflect the change. http://db.apache.org/derby/docs/10.1/ref/rrefidentityvallocal.html I think we just need to remove " The assigned value is an identity value generated by Derby. " since it now can be the value inserted by the user. 3) Wait until DERBY-1554 is fixed. 4) Port both DERBY-353 and DERBY-1554 to 10.1. Please let me know if anyone has any concerns. I tried and tried to think of a user scenario that might be reliant on the old behavior and couldn't come up with one. Kathey > It is desirable to have IDENTITY_VAL_LOCAL() function return last recent user specified value or system generated value for BY DEFAULT identity columns. > -------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-353 > URL: http://issues.apache.org/jira/browse/DERBY-353 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.1.1.0 > Environment: Generic > Reporter: Satheesh Bandaram > Assigned To: V.Narayanan > Fix For: 10.2.0.0 > > Attachments: patch353.diff > > > Derby was recently enhanced to support BY DEFAULT identity column. While the behavior of this feature is not documented yet, I think, it is desirable for IDENTITY_VAL_LOCAL() function, that is used to retrieve last single statement insert value for identity column, to return user specified value for the default column. > For GENERATED ALWAYS identity columns, this issue doesn't apply, since users can't provide a value. But for GENERATED BY DEFAULT identity columns, users can optionally specify a value. IDENTITY_VAL_LOCAL() function should return this value. Derby currently doesn't support this behavior. > ij> create table tauto ( i int generated by default as identity, j int, k int); > 0 rows inserted/updated/deleted > ij> insert into tauto (j,k) values (1,1); > 1 row inserted/updated/deleted > ij> values identity_val_local(); > 1 > ------------------------------- > 1 > 1 row selected > ij> insert into tauto (j,k) values (1,1); > 1 row inserted/updated/deleted > ij> values identity_val_local(); > 1 > ------------------------------- > 2 > 1 row selected > ij> insert into tauto values (5,1,1); > 1 row inserted/updated/deleted > ij> values identity_val_local(); > 1 > ------------------------------- > 2 <<<<<<<<<<<<<<============= This needs be '5' > 1 row selected > ij> select * from tauto; > I |J |K > ----------------------------------- > 1 |1 |1 > 2 |1 |1 > 5 |1 |1 > 3 rows selected -- 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