On Jun 1, 2010, at 10:21 AM, Peter Kolbus wrote: > I am getting an access violation in rtree.c::nodeGetRowid() using a > database image of questionable integrity (the application the database > was last updated on shut down abnormally, but executing PRAGMA > integrity_check returns "ok" and there is no journal file). The > access violation can be reproduced by executing the following query in > the sqlite3 shell: > > DELETE FROM history_rtree WHERE NOT EXISTS(SELECT _id FROM history > WHERE history._id = history_rtree._id); > > Adding a check for pLeaf to the if condition on line 2383 prevents the > access violation: > > if( rc==SQLITE_OK && pLeaf ) { > > Is this the correct fix?
I think the condition you have hit indicates the database is corrupted (corrupted in the sense that somehow the underlying tables used by the rtree module are no longer internally consistent). If you are able to, please send me the database by email so I can investigate further. The fix you propose would ignore the (suspected) corruption and continue without reporting it to the user. Which might be the best thing for some applications. Better than crashing anyhow. On the other hand, it isn't a particularly pleasant thought that this can happen... Dan. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users