On 02/26/2016 12:54 PM, Desmond Coertzen wrote:
I don't use the terms "bogus" and "weird" lightly.
A self contained test case is difficult to produce. I already built a script that creates a DB, three tables and test data, and then exercised the two forms of the the sub select. As expected, the test case does not provoke the behaviour whitnessed. Other than providing the entire DB dump to recreate the exact conditions that provoke this behaviour, I don't see how I can provide a self contained test case. The real table representing "long_story" in my report contains over 10.5 million rows and the behaviour in the sub select was not there before today. Possibly as my data collection grew, I may have stumbled over a problem.
I will try anyway by inserting more rows to try and provoke the behaviour. I will continue my answer on Tom's reply.
The real schema and sql used might get people started