Skip to content

Commit

Permalink
add server type
Browse files Browse the repository at this point in the history
  • Loading branch information
QSummerY committed Jul 22, 2024
1 parent cfe731e commit efe58ff
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions sql/engines/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,23 @@ def get_instance_users_summary(self):
user_priv = self.query(
"mysql", "show grants for {};".format(user_host), close_conn=False
).rows
if (
self.server_fork_type == MysqlForkType.MARIADB
and server_version >= (10, 4, 2)
) or (
self.server_fork_type == MysqlForkType.MYSQL
and server_version >= (5, 7, 6)
):
is_locked = db_user[3]
else:
is_locked = None
row = {
"user_host": user_host,
"user": db_user[1],
"host": db_user[2],
"privileges": user_priv,
"saved": False,
"is_locked": (
db_user[3]
if server_version >= (5, 7, 6) or server_version >= (10, 4, 2)
else None
),
"is_locked": is_locked,
}
rows.append(row)
query_result.rows = rows
Expand Down

0 comments on commit efe58ff

Please sign in to comment.