> Richard Hipp said on Saturday, 13 July, 2013 11:59:

> > I don't know.  It works entirely as expected.  If I move a row (via
> > update) that I have already visited into a position where it is "yet
> > to be visited", then I will visit it twice -- both times exactly when
> > and where expected.

> Please try again after adding "ORDER BY +rowid" to the query.  The "+"
> before "rowid" is important in the previous.  If you already have an
> ORDER BY clause on your query, simply add a "+" sign to the first term.  

> Let me know if the row still gets visited twice.

This works.

I see that it forces the entire query to run on the first call to _step() and 
storing the results to a temporary b-tree, then returning results from that 
b-tree instead of direct traversal for each _step().  In my case this does fix 
the multiple visits and I expect that it would work in every use case.  As a 
side effect the query results are stable and would not see any updates 
performed against tables involved in the query on the same connection during 
retrieval of the outer result set.





_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to