N°8782 - Union queries allow all data

This commit is contained in:
Eric Espie
2026-02-23 12:03:26 +01:00
parent 0cfd5c044b
commit f8102d32b0
2 changed files with 10 additions and 9 deletions

View File

@@ -694,15 +694,6 @@ class DBSearchTest extends ItopDataTestCase
$this->CheckNestedSearch($sNestedQuery, false); $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) private function CheckNestedSearch($sQuery, $bAllowAllData)
{ {
$oNestedQuerySearch = \DBObjectSearch::FromOQL($sQuery); $oNestedQuerySearch = \DBObjectSearch::FromOQL($sQuery);

View File

@@ -183,4 +183,14 @@ class DBUnionSearchTest extends ItopDataTestCase
], ],
]; ];
} }
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');
}
} }