QoQ rand() regression - 5.4.0.80

Description

was working in 5.3.10.120

this has been fixed with support in native QoQ with 6.0

I’m assuming that fixed something and now it doesn’t fallback to HSQLDB, thus it’s hitting native QoQ which doesn’t support it in 5.4, or it was a different issue, as we have fixed a number of QoQ issues with HSQLDB since 5.4.0.80 as it included a major upgrade of the HSQLDB engine from 1.8.0 (2009) to 2.7.2 (2023)

Environment

None

relates to

Activity

Pothys - MitrahSoft 
14 July 2023 at 10:41

I checked this issue with the affected version 5.4.0.80 -SNAPSHOT . when I use rand() with native QoQ it throws an error and it works fine with Lucee 6.0

Zac Spitzer 
6 July 2023 at 15:42

actually it’s looking quite good first is hsqldb, second is native

https://trycf.com/gist/97a6bb0afa05409cce6d555f8775db23/lucee6-beta?theme=monokai

Zac Spitzer 
6 July 2023 at 15:33

the native implementation in 6 is different to hsqldb’s

hsqldb follows mysql more or less, while as it stands, the native matches sql server ( did a lot of research on this)

the difference is mysql takes a rand seed and treats each subsequent call as getting the next value in that seeded set within that query

sql server, returns the same value for a seed each time, while also taking the value from the first seeded rand() call and using that seed for subsequent rand() (without seed calls) in the query, rather than returning the next sequential random numbers from the seeded set of random numbers

TL;DR sql server will return the same random number each time

Personally I prefer the mysql / hsqldb approach

Brad Wood 
6 July 2023 at 13:38

Zac Spitzer 
6 July 2023 at 10:16

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 6 July 2023 at 10:09
Updated 1 August 2023 at 10:48