Skip to content

Commit

Permalink
修复之前的commit带入的bug (#2197)
Browse files Browse the repository at this point in the history
* 修复之前的commit带入的bug

* limit、offset转换成int
  • Loading branch information
weideguo committed Jul 7, 2023
1 parent 1ef4374 commit cdbd12e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sql/db_diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def tablespace(request):
if not query_result.error:
table_space = query_result.to_dict()
r = query_engine.tablespace_count()
total = r[0][0]
total = r.rows[0][0]
result = {"status": 0, "msg": "ok", "rows": table_space, "total": total}
else:
result = {"status": 1, "msg": query_result.error}
Expand Down
8 changes: 4 additions & 4 deletions sql/slowlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def slowquery_review(request):
start_time = request.POST.get("StartTime")
end_time = request.POST.get("EndTime")
db_name = request.POST.get("db_name")
limit = request.POST.get("limit")
offset = request.POST.get("offset")
limit = int(request.POST.get("limit"))
offset = int(request.POST.get("offset"))
# 服务端权限校验
try:
user_instances(request.user, db_type=["mysql"]).get(instance_name=instance_name)
Expand Down Expand Up @@ -118,8 +118,8 @@ def slowquery_review_history(request):
end_time = request.POST.get("EndTime")
db_name = request.POST.get("db_name")
sql_id = request.POST.get("SQLId")
limit = request.POST.get("limit")
offset = request.POST.get("offset")
limit = int(request.POST.get("limit"))
offset = int(request.POST.get("offset"))
# 服务端权限校验
try:
user_instances(request.user, db_type=["mysql"]).get(instance_name=instance_name)
Expand Down

0 comments on commit cdbd12e

Please sign in to comment.