Bug #20618 | Last four parts are same between UUID() function calls | ||
---|---|---|---|
Submitted: | 22 Jun 2006 2:55 | Modified: | 27 Jun 2006 13:45 |
Reporter: | Hiten Pandya | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | MySQL 5.0.11 | OS: | Windows (Windows XP SP2) |
Assigned to: | CPU Architecture: | Any |
[22 Jun 2006 2:55]
Hiten Pandya
[22 Jun 2006 2:56]
Hiten Pandya
Note, the last four parts change only when the Windows 'mysql' service is restarted or started/stopped; otherwise they remain the same.
[22 Jun 2006 7:55]
Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: Please, read how MySQL generates uuid here: http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html
[27 Jun 2006 9:56]
Hiten Pandya
Thanks for the response Sveta, however what I don't seem to understand, please do not hesitate to shed light, is that why should the fifth number remain the same when the documentation is saying that only FreeBSD and Linux are supported platforms for using the 802.1 node number? My platform is Windows so I am expecting this 48-bit random generated number to change at all times; the only possible explanation I can come up with in my head is that the reason why MySQL is generating this 48-number only once per server start/restart is to give us more combinations? Please don't hesitate to shed more light wherever possible, I may not be understanding the *why* fully. I did reach the documentation as instructed, before and after I submitted this bug however it doesn't provide me with a clear explanation of the reasoning. Thanks in advance.
[27 Jun 2006 13:28]
Sergei Golubchik
Yes, a random number is generated once, when you call UUID() for the first time.
[27 Jun 2006 13:37]
Sergei Golubchik
it's not really to give more combinations, but to provide compatible behaviour on all platforms. This part of the uuid is not supposed to change all the time, it is to provide spatial uniqueness, not temporal uniqueness. That is, it is constant on every single computer, but it's different on two different computers.
[27 Jun 2006 13:45]
Hiten Pandya
Sergei, thanks for the update. That's what I figured when I looked at the 5.0.22 code and init_uuid variable in Item_uuid. However, when you say spatial uniqueness, does that mean I am guaranteed that my UUIDs will not clash? I know I am probably about to drive everyone up the wall with this, but I seriously do require this confirmation as I am going to use this functionality of MySQL for quite a critical component of a system via stored functions.
[28 Jun 2006 20:38]
Sveta Smirnova
Dear Hiten, bug database is not for support, but for resolving bugs. In page link to I provided described all steps of uuid generation. If you think documentation is not full or is not having a single meaning, please, open documentation bug. Thank you for the interest in MySQL.