On Sat, Apr 13, 2013 at 11:25:41PM +0700, Dan Kennedy scratched on the wall: > On 04/13/2013 11:22 PM, kenichi ishigaki wrote: > >Hi. > > > >I received a report that the result of the following SQL has changed > >since 3.7.15. > >I haven't looked into the sqlite source yet, but can we call this a bug? > > No. No "ORDER BY" clause means that the results are delivered in > an undefined order. So both results are the same.
In fact, SQLite has a "PRAGMA reverse_unordered_selects" configuration that changes the default ordering. This specifically exists to test applications and make sure they don't assume a specific ordering in queries that lack an ORDER BY clause. You might consider this to test other areas of your application. http://sqlite.org/pragma.html#pragma_reverse_unordered_selects When enabled, this PRAGMA causes SELECT statements without an ORDER BY clause to emit their results in the reverse order of what they normally would. This can help debug applications that are making invalid assumptions about the result order. SQLite makes no guarantees about the order of results if a SELECT omits the ORDER BY clause. Even so, the order of results does not change from one run to the next, and so many applications mistakenly come to depend on the arbitrary output order whatever that order happens to be. However, sometimes new versions of SQLite will contain optimizer enhancements that will cause the output order of queries without ORDER BY clauses to shift. When that happens, applications that depend on a certain output order might malfunction. By running the application multiple times with this pragma both disabled and enabled, cases where the application makes faulty assumptions about output order can be identified and fixed early, reducing problems that might be caused by linking against a different version of SQLite. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users