add .gitattributes: python文件统一LF换行

This commit is contained in:
2026-09-14 13:00:15 +08:00
parent 67d5cfc2b8
commit bc7761d79e
6 changed files with 64 additions and 8 deletions
+3 -2
View File
@@ -29,7 +29,7 @@ def apply_row_scope(sql: str, permission: dict, data_scope: dict | None) -> str:
statement = parse_one(sql, read="mysql")
except ParseError as exc:
raise RowScopeError("SQL 解析失败") from exc
for table in statement.find_all(exp.Table):
for table in list(statement.find_all(exp.Table)):
scope = scopes.get(table.name)
if not scope:
continue
@@ -38,5 +38,6 @@ def apply_row_scope(sql: str, permission: dict, data_scope: dict | None) -> str:
this=exp.column(scope["column"], table=table.alias_or_name),
expressions=[exp.Literal.number(value) for value in values],
)
statement = statement.where(condition)
owner = table.find_ancestor(exp.Select) or statement
owner.where(condition, copy=False)
return statement.sql(dialect="mysql")