That's an interesting one. I made some changes to the way that loop is laid out here: [](https://sqlite.org/src/info/d85f4f27f58adcc7) [](https://sqlite.org/src/info/d85f4f27f58adcc7) Then I also added a cast that might be missing: [](https://sqlite.org/src/info/6ff9673847c0b417) Do these patches fix things? And, if you're in a mood to experiment, does applying the last patch alone (the one with the cast) fix things? Thanks, Dan.