google / google/google-sql-syntax-ts

Catastrophic backtracking issue in QueryFormatter

オープン
#7 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
performance
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。