Skip to content

Commit

Permalink
修复无法展现SQL历史趋势图 (#2380)
Browse files Browse the repository at this point in the history
fix #2330
原PR: #2331
  • Loading branch information
Grain-Yu authored Nov 14, 2023
1 parent 2a42d5c commit ff69c39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/slowlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import MySQLdb
import simplejson as json
import datetime
import pymysql
from django.contrib.auth.decorators import permission_required
from django.db.models import F, Sum, Value as V, Max
from django.db.models.functions import Concat
Expand Down Expand Up @@ -206,7 +207,7 @@ def slowquery_review_history(request):
def report(request):
"""返回慢SQL历史趋势"""
checksum = request.GET.get("checksum")
checksum = MySQLdb.escape_string(checksum).decode("utf-8")
checksum = pymysql.escape_string(checksum)
cnt_data = ChartDao().slow_query_review_history_by_cnt(checksum)
pct_data = ChartDao().slow_query_review_history_by_pct_95_time(checksum)
cnt_x_data = [row[1] for row in cnt_data["rows"]]
Expand Down

0 comments on commit ff69c39

Please sign in to comment.