MySQL的server_uuid获取之uuid()函数和uuid_short()函数

1、uuid()函数

mysql> select uuid(),uuid();
+--------------------------------------+--------------------------------------+
| uuid()                               | uuid()                               |
+--------------------------------------+--------------------------------------+
| 50120c25-d75c-11e7-9484-000c29c9278a | 50120c53-d75c-11e7-9484-000c29c9278a |
+--------------------------------------+--------------------------------------+
1 row in set (0.00 sec)
//uuid()函数值的调用函数
String *Item_func_uuid::val_str(String *str)
{
	...
	mac\rand get
	...
	uint32 time_low=            (uint32) (tv & 0xFFFFFFFF);
	uint16 time_mid=            (uint16) ((tv >> 32) & 0xFFFF);
	uint16 time_hi_and_version= (uint16) ((tv >> 48) | UUID_VERSION);
	s[8]=s[13]='-';
	tohex(s, time_low, 8);
	tohex(s+9, time_mid, 4);
	tohex(s+14, time_hi_and_version, 4);
	strmov(s+18, clock_seq_and_node_str);
	...
}

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览

应支付9.90元
点击重新获取
扫码支付

支付成功即可阅读