You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Satheesh Bandaram (JIRA)" <de...@db.apache.org> on 2005/06/14 01:46:46 UTC
[jira] Created: (DERBY-353) It is desirable to have IDENTITY_VAL_LOCAL() function return last recently user specified value for BY DEFAULT identity columns.
It is desirable to have IDENTITY_VAL_LOCAL() function return last recently user specified value for BY DEFAULT identity columns.
--------------------------------------------------------------------------------------------------------------------------------
Key: DERBY-353
URL: http://issues.apache.org/jira/browse/DERBY-353
Project: Derby
Type: Bug
Components: SQL
Versions: 10.1.0.0
Environment: Generic
Reporter: Satheesh Bandaram
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
Re: [jira] Created: (DERBY-353) It is desirable to have
IDENTITY_VAL_LOCAL() function return last recently user specified value for BY
DEFAULT identity columns.
Posted by Øystein Grøvlen <Oy...@Sun.COM>.
>>>>> "SB(" == Satheesh Bandaram (JIRA) <de...@db.apache.org> writes:
SB(> It is desirable to have IDENTITY_VAL_LOCAL() function return last recently user specified value for BY DEFAULT identity columns.
SB(> --------------------------------------------------------------------------------------------------------------------------------
SB(> Key: DERBY-353
SB(> URL: http://issues.apache.org/jira/browse/DERBY-353
SB(> Project: Derby
SB(> Type: Bug
SB(> Components: SQL
SB(> Versions: 10.1.0.0
SB(> Environment: Generic
SB(> Reporter: Satheesh Bandaram
SB(> Derby was recently enhanced to support BY DEFAULT identity
SB(> column. While the behavior of this feature is not documented
SB(> yet, I think, it is desirable for IDENTITY_VAL_LOCAL()
SB(> function, that is used to retrieve last single statement
SB(> insert value for identity column, to return user specified
SB(> value for the default column.
SB(> For GENERATED ALWAYS identity columns, this issue doesn't
SB(> apply, since users can't provide a value. But for GENERATED
SB(> BY DEFAULT identity columns, users can optionally specify a
SB(> value. IDENTITY_VAL_LOCAL() function should return this
SB(> value. Derby currently doesn't support this behavior.
To me your description, especially the title, is not quite clear. I
assume you mean that IDENTITY_VAL_LOCAL() should return the value for
the last insert statement, regardless of whether it was user-specified
or a default value. However, the title may be interpreted as that you
think it should return the last user-specified value even if the last
insert statement used a default value.
--
Øystein
[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.
Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=comments#action_12320516 ]
Rick Hillegas commented on DERBY-353:
-------------------------------------
The patch looks good but derbyall fails with diffs in derbylang/autoincrement. Was a canon left out of the patch?
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> 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
[jira] Reopened: (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.
Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Satheesh Bandaram reopened DERBY-353:
-------------------------------------
Reopening to mark fix version.
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Assignee: V.Narayanan
> 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
[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.
Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=comments#action_12362891 ]
Kathey Marsden commented on DERBY-353:
--------------------------------------
In looking at the master for autogeneratedJdbc30, I noticed that although the master was updated with this fix to reflect the new results, the test output description of the results does not match the new results. e.g.
NEW OUTPUT:
Test 3 - insert multiple rows into a table with autogenerated key and request generated keys resultset
We will get a row with NULL value because this insert sql inserted more than one row and
there was no prior one-row insert into a table with autogenerated key
1
-
{3}
OLD OUTPUT:
Test 3 - insert multiple rows into a table with autogenerated key and request generated keys resultset
We will get a row with NULL value because this insert sql inserted more than one row and
there was no prior one-row insert into a table with autogenerated key
1
-
{null}
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Assignee: V.Narayanan
> 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
[jira] Updated: (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.
Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
V.Narayanan updated DERBY-353:
------------------------------
Attachment: xyz.diff
Hi,
I have attached with this email the diff file of the fix for DERBY-353 and DERBY-439.
About the fix
-------------
a) Inside the InsertResultSet class getSetAutoincrementValue function the Data Dictionary is accessed to get the current identity value.Which is then updated in the identityVal variable which is then used by the identity_val_local() function to display to the user.
b) The above process did not happen when there was a user supplied value. The system table was not accessed and the setIdentity() function in the GenericLanguageContext class was not called.
c) My fix attacked the case when the user supplies a value for the identity column which can be done in the case of Generated by default and calls the setIdentity function to store the value in this case also.
This involved
c.1) Identifying if the column has a autoincremented value. Done by constants.hasAutoincrement()
c.2) If it does then finding which of the columns is an autoincrement done by
for(col=1;col<=maxColumns;col++)
{
ColumnDescriptor cd = td.getColumnDescriptor(col);
if(cd.isAutoincrement())
{
break;
}
}
c.3) getting the user inserted value
if(col <= maxColumns)
{
DataValueDescriptor dvd = row.cloneColumn(col);
user_autoinc = dvd.getLong();
}
c.4) calling the setIdentity() function in the GenericLanguageContext class with this value.
Pls review the patch and give me your comments
thanx
Narayanan
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Attachments: xyz.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
Re: [jira] Updated: (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.
Posted by V Narayanan <V....@Sun.COM>.
Hi Satheesh,
Thanx for committing!
I just wanted to point out that this patch also fixes DERBY-439.
This was the test case pointed out which was returning null. This
returns the correct value now.
ij> connect 'jdbc:derby:mydb;create=true';
ij> CREATE TABLE MYTABLE
(
MYTABLE_ID BIGINT NOT NULL generated always as identity (start with 1)
) ;
0 rows inserted/updated/deleted
ij> INSERT INTO MYTABLE VALUES (DEFAULT);
1 row inserted/updated/deleted
ij> VALUES IDENTITY_VAL_LOCAL();
1
-------------------------------
1
1 row selected
Can you please update this JIRA entry also? If you want a test case to
be checked in for this fix I can provide one.
thanx
V.Narayanan
Satheesh Bandaram wrote:
> This patch is committed. Thanks Narayanan for the patch and Rick for the
> reviews.
>
> Satheesh
>
> Sending
> java\engine\org\apache\derby\impl\sql\execute\InsertResultSet.java
> Sending
> java\testing\org\apache\derbyTesting\functionTests\master\DerbyNet\autoGeneratedJdbc30.out
> Sending
> java\testing\org\apache\derbyTesting\functionTests\master\DerbyNetClient\autoGeneratedJdbc30.out
> Sending
> java\testing\org\apache\derbyTesting\functionTests\master\autoGeneratedJdbc30.out
> Sending
> java\testing\org\apache\derbyTesting\functionTests\master\autoincrement.out
> Transmitting file data .....
> Committed revision 267331.
>
> V.Narayanan (JIRA) wrote:
>
>> [ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
>>
>>V.Narayanan updated DERBY-353:
>>------------------------------
>>
>> Attachment: patch353.diff
>>
>>Hi,
>>As Rick has pointed out the problem was because of a missed cannon only. The patch now includes the missed changes.
>>Narayanan
>>
>>
>>
>>>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
>>> Type: Bug
>>> Components: SQL
>>> Versions: 10.1.1.0
>>> Environment: Generic
>>> Reporter: Satheesh Bandaram
>>> 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
>>>
>>>
>>
>>
>>
[jira] Updated: (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.
Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
V.Narayanan updated DERBY-353:
------------------------------
Attachment: patch353.diff
Hi,
As Rick has pointed out the problem was because of a missed cannon only. The patch now includes the missed changes.
Narayanan
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> 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
[jira] Reopened: (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.
Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Kathey Marsden reopened DERBY-353:
----------------------------------
reopen to fix fix version
> 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, 10.1.3.2
>
> 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
[jira] Resolved: (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.
Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Satheesh Bandaram resolved DERBY-353:
-------------------------------------
Fix Version: 10.2.0.0
Resolution: Fixed
Fix part of 10.2.
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Assignee: 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
[jira] Closed: (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.
Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Kathey Marsden closed 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.
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
> 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, 10.1.3.2
>
> 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
[jira] Updated: (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.
Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Satheesh Bandaram updated DERBY-353:
------------------------------------
Summary: It is desirable to have IDENTITY_VAL_LOCAL() function return last recent user specified value or system generated value for BY DEFAULT identity columns. (was: It is desirable to have IDENTITY_VAL_LOCAL() function return last recently user specified value for BY DEFAULT identity columns.)
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.0.0
> Environment: Generic
> Reporter: Satheesh Bandaram
>
> 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
[jira] Updated: (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.
Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
V.Narayanan updated DERBY-353:
------------------------------
Attachment: patch353.diff
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Attachments: patch353.diff, xyz.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
[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.
Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=comments#action_12324482 ]
Satheesh Bandaram commented on DERBY-353:
-----------------------------------------
This patch has been committed sometime ago... Narayanan, can you mark this bug as RESOLVED? Then either yourself or myself can CLOSE the bug.
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> 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
[jira] Closed: (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.
Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Satheesh Bandaram closed DERBY-353:
-----------------------------------
Closing after resolving the bug.
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Assignee: 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
[jira] Closed: (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.
Posted by "Satheesh Bandaram (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Satheesh Bandaram closed DERBY-353:
-----------------------------------
Fix has been checked in. Closing the bug.
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Assignee: V.Narayanan
> 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
[jira] Resolved: (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.
Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Kathey Marsden resolved DERBY-353.
----------------------------------
Resolution: Fixed
> 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.1.3.2, 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
[jira] Updated: (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.
Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
V.Narayanan updated DERBY-353:
------------------------------
Attachment: (was: patch353.diff)
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
>
> 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
[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.
Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=comments#action_12320741 ]
Rick Hillegas commented on DERBY-353:
-------------------------------------
Derbyall now runs cleanly. Satheesh, can you commit this patch now? Thanks-Rick
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> 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
[jira] Updated: (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.
Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
Kathey Marsden updated DERBY-353:
---------------------------------
Fix Version/s: 10.1.3.2
Fixed in 10.1.3.2
Date: Thu Aug 10 06:43:20 2006
New Revision: 430381
URL: http://svn.apache.org/viewvc?rev=430381&view=rev
Log:
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.
Merged from trunk 267331, contributed by V.Narayanan
DERBY-1554 IDENTITY_VAL_LOCAL() returned value is modified incorrectly by a multi-row INSERT statement.
Merged from trunk 429425, contributed by Yip Ng
> 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, 10.1.3.2
>
> 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
[jira] Resolved: (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.
Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-353?page=all ]
V.Narayanan resolved DERBY-353:
-------------------------------
Resolution: Fixed
Assign To: V.Narayanan
The patch submitted by me earlier resolves this issue and a related issue DERBY-439 also. I have linked the two issues and will mark this issue as resolved.
> 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
> Type: Bug
> Components: SQL
> Versions: 10.1.1.0
> Environment: Generic
> Reporter: Satheesh Bandaram
> Assignee: V.Narayanan
> 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
[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.
Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
[ 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