Compare commits

...

1 Commits

Author SHA1 Message Date
Eric Espie
0cfd5c044b 8782 - Union queries allow all data 2026-02-18 09:54:37 +01:00
2 changed files with 10 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ class DBUnionSearch extends DBSearch
public function AllowAllData($bAllowAllData = true)
{
foreach ($this->aSearches as $oSearch) {
$oSearch->AllowAllData();
$oSearch->AllowAllData($bAllowAllData);
}
}

View File

@@ -694,6 +694,15 @@ class DBSearchTest extends ItopDataTestCase
$this->CheckNestedSearch($sNestedQuery, false);
}
public function testAllowAllDataOnUnions()
{
$oSearch = \DBObjectSearch::FromOQL('SELECT Server UNION SELECT VirtualMachine');
$oSearch->AllowAllData(false);
self::assertFalse($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
$oSearch->AllowAllData(true);
self::assertTrue($oSearch->IsAllDataAllowed(), 'DBUnionSearch AllowData value');
}
private function CheckNestedSearch($sQuery, $bAllowAllData)
{
$oNestedQuerySearch = \DBObjectSearch::FromOQL($sQuery);