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

Commit c699ee2

Browse files
Adding and updating test cases for the version functions
1 parent db2be13 commit c699ee2

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

mysql-test/suite/sysschema/r/all_sys_objects_exist.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ ps_thread_id FUNCTION
123123
ps_thread_stack FUNCTION
124124
ps_thread_trx_info FUNCTION
125125
sys_get_config FUNCTION
126+
version_major FUNCTION
127+
version_minor FUNCTION
128+
version_patch FUNCTION
126129
create_synonym_db PROCEDURE
127130
diagnostics PROCEDURE
128131
execute_prepared_stmt PROCEDURE
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SELECT sys.version_major();
2+
SELECT sys.version_minor();
3+
SELECT sys.version_patch();
4+
SELECT @my_version = SUBSTRING(VERSION(), 1, CHAR_LENGTH(@my_version));
5+
@my_version = SUBSTRING(VERSION(), 1, CHAR_LENGTH(@my_version))
6+
1
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
########### suite/sysschema/t/version_functions.test #############
2+
# #
3+
# Testing of the sys.version_major(), sys.version_minor(), #
4+
# and sys.version_patch() functions #
5+
# #
6+
# Creation: #
7+
# 2015-08-14 jkrogh Implement this test #
8+
# #
9+
##################################################################
10+
11+
-- source include/not_embedded.inc
12+
13+
# Sanity check - the functions should not return any warnings or errors
14+
--disable_result_log
15+
SELECT sys.version_major();
16+
SELECT sys.version_minor();
17+
SELECT sys.version_patch();
18+
--enable_result_log
19+
20+
# Check that concatenating the three version parts gives the beginning of the output of VERSION()
21+
# This is not truly an independent test, but there isn't really anywhere else to get the actual version,
22+
# so it at least verifies that the three parts go back together in the right way.
23+
let $MY_VERSION=`SELECT CONCAT(sys.version_major(), '.', sys.version_minor(), '.', sys.version_patch())`;
24+
--disable_query_log ONCE
25+
eval SET @my_version = '$MY_VERSION';
26+
27+
SELECT @my_version = SUBSTRING(VERSION(), 1, CHAR_LENGTH(@my_version));

0 commit comments

Comments
 (0)