Skip to content

Commit

Permalink
Merge #87
Browse files Browse the repository at this point in the history
87: box parser r=psarna a=MarinPostma

This pr puts the parser on the heap. It's quite chunky, and caused stackoverflows in the past. I'm working to get a nicer patch to upstream lemon-rs, but it requires more work for somilar effects.

I also remove the dependency on my patch


Co-authored-by: ad hoc <postma.marin@protonmail.com>
  • Loading branch information
bors[bot] and MarinPostma authored Jan 23, 2023
2 parents 0141433 + d2e04d6 commit fafe68d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
7 changes: 4 additions & 3 deletions libsql-server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions libsql-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ members = [
[patch."https://github.com/psarna/mvsqlite"]
mvfs = { git = "https://github.com/MarinPostma/mvsqlite", branch = "use-cchar" }
mwal = { git = "https://github.com/MarinPostma/mvsqlite", branch = "use-cchar" }

[patch.crates-io]
sqlite3-parser = { git = "https://github.com/MarinPostma/lemon-rs.git", rev = "d3a6365" }
2 changes: 1 addition & 1 deletion libsql-server/sqld/src/query_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl Statement {
kind,
})
}
let mut parser = Parser::new(s.as_bytes());
let mut parser = Box::new(Parser::new(s.as_bytes()));
std::iter::from_fn(move || match parser.next() {
Ok(Some(cmd)) => Some(parse_inner(cmd)),
Ok(None) => None,
Expand Down

0 comments on commit fafe68d

Please sign in to comment.