Description of problem: This Bug was reported by Dan Yasny on a 3.1 clean install After the installation, the ISO Storage Domain was already addatched to the Default DC. Adding a new DC and attaching the ISO domain to it as well Then, trying to activate the ISO domain on the new DC generates a SQL ERROR: "more than one row returned by a subquery used as an expression" Version-Release number of selected component (if applicable): 3.1 beta How reproducible: always Steps to Reproduce: 1.Clean install 2.Add a new DC 3.Attach ISO domain to the new DC 4.Activate the ISO domain in new DC Actual results: SQL Exception "more than one row returned by a subquery used as an expression" Expected results: Activate should succeed Additional info: This is a general error that might hav afffect on other flows as well. During the activate a call to get_entity_permissions SQL function is issued This in turn calls : fn_get_entity_parents For the relevant scenario the following code is executed : WHEN v_entity_type = 11 THEN -- Storage Domain RETURN QUERY SELECT system_root_id AS id UNION SELECT storage_pool_id as id FROM storage_pool_iso_map WHERE storage_id = v_entity_id UNION SELECT v_entity_id AS id; Postgres assumes that SELECT storage_pool_id as id FROM storage_pool_iso_map is returning a literal In order to fix that we must change in fn_get_entity_parents for all v_entity_type to use UNION ALL instead of UNION i.e in this case the following code will work: WHEN v_entity_type = 11 THEN -- Storage Domain RETURN QUERY SELECT system_root_id AS id UNION ALL SELECT storage_pool_id as id FROM storage_pool_iso_map WHERE storage_id = v_entity_id UNION ALL SELECT v_entity_id AS id;
http://gerrit.ovirt.org/#/c/7804/1
si18. can attach ISO domain to several DC. (more than 2).