1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
--- a/tests/mysqld.py
+++ b/tests/mysqld.py
@@ -186,11 +186,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)
@@ -289,7 +289,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:
|