大家好,我正在尝试在项目中使用 mysql 的 uuid_short 函数。但有一个问题。
当我在本地运行它时,它返回 17 位数字。但是当我运行 amazon rds 时,它返回 19 位数字。对此有什么想法吗?
最佳答案
Amazon RDS 的服务器 ID 似乎与您不同。
果然,255 << 56 = 18374686479671623680(20位)
http://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html#function_uuid-short
The UUID_SHORT() return value is constructed this way:
(server_id & 255) << 56
+ (server_startup_time_in_seconds << 24)
+ incremented_variable++;
关于mysql - 与mysql的uuid_short函数的值长度不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27436045/