Skip to content

Commit

Permalink
修复无法展现SQL历史趋势图 (hhyo#2380)
Browse files Browse the repository at this point in the history
fix hhyo#2330
原PR: hhyo#2331
  • Loading branch information
Grain-Yu authored and finovy committed Dec 1, 2023
1 parent 6361b8e commit 5504b69
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 5504b69

Please sign in to comment.