ignore non-numeric parts of version string

This commit is contained in:
mangototango 2021-10-21 05:32:53 +00:00
parent 76d432b838
commit 0787efc1cc

View File

@ -413,7 +413,7 @@ class Database(object):
except ServerError as e: except ServerError as e:
logger.exception('Cannot determine server version (%s), assuming 1.1.0', e) logger.exception('Cannot determine server version (%s), assuming 1.1.0', e)
ver = '1.1.0' ver = '1.1.0'
return tuple(int(n) for n in ver.split('.')) if as_tuple else ver return tuple(int(n) for n in ver.split('.') if n.isdigit()) if as_tuple else ver
def _is_existing_database(self): def _is_existing_database(self):
r = self._send("SELECT count() FROM system.databases WHERE name = '%s'" % self.db_name) r = self._send("SELECT count() FROM system.databases WHERE name = '%s'" % self.db_name)