Derby
  1. Derby
  2. DERBY-4693

column rename looses 'identity' attribute.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4, 10.6.1.0
    • Fix Version/s: 10.6.2.1, 10.7.1.1
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      ubuntu, java 1.5
    • Urgency:
      Normal
    • Issue & fix info:
      Newcomer, Repro attached

      Description

      renaming an identity column causes the column to loose its 'identity' attribute.

      you can reproduce the problem as follows:

      CREATE TABLE njr_version ( id INTEGER generated always as identity, databaseVersion INTEGER);

      insert into njr_version (databaseVersion) values (10);
      – column inserted successfully.
      rename column njr_version.id to idVersion;

      insert into njr_version (databaseVersion) values (10);
      Error: Column 'IDVERSION' cannot accept a NULL value.

      To compound this problem there is no way to restore the renamed column's identity attribute as the alter command doesn't let you set an identity attribute. The only work around is to create a new table and copy the data across.

      1. patch.diff
        5 kB
        Bryan Pendleton

        Activity

          People

          • Assignee:
            Bryan Pendleton
            Reporter:
            Brett Sutton
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development