From ba7daf6dacb04e1a96fdefea9f0fdf947ff5c193 Mon Sep 17 00:00:00 2001 From: weideguo <2515717245@qq.com> Date: Thu, 29 Jun 2023 11:06:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84commit=E5=B8=A6=E5=85=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/db_diagnostic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/db_diagnostic.py b/sql/db_diagnostic.py index 89bb10bce0..ca01b0bc96 100644 --- a/sql/db_diagnostic.py +++ b/sql/db_diagnostic.py @@ -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} From d69be458e6a824a76748f06fcd145955c1e8c955 Mon Sep 17 00:00:00 2001 From: weideguo <2515717245@qq.com> Date: Mon, 3 Jul 2023 17:06:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?limit=E3=80=81offset=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=88=90int?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/slowlog.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/slowlog.py b/sql/slowlog.py index ca952951ad..4211bb1528 100644 --- a/sql/slowlog.py +++ b/sql/slowlog.py @@ -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) @@ -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)