[sqlite] order by not working in combination with random()

2015-08-17 Thread Richard Brinkman
I guess that a query likeSELECT random() as x FROM some_non_empty_table ORDER BY xis indeed transformed intoSELECT random() as x FROM some_non_empty_table ORDER BY random()prior to its execution. Question is why the implementation does that. Both from an efficiency point (don't calculate

[sqlite] Bug report page contains invalid e-mail address

2015-08-17 Thread Richard Brinkman
Hi, I tried to file a bug report. However the e-mail address as stated on http://www.sqlite.org/src/wiki?name=Bug+Reports (sqlite-users at sqlite.org) does not exist. It cost me quite some effort to find out the correct address which is sqlite-users at mailinglists.sqlite.org. Can someone

[sqlite] order by not working in combination with random()

2015-08-17 Thread Richard Brinkman
I've encountered strange behaviour which seems to be a bug in sqlite3. When a perform the following query: select random() as x from some_non_empty_table order by x desc limit 20; I get something like: -4348240540797173967 -8823092517172356709 4237024158005380173 897958093325532613