Ocsipersist_sqlite assumption about ROWIDs
Hi
this function db_iter_step (https://github.com/ocsigen/ocsigenserver/blob/master/src/extensions/ocsipersist-sqlite/ocsipersist.ml#L161) seems to assume that Sqlite's select statement returns increasing ROWID values.
I can't find that in Sqlite's documentation, how are we sure of that?
There is that warning in the documentation:
Important warning: this iterator may not iter on all data of the table if another thread is modifying it in the same time. Nonetheless, it should not miss more than a very few data from time to time, except if the table is very old (at least 9 223 372 036 854 775 807 insertions).
Maybe related to someone's hidden knowledge? :)
I don't remember this. May be @kerneis has an idea?
Looking at the seminal commit for ocsipersist_sqlite (d9e7c1fd3ac121cfaf6d10fe32e9757d7ba9c0c6), it looks like this code is mine indeed. But I can't remember the reasoning behind it. Probably something I found in a doc, but it might have changed in the meantime. And it was the very first time I used SQLite, so I may have been wrong too. Sorry.
After some Googling, note that adding AUTOINCREMENT would ensure the correctness of this assumption (but I'm not saying you should use it, it has other drawbacks): https://www.sqlite.org/autoinc.html
Oh no sorry, I'm confused. The issue here is with select, not insert.