From 6a742fc3b12527c5bd4817957de01ce22c0c8bba Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 18 Dec 2012 11:56:00 +0100 Subject: [PATCH 1/2] MDEV-3927 Add variable "have yassl" have_openssl variable was ON even when OpenSSL was not used (but YaSSL was). fix that, so that have_openssl really corresponds to OpenSSL rename not_openssl.inc to not_ssl.inc and fix the test accordingly. --- mysql-test/include/not_openssl.inc | 4 ---- mysql-test/include/not_ssl.inc | 4 ++++ mysql-test/r/not_openssl.require | 2 -- mysql-test/t/func_encrypt_nossl.test | 2 +- sql/mysqld.cc | 8 +++++++- sql/set_var.h | 1 + sql/sys_vars.cc | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) delete mode 100644 mysql-test/include/not_openssl.inc create mode 100644 mysql-test/include/not_ssl.inc delete mode 100644 mysql-test/r/not_openssl.require diff --git a/mysql-test/include/not_openssl.inc b/mysql-test/include/not_openssl.inc deleted file mode 100644 index afe2ed37c28..00000000000 --- a/mysql-test/include/not_openssl.inc +++ /dev/null @@ -1,4 +0,0 @@ --- require r/not_openssl.require -disable_query_log; -show variables like "have_openssl"; -enable_query_log; diff --git a/mysql-test/include/not_ssl.inc b/mysql-test/include/not_ssl.inc new file mode 100644 index 00000000000..99866923621 --- /dev/null +++ b/mysql-test/include/not_ssl.inc @@ -0,0 +1,4 @@ +if (`select @@have_ssl = 'YES'`) +{ + skip only without SSL; +} diff --git a/mysql-test/r/not_openssl.require b/mysql-test/r/not_openssl.require deleted file mode 100644 index 2b5e423999c..00000000000 --- a/mysql-test/r/not_openssl.require +++ /dev/null @@ -1,2 +0,0 @@ -Variable_name Value -have_openssl NO diff --git a/mysql-test/t/func_encrypt_nossl.test b/mysql-test/t/func_encrypt_nossl.test index 11866db1da7..2dafaa671c4 100644 --- a/mysql-test/t/func_encrypt_nossl.test +++ b/mysql-test/t/func_encrypt_nossl.test @@ -1,4 +1,4 @@ --- source include/not_openssl.inc +-- source include/not_ssl.inc # # Test output from des_encrypt and des_decrypt when server is diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a6547bcc191..6151ec73f79 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -656,6 +656,7 @@ SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache; SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_crypt, have_compress; SHOW_COMP_OPTION have_profiling; +SHOW_COMP_OPTION have_openssl; /* Thread specific variables */ @@ -7366,8 +7367,13 @@ static int mysql_init_variables(void) #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) have_ssl=SHOW_OPTION_YES; +#if HAVE_YASSL + have_openssl= SHOW_OPTION_NO; #else - have_ssl=SHOW_OPTION_NO; + have_openssl= SHOW_OPTION_YES; +#endif +#else + have_openssl= have_ssl= SHOW_OPTION_NO; #endif #ifdef HAVE_BROKEN_REALPATH have_symlink=SHOW_OPTION_NO; diff --git a/sql/set_var.h b/sql/set_var.h index d6dad2132ce..f912c9fffad 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -297,6 +297,7 @@ extern SHOW_COMP_OPTION have_query_cache; extern SHOW_COMP_OPTION have_geometry, have_rtree_keys; extern SHOW_COMP_OPTION have_crypt; extern SHOW_COMP_OPTION have_compress; +extern SHOW_COMP_OPTION have_openssl; /* Prototypes for helper functions diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 9cf2a64a1b8..c67c1178dc8 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3074,7 +3074,7 @@ static Sys_var_have Sys_have_geometry( static Sys_var_have Sys_have_openssl( "have_openssl", "have_openssl", - READ_ONLY GLOBAL_VAR(have_ssl), NO_CMD_LINE); + READ_ONLY GLOBAL_VAR(have_openssl), NO_CMD_LINE); static Sys_var_have Sys_have_profiling( "have_profiling", "have_profiling", From 490d2a42670deac197af80977c1f1b0f3e0ff2ad Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Dec 2012 22:00:55 +0100 Subject: [PATCH 2/2] Previous change of have_debug_sync.inc broke non-debug builds. Implement it in a different way that works on both release and debug builds, and still uses --skip instead of --require. --- mysql-test/include/have_debug_sync.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/include/have_debug_sync.inc b/mysql-test/include/have_debug_sync.inc index ea2247a2746..8efec7dad95 100644 --- a/mysql-test/include/have_debug_sync.inc +++ b/mysql-test/include/have_debug_sync.inc @@ -1,3 +1,4 @@ -if (`select @@debug_sync not like 'ON %'`) { - --skip Needs a debug_sync enabled +if (`SELECT COUNT(*) = 0 FROM information_schema.session_variables WHERE + variable_name = 'debug_sync' AND variable_value LIKE 'ON %'`) { + --skip Needs debug_sync enabled }