Skip to content

Commit

Permalink
处理慢日志报表的参数转义
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Sep 18, 2022
1 parent 53ed326 commit 8cdb232
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sql/slowlog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: UTF-8 -*-
import MySQLdb
import simplejson as json
import datetime
from django.contrib.auth.decorators import permission_required
Expand Down Expand Up @@ -203,6 +204,7 @@ def slowquery_review_history(request):
def report(request):
"""返回慢SQL历史趋势"""
checksum = request.GET.get("checksum")
checksum = MySQLdb.escape_string(checksum).decode("utf-8")
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 8cdb232

Please sign in to comment.