You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Bernt M. Johnsen (JIRA)" <ji...@apache.org> on 2007/04/25 15:40:15 UTC
[jira] Created: (DERBY-2591) DataDictionaryImpl.getSystemSQLName()
may generate duplicates
DataDictionaryImpl.getSystemSQLName() may generate duplicates
-------------------------------------------------------------
Key: DERBY-2591
URL: https://issues.apache.org/jira/browse/DERBY-2591
Project: Derby
Issue Type: Bug
Components: SQL
Reporter: Bernt M. Johnsen
Assigned To: Bernt M. Johnsen
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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2591) DataDictionaryImpl.getSystemSQLName()
may generate duplicates
Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bernt M. Johnsen updated DERBY-2591:
------------------------------------
Fix Version/s: 10.3.0.0
> DataDictionaryImpl.getSystemSQLName() may generate duplicates
> -------------------------------------------------------------
>
> Key: DERBY-2591
> URL: https://issues.apache.org/jira/browse/DERBY-2591
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Reporter: Bernt M. Johnsen
> Assigned To: Bernt M. Johnsen
> Fix For: 10.3.0.0
>
> Attachments: DERBY-2591.diff
>
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-2591)
DataDictionaryImpl.getSystemSQLName() may generate duplicates
Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491657 ]
Bernt M. Johnsen commented on DERBY-2591:
-----------------------------------------
BTW: Since only two digits is used for YY, there is also a risk for collisions in a 100-year cycle (remember Y2K anyone?). This is not fixed by the attached patch.
> DataDictionaryImpl.getSystemSQLName() may generate duplicates
> -------------------------------------------------------------
>
> Key: DERBY-2591
> URL: https://issues.apache.org/jira/browse/DERBY-2591
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Reporter: Bernt M. Johnsen
> Assigned To: Bernt M. Johnsen
> Attachments: DERBY-2591.diff
>
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (DERBY-2591) DataDictionaryImpl.getSystemSQLName()
may generate duplicates
Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bernt M. Johnsen closed DERBY-2591.
-----------------------------------
> DataDictionaryImpl.getSystemSQLName() may generate duplicates
> -------------------------------------------------------------
>
> Key: DERBY-2591
> URL: https://issues.apache.org/jira/browse/DERBY-2591
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Reporter: Bernt M. Johnsen
> Assigned To: Bernt M. Johnsen
> Fix For: 10.3.0.0
>
> Attachments: DERBY-2591.diff
>
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-2591) DataDictionaryImpl.getSystemSQLName()
may generate duplicates
Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bernt M. Johnsen updated DERBY-2591:
------------------------------------
Attachment: DERBY-2591.diff
Attatched a patch. Is a review really needed for this fix?????? ;-)
> DataDictionaryImpl.getSystemSQLName() may generate duplicates
> -------------------------------------------------------------
>
> Key: DERBY-2591
> URL: https://issues.apache.org/jira/browse/DERBY-2591
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Reporter: Bernt M. Johnsen
> Assigned To: Bernt M. Johnsen
> Attachments: DERBY-2591.diff
>
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (DERBY-2591) DataDictionaryImpl.getSystemSQLName()
may generate duplicates
Posted by "Bernt M. Johnsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-2591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bernt M. Johnsen resolved DERBY-2591.
-------------------------------------
Resolution: Fixed
Committed revision 532723.
> DataDictionaryImpl.getSystemSQLName() may generate duplicates
> -------------------------------------------------------------
>
> Key: DERBY-2591
> URL: https://issues.apache.org/jira/browse/DERBY-2591
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Reporter: Bernt M. Johnsen
> Assigned To: Bernt M. Johnsen
> Attachments: DERBY-2591.diff
>
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.