Version: 16.0.0-dev-8
Build #: 40676
Build Date: 2014-Oct-20 04:43:02 PM
Operating Environment: Mac OS X (10.8.5, x86_64) / UTF-8 / en / US / Oracle Corporation 1.7.0_60-b19
Memory: Max=3,819,962,368; Total=1,455,423,488; Free=1,180,406,168; CPUs=8
Apache Derby 10.11 - Default Value for Identity column should be disabled for Alter
1. Connect to Apache Derby 10.11.1.1
2. Create a table with below script
CREATE TABLE APP.DERBY-6545 (
ID INTEGER GENERATED ALWAYS AS IDENTITY(START WITH 1, INCREMENT BY 1) NOT NULL,
NAME VARCHAR(25)
)
GO
3 Alter the table and try to enter a default value for the identity column named ID as in screenshot
4 You get an exception "'ID' is a generated or identity column. You cannot change its default value."
5 The latest Apache Derby note for DERBY-6545
Summary of Change
You can no longer add a default to an identity column.
Symptoms Seen by Applications Affected by Change
You can no longer change an identity column as follows:
alter table MyTable alter column MyIdentityColumn default 99;
We should disable the default values for identity column during an Alter for 10.11+ versions
issue 12599 fixes this issue.