Hi, thanks for the library. I've been making continued use of it in my FDB SQL layer, and it's great.
We've found a couple inputs that cause the parser to hang.
Version: commit da69080 (current main), Elixir 1.19.4, OTP 28
sql = "select id from t where a = -5"
{:ok, ctx, tokens} = SQL.Lexer.lex(sql)
task = Task.async(fn -> SQL.Parser.parse(tokens, ctx) end)
Task.yield(task, 5_000) || Task.shutdown(task, :brutal_kill)
#=> nil (parse never completes)
These examples all display the hang:
select id from t where a = -5
select id from t where a > -5
select id from t where a = +5
select id from t where a = 1 and (b > 2)
select id from t where a = 1 or (b > 2)
select id from t where a = 1 for update
Comparatively, these examples parse fine, no issues:
select id from t where a in (-1, 2)
select id from t where (a > 1 or b < 0)
select -1
For the record, I don't have any use case for for update but found that it also hangs, so provided here for completeness.
Hi, thanks for the library. I've been making continued use of it in my FDB SQL layer, and it's great.
We've found a couple inputs that cause the parser to hang.
Version: commit da69080 (current main), Elixir 1.19.4, OTP 28
These examples all display the hang:
Comparatively, these examples parse fine, no issues:
For the record, I don't have any use case for
for updatebut found that it also hangs, so provided here for completeness.