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

DataDictionaryImpl.getSystemSQLName() may generate duplicates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 10.3.1.4
    • SQL
    • None

    Description

      DataDictionaryImpl.getSystemSQLName() may generates names on the form SQLYYMMDDHHMMSSmmN where mm is in 10 milliseconds and N is number to avoid collisions with 10 milliseconds. The name was probably generated this way to fit into the 18 caharcter limit of constraint names in older derby versions. However, if a getSystemSQLName() is called 12 hours after a call on the same date (e.g at 01:00:00 and 13:00:00), which is unlikely but not very unlikely, a duplicate name is generated, since the HH-part is filled by the call
      generatedSystemSQLName.append(twoDigits(calendarForLastSystemSQLName.get(Calendar.HOUR)));
      and Calendar.HOUR implementes the pretty stupid idea that there are only 12 hours. It was definitely Calendar.HOUR_OF_DAY which gives you the hour for a 24-hour clock that should have been used.

      Attachments

        1. DERBY-2591.diff
          1 kB
          Bernt Johnsen

        Activity

          People

            bernt Bernt Johnsen
            bernt Bernt Johnsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: