Change in ovirt-engine[master]: core: user level queries - filtered entities

emesika at redhat.com emesika at redhat.com
Sun Jun 17 10:42:05 UTC 2012


Eli Mesika has submitted this change and it was merged.

Change subject: core: user level queries - filtered entities
......................................................................


core: user level queries - filtered entities

This patch enables to filter data vertically in addition to the
horizontal filtering support.
Up to now, we had filtered some SPs that are accessible by users
horizontally (i.e. returning part of the resulted query rows by adding
a where clause)
Now, we will enable to filter those SPs returned data also vertically
(i.e set NULL as the value of some columns in the returned result set)

This is done by:
1) Adding a table called object_column_white_list that holds for each relevant
table/view for which we want to show, other columns are filtered vertically,
the column names that should have NULL values in the returned result.
The script adding this table and inserting its initial data is reentrant
and run the in pre-upgrade step.

A second table object_column_white_list_sql stores the generated sql per
object. This sql is cleaned upon upgrade to reflect schema changes since
if a column was added to an object that is already participating in
vertical filtering, this column will be automatically filtered out
unless added specifically in the
upgrade/pre_upgrade/add_object_column_white_list_table.sql script.

2) A function fn_db_mask_object that accepts the object to filter and
returns the result with filtered column values.

3) a function to add new object columns to the white list
   fn_db_add_column_to_object_white_list

Currently, we have only 2 user queries that returns the Power Management
details and can be accessed by users. The SPs that are executed by those
queries were modified to add a vertical filter on top of the existing
horizontal one.

This can be easily expanded to other queries by adding the relevant
meta data in the pre_upgrade/add_object_column_white_list_table.sql script and
modify the relevant SPs to filter data vertically.

Change insures that admin portal is not affected by this change, so any
query running from admin portal will run natively without any change.
Vertical filtering takes place when the v_is_filtered flag passed to the
SP is true.
The work in building the SQL is done once per object so it will not
affect performance for users as well.

Change-Id: If68b290aaacc0eea5d117ef64536cbf94d195cee
Signed-off-by: Eli Mesika <emesika at redhat.com>
---
M backend/manager/dbscripts/common_sp.sql
A backend/manager/dbscripts/upgrade/pre_upgrade/add_object_column_white_list_table.sql
M backend/manager/dbscripts/vds_sp.sql
3 files changed, 158 insertions(+), 21 deletions(-)

Approvals:
  Eli Mesika: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/4469
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If68b290aaacc0eea5d117ef64536cbf94d195cee
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>



More information about the Engine-commits mailing list