You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ve...@apache.org on 2016/06/10 15:31:09 UTC

[2/3] incubator-ranger git commit: RANGER-1018 : Ranger User creation failing with SQLAnywhere and MS-SQL Server DB Flavor

RANGER-1018 : Ranger User creation failing with SQLAnywhere and MS-SQL Server DB Flavor

Signed-off-by: Velmurugan Periasamy <ve...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/7ee4aac1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/7ee4aac1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/7ee4aac1

Branch: refs/heads/master
Commit: 7ee4aac17fc61414ec97b24ef0c3cfbe2e9f5c71
Parents: 0f66b24
Author: pradeep agrawal <pr...@freestoneinfotech.com>
Authored: Wed Jun 8 17:11:46 2016 +0530
Committer: Velmurugan Periasamy <ve...@apache.org>
Committed: Fri Jun 10 11:30:02 2016 -0400

----------------------------------------------------------------------
 security-admin/db/mysql/create_dbversion_catalog.sql           | 2 +-
 .../db/sqlanywhere/patches/018-createtagsyncuser.sql           | 6 +++++-
 security-admin/db/sqlserver/patches/018-createtagsyncuser.sql  | 6 +++++-
 .../src/main/java/org/apache/ranger/biz/UserMgr.java           | 2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/7ee4aac1/security-admin/db/mysql/create_dbversion_catalog.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/mysql/create_dbversion_catalog.sql b/security-admin/db/mysql/create_dbversion_catalog.sql
index 9c90633..3c808ec 100644
--- a/security-admin/db/mysql/create_dbversion_catalog.sql
+++ b/security-admin/db/mysql/create_dbversion_catalog.sql
@@ -18,7 +18,7 @@ create table if not exists x_db_version_h  (
 	version   		varchar(64) not null,
 	inst_at 	    timestamp not null default current_timestamp,
 	inst_by 	    varchar(256) not null,
-	updated_at      timestamp not null,
+	updated_at      timestamp null default null,
     updated_by      varchar(256) not null,
 	active          ENUM('Y', 'N') default 'Y'
 ) ;

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/7ee4aac1/security-admin/db/sqlanywhere/patches/018-createtagsyncuser.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlanywhere/patches/018-createtagsyncuser.sql b/security-admin/db/sqlanywhere/patches/018-createtagsyncuser.sql
index 9b1ab09..2ca9497 100644
--- a/security-admin/db/sqlanywhere/patches/018-createtagsyncuser.sql
+++ b/security-admin/db/sqlanywhere/patches/018-createtagsyncuser.sql
@@ -30,7 +30,11 @@ IF EXISTS(select * from SYS.SYSCOLUMNS where tname = 'x_portal_user') THEN
                         END IF;
                 END IF;
         END IF;
+        IF EXISTS(select * from SYS.SYSCONSTRAINT where constraint_name = 'x_portal_user_UK_email') THEN
+		ALTER TABLE dbo.x_portal_user DROP CONSTRAINT x_portal_user_UK_email;
+		ALTER TABLE dbo.x_portal_user ALTER email VARCHAR(512) DEFAULT NULL NULL;
+        END IF;
 END IF;
 END
 GO
-exit
\ No newline at end of file
+exit

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/7ee4aac1/security-admin/db/sqlserver/patches/018-createtagsyncuser.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/sqlserver/patches/018-createtagsyncuser.sql b/security-admin/db/sqlserver/patches/018-createtagsyncuser.sql
index b3c466b..196210d 100644
--- a/security-admin/db/sqlserver/patches/018-createtagsyncuser.sql
+++ b/security-admin/db/sqlserver/patches/018-createtagsyncuser.sql
@@ -35,6 +35,10 @@ BEGIN
             END
         END
     END
+    IF EXISTS(select * from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE where constraint_name = 'x_portal_user$x_portal_user_UK_email')
+    BEGIN
+        ALTER TABLE x_portal_user DROP CONSTRAINT x_portal_user$x_portal_user_UK_email;
+    END
 END
 GO
-exit
\ No newline at end of file
+exit

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/7ee4aac1/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
index d3befbe..a508926 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
@@ -1127,7 +1127,7 @@ public class UserMgr {
 		}
 		// access control
 		checkAdminAccess();
-		logger.info("create:" + userProfile.getEmailAddress());
+		logger.info("create:" + userProfile.getLoginId());
 		XXPortalUser xXPortalUser = null;
 		String loginId = userProfile.getLoginId();
 		String emailAddress = userProfile.getEmailAddress();