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

INSERT INTO SELECT DISTINCT ... skips some values for autoincrement column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 10.0.2.0
    • None
    • SQL
    • None

    Description

      Reporting for Mamta Satoor.

      If we use insert into desttable, select
      distinct from source, into a desttable which has autoincrement
      column in it, we might see gaps in the autoincrement column if
      there are duplicated rows in the source table. The reason for
      this is Derby projects values into destination table columns before
      building a distinct resultset from the source table. The piece
      of code doing this is in org.apache.derby.impl.sql.execute.ProjectRestrictResultSet class's getNextRowCore() method where it calls doProjection.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tulika Tulika Agrawal
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: