Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit db2be13

Browse files
Adding the new version function to the install scripts and adding documentation
1 parent 5a7c6bb commit db2be13

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
* Added a new `ps_thread_trx_info()` stored function which outputs, for a given thread id, the transactions, and statements that those transactions have executed, as a JSON object
3030
* Added new `list_add()` and `list_drop()` stored functions, that take a string csv list, and either add or remove items from that list respectively. Can be used to easily update variables that take such lists, like `sql_mode`.
3131
* The `ps_thread_id` stored function now returns the thread id for the current connection if NULL is passed for the in_connection_id parameter
32+
* Added a new `version_major()` stored function, which returns the major version of MySQL Server
33+
* Added a new `version_minor()` stored function, which returns the miner (release series) version of MySQL Server
34+
* Added a new `version_patch()` stored function, which returns the patch release version of MySQL Server
3235

3336
### Bug Fixes
3437

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4086,6 +4086,69 @@ IF (@sys.statement_truncate_len IS NULL) THEN
40864086
END IF;
40874087
```
40884088
4089+
#### version_major
4090+
4091+
##### Description
4092+
4093+
Returns the major version of MySQL Server.
4094+
4095+
##### Returns
4096+
4097+
TINYINT UNSIGNED
4098+
4099+
##### Example
4100+
```SQL
4101+
mysql> SELECT VERSION(), sys.version_major();
4102+
+--------------------------------------+---------------------+
4103+
| VERSION() | sys.version_major() |
4104+
+--------------------------------------+---------------------+
4105+
| 5.7.9-enterprise-commercial-advanced | 5 |
4106+
+--------------------------------------+---------------------+
4107+
1 row in set (0.00 sec)
4108+
```
4109+
4110+
#### version_minor
4111+
4112+
##### Description
4113+
4114+
Returns the minor (release series) version of MySQL Server.
4115+
4116+
##### Returns
4117+
4118+
TINYINT UNSIGNED
4119+
4120+
##### Example
4121+
```SQL
4122+
mysql> SELECT VERSION(), sys.server_minor();
4123+
+--------------------------------------+---------------------+
4124+
| VERSION() | sys.version_minor() |
4125+
+--------------------------------------+---------------------+
4126+
| 5.7.9-enterprise-commercial-advanced | 7 |
4127+
+--------------------------------------+---------------------+
4128+
1 row in set (0.00 sec)
4129+
```
4130+
4131+
#### version_patch
4132+
4133+
##### Description
4134+
4135+
Returns the patch release version of MySQL Server.
4136+
4137+
##### Returns
4138+
4139+
TINYINT UNSIGNED
4140+
4141+
##### Example
4142+
```SQL
4143+
mysql> SELECT VERSION(), sys.version_patch();
4144+
+--------------------------------------+---------------------+
4145+
| VERSION() | sys.version_patch() |
4146+
+--------------------------------------+---------------------+
4147+
| 5.7.9-enterprise-commercial-advanced | 9 |
4148+
+--------------------------------------+---------------------+
4149+
1 row in set (0.00 sec)
4150+
```
4151+
40894152
40904153
### Procedures
40914154

sys_56.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ SOURCE ./functions/ps_thread_id.sql
3838
SOURCE ./functions/ps_thread_account.sql
3939
SOURCE ./functions/ps_thread_stack.sql
4040
SOURCE ./functions/sys_get_config.sql
41+
SOURCE ./functions/version_major.sql
42+
SOURCE ./functions/version_minor.sql
43+
SOURCE ./functions/version_patch.sql
4144

4245
SOURCE ./views/i_s/innodb_buffer_stats_by_schema.sql
4346
SOURCE ./views/i_s/x_innodb_buffer_stats_by_schema.sql

sys_57.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ SOURCE ./functions/ps_thread_account.sql
3939
SOURCE ./functions/ps_thread_stack.sql
4040
SOURCE ./functions/ps_thread_trx_info.sql
4141
SOURCE ./functions/sys_get_config.sql
42+
SOURCE ./functions/version_major.sql
43+
SOURCE ./functions/version_minor.sql
44+
SOURCE ./functions/version_patch.sql
4245

4346
SOURCE ./views/i_s/innodb_buffer_stats_by_schema.sql
4447
SOURCE ./views/i_s/x_innodb_buffer_stats_by_schema.sql

0 commit comments

Comments
 (0)