My code goes through and finds all leaf pages than searches them for matches. My code is returning duplicate entries. I noticed for example for Charlie the Owl (New Earth). if you look at page 41 and 83 you can find entries for it. Both seem to be leaf table pages (first bytes is 0x0d).
I believe I have some misunderstanding about how sqllite pages work. Any help would be appreciated.
example query
./your_program.sh superheroes.db “SELECT id, name FROM superheroes WHERE eye_color = ‘Amber Eyes’”
My result:
840|Charlie the Owl (New Earth)
1151|Freak (New Earth)
1874|Meloni Thawne (New Earth)
2077|Lynx II (New Earth)
1151|Freak (New Earth)
2077|Lynx II (New Earth)
840|Charlie the Owl (New Earth)
1874|Meloni Thawne (New Earth)
78|Mari McCabe (New Earth)