google / google/google-sql-syntax-ts

Catastrophic backtracking issue in QueryFormatter

Abierto
#7 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
10
Forks
4
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
performance
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.