Bug #35514 | Item_func_uuid::val_str(String*): Assertion `tv > uuid_time' failed. | ||
---|---|---|---|
Submitted: | 24 Mar 2008 16:26 | Modified: | 4 Dec 2008 4:37 |
Reporter: | Philip Stoev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S2 (Serious) |
Version: | 6.0-falcon-team | OS: | Any |
Assigned to: | Tatiana Azundris Nuernberg | CPU Architecture: | Any |
[24 Mar 2008 16:26]
Philip Stoev
[27 Mar 2008 10:12]
Philip Stoev
Test case for bug 35514
Attachment: bug35514.test (application/octet-stream, text), 410 bytes.
[27 Mar 2008 10:26]
Philip Stoev
A test case is now available - no concurrency is required, MyISAM is the only required engine. Sergei, I see that this code segment was added to fix "UUID() bug that manifests itself on low-res timers only, does not result in duplicate values". If the assertion is hit, does it mean that a duplicate value is possible? The VMWare Knowledge Base lists so many situations of clock drift in a virtual machine, I wonder how one can even reliably generate UUID() values in such environment.
[27 Mar 2008 11:08]
Sergei Golubchik
no, duplicate UUID values should never be possible. Assert was documenting the assumption that one can not call UUID() more often than 10 times per microsecond. In fact, one can, of course, an assert is wrong. The fix should be to replace assert with if() and a delay/sleep to enforce the above limitation.
[28 Mar 2008 19:52]
Philip Stoev
Based on Sergei's analysis, here is a simple one-line test that causes the crash, suitable as a regression test: --disable_query_log SELECT UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(), UUID(); --enable_query_log
[23 Apr 2008 17:53]
Philip Stoev
It turns out that if the assertion is commented out, duplicate UUID values will be generated.
[23 Apr 2008 18:04]
Davi Arnaut
FWIW, another option is to generate UUIDs based on pseudo-random numbers (RFC 4122). For example, the Mersenne Twister is a pretty fast PRNG and is BSD licensed.
[13 May 2008 7:03]
Tatiana Azundris Nuernberg
Fixing along with Bug#35848: "UUID() returns UUIDs with the wrong time"
[17 Jun 2008 6:20]
Tatiana Azundris Nuernberg
Updated combine-patchset over in Bug#35848 "UUID() returns UUIDs with the wrong time"
[21 Jul 2008 4:31]
Tatiana Azundris Nuernberg
pushed to 5.0.68-bugteam, 5.1.28-bugteam, 6.0.7-bugteam, 1/3 in multi-CS Bug#35848, Bug#35514, Bug#38160
[4 Dec 2008 4:37]
Tatiana Azundris Nuernberg
status of ticket was not auto-updated correctly due to multi-patch. see Bug#35848 for ChangeSet IDs.