Skip to content

StackOverflowException on large tables #18

@Genbox

Description

@Genbox

When enumerating a table like this:

using FileStream fs = File.OpenRead(file);
using Sqlite3Database db = new Sqlite3Database(fs);
Sqlite3Table tbl = db.GetTable("table");

 foreach (Sqlite3Row row in tbl.EnumerateRows())
{
     // do something with row
}

The call stack in your code is this:

  • Sqlite3Table.EnumerateRows
  • BTreeTools.WalkTableBTree
  • BTreeTools.WalkTableBTree´1
  • BTreePage.Parse
  • BTreeTools.WalkTableBTree

The calls are essentially recursive, which causes a stack overflow for tables with a large B+ tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions