google / google/google-sql-syntax-ts
Catastrophic backtracking issue in QueryFormatter
- Vorherrschende Sprache
- TypeScript
- Sterne
- 10
- Forks
- 4
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Start by locating QueryFormatter and the `(\s|\n)+` expression described in the issue. Review the reproduction and fix referenced in issue #6, then verify that SQL containing many consecutive newlines formats promptly without catastrophic backtracking.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- performance
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100