Skip to content

Commit

Permalink
Merge pull request #5261 from oleksandr-kachan/PS-9145-8.0
Browse files Browse the repository at this point in the history
PS-9145: Fix openssl version detection in encryption_udf_digest_table.inc
  • Loading branch information
oleksandr-kachan authored Mar 25, 2024
2 parents 36ced33 + 7f10352 commit ba068d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
29 changes: 10 additions & 19 deletions mysql-test/include/have_openssl_binary_version.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
# The condition has the same form as expressions evaluated by include/eval.inc
# ==== Usage ====
#
# --let $openssl_binary_version = 1\\.1\\..*
# --let $openssl_binary_version_do_not_skip = 1 (optional)
# --let $openssl_binary_version = 1.1.*
# --source include/have_openssl_binary_version.inc
#
# result (if $openssl_binary_version_do_not_skip was set to 1):
# $openssl_binary_version_match = 0 | 1

--disable_query_log
--disable_result_log
Expand Down Expand Up @@ -49,24 +45,19 @@ EOF

--source $OPENSSL_CONFIG_INC

--error 0,1
--remove_file $OPENSSL_VERSION_INFO
--error 0,1
--remove_file $OPENSSL_CONFIG_INC

if ($STATUS_VAR)
{
if (!$openssl_binary_version_do_not_skip)
{
--skip Test requires openssl version to be $openssl_binary_version
}
--let $openssl_binary_version_match = 0
--error 0,1
--remove_file $OPENSSL_VERSION_INFO
--error 0,1
--remove_file $OPENSSL_CONFIG_INC
--skip Test requires openssl version to be $openssl_binary_version
}

if (!$STATUS_VAR)
{
--let $openssl_binary_version_match = 1
}
--error 0,1
--remove_file $OPENSSL_VERSION_INFO
--error 0,1
--remove_file $OPENSSL_CONFIG_INC

--enable_query_log
--enable_result_log
Expand Down
18 changes: 5 additions & 13 deletions mysql-test/include/percona_encryption_udf_digest_table.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ CREATE TEMPORARY TABLE digest_type(
--enable_query_log
--enable_result_log

--let $openssl_binary_version_do_not_skip = 1
let $ssl_ver = query_get_value(show status like "Tls_library_version", Value, 1);

--let $openssl_binary_version = 1\\.0\\.2
--source include/have_openssl_binary_version.inc
if ($openssl_binary_version_match)
if (`select "$ssl_ver" like "OpenSSL 1.0.2%"`)
{
--disable_query_log
--disable_result_log
Expand All @@ -40,9 +38,7 @@ if ($openssl_binary_version_match)
--enable_result_log
}

--let $openssl_binary_version = 1\\.1\\.0
--source include/have_openssl_binary_version.inc
if ($openssl_binary_version_match)
if (`select "$ssl_ver" like "OpenSSL 1.1.0%"`)
{
--disable_query_log
--disable_result_log
Expand All @@ -68,9 +64,7 @@ if ($openssl_binary_version_match)
--enable_result_log
}

--let $openssl_binary_version = 1\\.1\\.1
--source include/have_openssl_binary_version.inc
if ($openssl_binary_version_match)
if (`select "$ssl_ver" like "OpenSSL 1.1.1%"`)
{
--disable_query_log
--disable_result_log
Expand Down Expand Up @@ -105,9 +99,7 @@ if ($openssl_binary_version_match)
--enable_result_log
}

--let $openssl_binary_version = 3\\.0\\.\\d+
--source include/have_openssl_binary_version.inc
if ($openssl_binary_version_match)
if (`select "$ssl_ver" like "OpenSSL 3.%"`)
{
--disable_query_log
--disable_result_log
Expand Down

0 comments on commit ba068d2

Please sign in to comment.