Skip to content

Commit 710073f

Browse files
committed
Replaced deprecated MySQL "have_innodb" variable
1 parent ee8b9d5 commit 710073f

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

mysqld/python_modules/mysql.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,18 @@ def update_stats(get_innodb=True, get_master=True, get_slave=True):
115115
for (k,v) in cursor:
116116
global_status[k.lower()] = v
117117
cursor.close()
118+
119+
cursor = conn.cursor(MySQLdb.cursors.Cursor)
120+
cursor.execute("SHOW ENGINES")
121+
have_innodb = False
122+
for row in cursor:
123+
if row[0] == 'InnoDB':
124+
if row[1] == 'DEFAULT' or row[1] == "YES":
125+
have_innodb = True
126+
cursor.close()
118127

119128
# try not to fail ?
120-
get_innodb = get_innodb and variables['have_innodb'].lower() == 'yes'
129+
get_innodb = get_innodb and have_innodb
121130
get_master = get_master and variables['log_bin'].lower() == 'on'
122131

123132
innodb_status = defaultdict(int)

0 commit comments

Comments
 (0)