You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
YZWL/IDEA/sys/version_major.sql

28 lines
735 B

create
definer = `mysql.sys`@localhost function sys.version_major() returns tinyint unsigned comment '
Description
-----------
Returns the major version of MySQL Server.
Returns
-----------
TINYINT UNSIGNED
Example
-----------
mysql> SELECT VERSION(), sys.version_major();
+--------------------------------------+---------------------+
| VERSION() | sys.version_major() |
+--------------------------------------+---------------------+
| 5.7.9-enterprise-commercial-advanced | 5 |
+--------------------------------------+---------------------+
1 row in set (0.00 sec)
' sql security invoker no sql
BEGIN
RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', 1);
END;