mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N.609 Some multi-column UNION queries failing with various symptoms such as "Class 'IT Department' not found" or "An object id must be an integer value"
SVN:trunk[4634]
This commit is contained in:
@@ -5518,3 +5518,30 @@ class TestIntersectNotOptimized extends TestBizModel
|
||||
echo "<p>Successfully tested the SQL query.</p>\n";
|
||||
}
|
||||
}
|
||||
|
||||
class TestBug609 extends TestBizModel
|
||||
{
|
||||
static public function GetName()
|
||||
{
|
||||
return 'UNION with JOINS ordered differently';
|
||||
}
|
||||
|
||||
static public function GetDescription()
|
||||
{
|
||||
return '(N.609) Inconsistent SQL query (various symptoms, must mostly in the form of "Class \'IT Department\' not found"';
|
||||
}
|
||||
|
||||
protected function DoExecute()
|
||||
{
|
||||
$sQueryA = 'SELECT t,o FROM Team AS t JOIN Organization AS o ON t.org_id = o.id';
|
||||
$sQueryB = 'SELECT t,o FROM Organization AS o JOIN Team AS t ON t.org_id = o.id';
|
||||
|
||||
$oSearch = DBSearch::FromOQL("$sQueryB UNION $sQueryA");
|
||||
|
||||
$oSet = new DBObjectSet($oSearch);
|
||||
while($oObject = $oSet->Fetch())
|
||||
{
|
||||
echo "Successfull load for <b>".$oObject->GetName()."</b><br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user