google / google/google-sql-syntax-ts
Catastrophic backtracking issue in QueryFormatter
未关闭
- 主要语言
- TypeScript
- 星标
- 10
- 派生
- 4
- PR 合并指标
- 30 天内没有已合并 PR
描述
There's a catastrophic backtracking regex issue that reproduces easily when there are too many newlines in the SQL file (as they match both the `\s` and `\n` in the `(\s|\n)+` and result in exponential backtracking).
Because of this, having too many consecutive newlines in any part of a SQL file results in never-ending formatting.
Reproduction and fix is in #6.
贡献指南
调研方向
首先定位 QueryFormatter 和 issue 中描述的 `(\s|\n)+` 表达式。查看 issue #6 中引用的复现和修复,然后验证包含大量连续换行符的 SQL 能够快速完成格式化,而不会发生灾难性回溯。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- performance
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100