Yes I have a result similar as you can see from the screenshot. The result is random too. I presume that caused by the parallelism put in place under Lucee 6.
By default, any QoQ on a query object less than 50 rows will execute sequentially (no threads) because the overhead of managing the joining the threads is normally more than the benifit. 50+ rows seems to be where the benifit outweighs the overhead, so all query objects with that least that many rows will be processed in parallel.
I have maybe the impression that could be related to it.
If I set the lucee variable lucee.qoq.parallelism=9999999. I don’t have the issue anymore.
I try with different type. I never been able to reproduce it with an other type. I even change my original query and cast it as a varchar and that was resolving the issue too.
My colleague had the same idea. We valid it the millisecond are equal. The result can be random even if the query return the same values and have an order on a Primary key.
I wonder if the algorithm which creates the unique key for each row is serializing the dates differently. It involves the to string casting and, if the value is longer than 255 chars, an MD5 hash. I don’t think the hash would kick in for a date, but it’s possible the string caster isn’t giving back the same value for each one. I need to be able to reproduce it though, and as I posted above, it’s not reproducing for me on trycf.
Wow, nice find! I assume there’s something related with the string caster casting dates with a time zone that maybe isn’t thread safe. I haven’t been able to pinpoint that just yet. I’m not 100% sure which code path is being followed to convert the dates into strings for the partition keys behind the scenes.