Skip to content

Commit

Permalink
Revert "新增sql执行行数限制" (#2388)
Browse files Browse the repository at this point in the history
Revert "新增sql执行行数限制 (#2366)"

This reverts commit d32d7bc.
  • Loading branch information
LeoQuote authored Nov 16, 2023
1 parent ff69c39 commit 5597911
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
11 changes: 0 additions & 11 deletions common/templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,6 @@ <h5 style="color: darkgrey"><b>SQL上线</b></h5>
placeholder="自动驳回的等级,1表示警告驳回,2和空表示错误才驳回,其他表示不驳回" />
</div>
</div>
<div class="form-group">
<label for="max_sql_length"
class="col-sm-4 control-label">MAX_SQL_LENGTH</label>
<div class="col-sm-5">
<input type="number" class="form-control"
id="max_sql_length"
key="max_sql_length"
value="{{ config.max_sql_length }}"
placeholder="最大执行sql行数,默认10000条"/>
</div>
</div>
<div class="form-group">
<label for="enable_backup_switch"
class="col-sm-4 control-label">ENABLE_BACKUP_SWITCH</label>
Expand Down
5 changes: 0 additions & 5 deletions sql_api/api_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ def post(self, request):
check_result = check_engine.execute_check(
db_name=db_name, sql=request.data["full_sql"].strip()
)
max_sql_length = SysConfig().get("max_sql_length", default_value=10000)
if len(check_result.rows) > int(max_sql_length):
raise serializers.ValidationError(
{"errors": f"执行行数超过{str(max_sql_length)}行,请联系DBA核查!"}
)
except Exception as e:
raise serializers.ValidationError({"errors": f"{e}"})
check_result.rows = check_result.to_dict()
Expand Down

0 comments on commit 5597911

Please sign in to comment.