a8m / a8m/rql

rql_test failes statistically

Aperta
#35 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
367
Fork
43
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

When running rql_test sometimes the `split` function gets stuck and gets to a point of out of memory.
After a lot of debugging i found out that the way the `equalExp` function implemented is wrong.

The check
```go
if s1[i][0] == '(' && s2[j][0] == '(' {
found = equalExp(s1[i][1:len(s1[i])-1], s2[j][1:len(s2[j])-1])
}
```

is wrong because if we get `(` at the start we are removing the end of the string, not the next `)` found which is the problem
there is a corruption of data `(a = b AND c = d) OR (a = c AND (c = d OR d = f))` will be `a = b AND c = d) OR (a = c AND (c = d OR d = f)`

The problem starts here and get to the `split` function which is not validating the given data and not breaking out of the `while` loop after it failes at the start with finding `)`

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Look at the rql_test file and the equalExp function. The bug is in how parentheses are stripped: it removes the last character instead of the matching ')'. The split function then gets stuck. Start by reproducing the failure in rql_test, then examine the parsing logic around parentheses. The fix involves correcting the substring logic and ensuring split validates input to avoid infinite loops.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go
Ambito
databases, testing
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.