You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by pr...@apache.org on 2019/05/10 06:07:18 UTC

[ranger] branch master updated: RANGER-2419: Improve sql script to skip statements when atlas service def is not supported

This is an automated email from the ASF dual-hosted git repository.

pradeep pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 91dfeb7  RANGER-2419: Improve sql script to skip statements when atlas service def is not supported
91dfeb7 is described below

commit 91dfeb7d322f56549a5f311ef311a1a3b0cb34da
Author: Pradeep <pr...@apache.org>
AuthorDate: Thu May 9 11:26:19 2019 +0530

    RANGER-2419: Improve sql script to skip statements when atlas service def is not supported
---
 security-admin/db/oracle/patches/035-update-schema-for-x-policy.sql | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/security-admin/db/oracle/patches/035-update-schema-for-x-policy.sql b/security-admin/db/oracle/patches/035-update-schema-for-x-policy.sql
index 3afdf47..478ca25 100644
--- a/security-admin/db/oracle/patches/035-update-schema-for-x-policy.sql
+++ b/security-admin/db/oracle/patches/035-update-schema-for-x-policy.sql
@@ -205,7 +205,10 @@ DECLARE
 BEGIN
 select count(*) into v_record_exists from x_db_version_h where version = 'J10013';
 	if (v_record_exists = 1) then
-		select name into new_atlas_def_name from x_service_def where name like 'atlas.%';
+		select count(*) into v_record_exists from x_service_def where name like 'atlas.%';
+		if (v_record_exists > 0) then
+			select name into new_atlas_def_name from x_service_def where name like 'atlas.%';
+		end if;
 		select count(*) into v_record_exists from x_access_type_def where def_id in(select id from x_service_def where name='tag') and name in('atlas:read','atlas:create','atlas:update','atlas:delete','atlas:all');
 		if (v_record_exists > 0) then
 			sql_stmt := 'UPDATE x_access_type_def set name=concat(:1,:2) where def_id=100 and name=:3';