[Commits] ed5ec30: MDEV-7780 - Support for faking server version

Sergey Vojtovich svoj at mariadb.org
Thu Dec 24 13:48:05 EET 2015


revision-id: ed5ec30f9ca448086db5acbfd5f484a534119810 (mariadb-10.1.8-101-ged5ec30)
parent(s): 1f19c6aa93de730cd10c9fcbb337f9ec5c30ef9d
committer: Sergey Vojtovich
timestamp: 2015-12-24 15:46:18 +0400
message:

MDEV-7780 - Support for faking server version

Embedded now supports "--version=<version>", while "--version" is still silently
ignored. Also only run protocol check in non-embedded mode.

---
 mysql-test/suite/sys_vars/t/version.test | 3 ++-
 sql/mysqld.cc                            | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/mysql-test/suite/sys_vars/t/version.test b/mysql-test/suite/sys_vars/t/version.test
index 7955bf8..daa9538 100644
--- a/mysql-test/suite/sys_vars/t/version.test
+++ b/mysql-test/suite/sys_vars/t/version.test
@@ -1,5 +1,6 @@
 SELECT @@version;
 perl;
-  $cnt= grep /my_favorite_version/, `$ENV{MYSQL} -e status`;
+  $cnt= $ENV{MYSQL_TEST} =~ /mysqltest_embedded / ? 1 :
+        grep /my_favorite_version/, `$ENV{MYSQL} -e status`;
   print "$cnt\n";
 EOF
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 7360204..fa3a70f 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -8972,20 +8972,20 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument)
     binlog_format_used= true;
     break;
 #include <sslopt-case.h>
-#ifndef EMBEDDED_LIBRARY
   case 'V':
     if (argument)
     {
       strmake(server_version, argument, sizeof(server_version) - 1);
       set_sys_var_value_origin(&server_version_ptr, sys_var::CONFIG);
     }
+#ifndef EMBEDDED_LIBRARY
     else
     {
       print_version();
       opt_abort= 1;                    // Abort after parsing all options
     }
-    break;
 #endif /*EMBEDDED_LIBRARY*/
+    break;
   case 'W':
     if (!argument)
       global_system_variables.log_warnings++;


More information about the commits mailing list