add .gitattributes: python文件统一LF换行
This commit is contained in:
+3
-2
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user