From: Sandro Tosi <morph@debian.org>
Date: Mon, 11 Jun 2018 11:06:56 -0400
Subject: support_alternative_mysqld_implementation

---
 tests/mysqld.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/mysqld.py b/tests/mysqld.py
index fd1dbcb..d438322 100644
--- a/tests/mysqld.py
+++ b/tests/mysqld.py
@@ -191,11 +191,11 @@ class MySQLServerBase(object):
             if self._sbindir:
                 break
             for afile in files:
-                if (afile == EXEC_MYSQLD and
+                if (afile == EXEC_MYSQLD and 'bin' in root and
                         os.access(os.path.join(root, afile), 0)):
                     self._sbindir = root
                     files_to_find.remove(EXEC_MYSQLD)
-                elif (afile == EXEC_MYSQL and
+                elif (afile == EXEC_MYSQL and 'bin' in root and
                         os.access(os.path.join(root, afile), 0)):
                     self._bindir = root
                     files_to_find.remove(EXEC_MYSQL)
@@ -294,7 +294,7 @@ class MySQLServerBase(object):
 
         prc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=DEVNULL)
         verstr = str(prc.communicate()[0])
-        matches = re.match(r'.*Ver (\d)\.(\d).(\d{1,2}).*', verstr)
+        matches = re.match(r'.*Ver (\d{1,2})\.(\d).(\d{1,2}).*', verstr)
         if matches:
             return tuple([int(v) for v in matches.groups()])
         else:
