mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-18 16:31:26 -07:00
Improve code and coverage
This commit is contained in:
parent
5c9e05b026
commit
8ff33bd729
2 changed files with 3 additions and 6 deletions
|
@ -248,14 +248,11 @@ executed_queries = []
|
|||
|
||||
def uses_replica_terminology(cursor):
|
||||
"""Checks if REPLICA must be used instead of SLAVE"""
|
||||
cursor.execute("SELECT VERSION()")
|
||||
cursor.execute("SELECT VERSION() AS version")
|
||||
result = cursor.fetchone()
|
||||
|
||||
if isinstance(result, dict):
|
||||
if 'VERSION()' in result:
|
||||
version_str = result['VERSION()']
|
||||
else:
|
||||
version_str = result['version()']
|
||||
version_str = result['version']
|
||||
|
||||
else:
|
||||
version_str = result[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue