Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4056

Space is not reclaimed when attempting to insert row that violates UNIQUE constraint

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 10.4.2.0, 10.5.1.1
    • Fix Version/s: None
    • Component/s: Store
    • Labels:
      None

      Description

      If you try to insert a row which would violate a unique constraint,
      the insert is rolled back, but the space is not reclaimed.

      This was mentioned in a comment to DERBY-4028 (26/Jan/09):

      > Out of curiosity, I tried this code:
      >
      > s.execute("create table d4028(x int unique)");
      > while (true) {
      > try

      { > s.execute("insert into d4028 values 1"); > }

      catch (SQLException e)

      { > System.out.println(e); > }

      > }
      >
      > Even though it only inserts one row, the disk footprint just keeps
      > growing. It's the disk footprint of the table that's growing, though,
      > not the index, so it looks like the free space in the index is reused.

        Attachments

        1. InsertDuplicateKey.java
          0.7 kB
          Knut Anders Hatlen

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                knutanders Knut Anders Hatlen
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: