MCPcopy Create free account
hub / github.com/dbcli/mycli / calc_mysql_version_value

Method calc_mysql_version_value

mycli/sqlexecute.py:47–55  ·  view source on GitHub ↗
(version_str: str)

Source from the content-addressed store, hash-verified

45
46 @staticmethod
47 def calc_mysql_version_value(version_str: str) -> int:
48 if not version_str or not isinstance(version_str, str):
49 return 0
50 try:
51 major, minor, patch = version_str.split(".")
52 except ValueError:
53 return 0
54 else:
55 return int(major) * 10_000 + int(minor) * 100 + int(patch)
56
57 @classmethod
58 def from_version_string(cls, version_string: str) -> ServerInfo:

Calls 1

splitMethod · 0.80