Bugfix of 65525: proxysql in check_config TypeError: tuple indices must be integers, not str (#66850)

This commit is contained in:
Andrew Klychkov 2020-02-11 18:53:42 +03:00 committed by GitHub
parent 7ef7c1b5d7
commit a86524b2bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -259,6 +259,10 @@ class ProxySQLServer(object):
cursor.execute(query_string, query_data)
check_count = cursor.fetchone()
if isinstance(check_count, tuple):
return int(check_count[0]) > 0
return (int(check_count['host_count']) > 0)
def get_server_config(self, cursor):

View file

@ -119,6 +119,10 @@ def check_config(variable, value, cursor):
cursor.execute(query_string, query_data)
check_count = cursor.fetchone()
if isinstance(check_count, tuple):
return int(check_count[0]) > 0
return (int(check_count['variable_count']) > 0)