silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
719 stars 820 forks source link

MariaDB unit test failure - complex hierarchical CTE with aliased columns #11046

Closed emteknetnz closed 7 months ago

emteknetnz commented 8 months ago

Failing in MariaDB but not MySQL

https://github.com/silverstripe/silverstripe-framework/actions/runs/6785846946/job/18445062586

1) SilverStripe\ORM\Tests\SQLSelectTest::testWith with data set "complex hierarchical CTE with aliased columns" ('hierarchy', SilverStripe\ORM\Queries\SQLSelect Object (...), array(), true, array('"SQLSelectTestCteRecursive"."Title"'), '"SQLSelectTestCteRecursive"', array(array('hierarchy', '"SQLSelectTestCteRecursive"."...nt_id"')), array(array('child1'), array('parent'), array('grandparent')))
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     0 => Array (
-        'Title' => 'child1'
+        'Title' => 'grandparent'
     )
     1 => Array (...)
     2 => Array (
-        'Title' => 'grandparent'
+        'Title' => 'child1'
     )
 )

PRs

GuySartorelli commented 8 months ago

I suspect this is similar to issues we used to have with unit tests failing postgres because we didn't apply a sort order - so the sort order was undefined.

sabina-talipova commented 7 months ago

PR merged. Issue was solved.