-
Notifications
You must be signed in to change notification settings - Fork 111
version_minor()
xiaoboluo768 edited this page Jun 9, 2020
·
2 revisions
-
通过version()函数获取并返回MySQL server的次要版本号,该函数在MySQL 5.7.9中新增
- 该函数执行时无需传入任何参数
-
返回值:一个TINYINT UNSIGNED值
-
定义语句
DROP FUNCTION IF EXISTS version_minor;
DELIMITER $$
CREATE DEFINER='root'@'localhost' FUNCTION version_minor ()
RETURNS TINYINT UNSIGNED
COMMENT '
Description
-----------
Returns the minor (release series) version of MySQL Server.
Returns
-----------
TINYINT UNSIGNED
Example
-----------
mysql> SELECT VERSION(), sys.server_minor();
+--------------------------------------+---------------------+
| VERSION() | sys.version_minor() |
+--------------------------------------+---------------------+
| 5.7.9-enterprise-commercial-advanced | 7 |
+--------------------------------------+---------------------+
1 row in set (0.00 sec)
'
SQL SECURITY INVOKER
NOT DETERMINISTIC
NO SQL
BEGIN
RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', 2), '.', -1);
END$$
DELIMITER ;
上一篇: version_major()函数 | 下一篇: version_patch()函数
- 验证、测试、整理:罗小波
- QQ:309969177
- 提示:本系列文章的主体结构遵循Oracle MySQL 官方 5.7 手册中,关于information_schema、mysql schema、performance_schema、sys schema的章节结构体系,并额外添加了一些验证、测试数据。鉴于本人精力和能力有限,难免出现一些纰漏,欢迎大家踊跃指正!