On 28 Aug 2015, at 10:20am, Domingo Alvarez Duarte <sqlite-mail at 
dev.dadbiz.es> wrote:

> Please remember that the "random" function here is only a detail the real
> problem is the "column expression" been reevaluated more than once. 

Yes.  When considering fixes for this problem one needs to also consider 
non-deterministic user-defined functions, like Jean-Christophe Deschamps' 
function "new_uuid()" which returns a new value every time it is called.  It's 
not good enough to make a fix explicitly for random().

I note with interest the constant SQLITE_DETERMINISTIC which may be helpful.

So any fix for the overall problem must work

* both with random() and with non-deterministic user-defined functions
* with a column being used in WHERE
* with a column being used in ORDER BY
* with a column being used in LIMIT
* with a column being used in OFFSET

Simon.

Reply via email to