hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject incubator-hawq git commit: HAWQ-1365. Print out detailed schema information for tables which the user doesn't have privileges
Date Wed, 01 Mar 2017 05:31:48 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 6d5792c40 -> 97104833e


HAWQ-1365. Print out detailed schema information for tables which the user doesn't have privileges


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

Branch: refs/heads/master
Commit: 97104833e8cff3c99ebb9db9e4cdfaa12997692e
Parents: 6d5792c
Author: interma <interma@outlook.com>
Authored: Tue Feb 28 12:38:15 2017 +0800
Committer: Wen Lin <wlin@pivotal.io>
Committed: Wed Mar 1 13:30:53 2017 +0800

----------------------------------------------------------------------
 src/backend/catalog/namespace.c                         | 12 +++++++-----
 src/backend/parser/parse_relation.c                     |  3 ++-
 .../ManagementTool/test_hawq_register_usage1.cpp        |  6 +++---
 3 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/97104833/src/backend/catalog/namespace.c
----------------------------------------------------------------------
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index da6ceaf..b7b6c36 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -1982,6 +1982,13 @@ recomputeNamespacePath(void)
 			elog(DEBUG3, "recompute search_path[%s] when acl_type is ranger", namespace_search_path);
 		}
 	}
+	else 
+	{
+		if (aclType == HAWQ_ACL_RANGER && debug_query_string != NULL)
+		{
+			last_query_sign = string_hash(debug_query_string, strlen(debug_query_string));
+		}
+	}
 
 	/* Need a modifiable copy of namespace_search_path string */
 	rawname = pstrdup(namespace_search_path);
@@ -2119,11 +2126,6 @@ recomputeNamespacePath(void)
 	namespaceSearchPathValid = true;
 	namespaceUser = roleid;
 
-	if (debug_query_string != NULL)
-	{
-		last_query_sign = string_hash(debug_query_string, strlen(debug_query_string));
-	}
-
 	/* Clean up. */
 	pfree(rawname);
 	list_free(namelist);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/97104833/src/backend/parser/parse_relation.c
----------------------------------------------------------------------
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 676f8bf..d21ea01 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -2800,7 +2800,8 @@ ExecCheckRTPermsWithRanger(List *rangeTable)
 			/* collect all acl fail relations */
 			Oid relOid = result_ptr->relOid;
 			const char *rel_name = get_rel_name_partition(relOid);
-			appendStringInfo(&acl_fail_msg, "%s", rel_name);
+			const char *namespace_name = get_namespace_name(get_rel_namespace(relOid));
+			appendStringInfo(&acl_fail_msg, "%s.%s", namespace_name, rel_name);
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/97104833/src/test/feature/ManagementTool/test_hawq_register_usage1.cpp
----------------------------------------------------------------------
diff --git a/src/test/feature/ManagementTool/test_hawq_register_usage1.cpp b/src/test/feature/ManagementTool/test_hawq_register_usage1.cpp
index 4359fb7..aaba212 100644
--- a/src/test/feature/ManagementTool/test_hawq_register_usage1.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register_usage1.cpp
@@ -445,15 +445,15 @@ TEST_F(TestHawqRegister, TestUsage1EofFailure) {
 
 TEST_F(TestHawqRegister, TestUsage1FolderFailure) {
     SQLUtility util;
-    string folderName = "usage1tmp";
-    string folderNameNotExist = "usage1tmpNotExist";
+    string folderName = "usage1_folder_tmp";
+    string folderNameNotExist = "usage1_folder_tmpNotExist";
     string rootPath(util.getTestRootPath());
     string relativePath("/ManagementTool/test_hawq_register_hawq.paq");
     string filePath = rootPath + relativePath;
     string relativePath2("/ManagementTool/files_incomplete.yml");
     string filePath2 = rootPath + relativePath2;
 
-    auto cmd = hawq::test::stringFormat("hdfs dfs -mkdir %s/usage1tmp", getHdfsLocation().c_str(),
"");
+    auto cmd = hawq::test::stringFormat("hdfs dfs -mkdir %s/%s", getHdfsLocation().c_str(),
folderName.c_str());
     EXPECT_EQ(0, Command::getCommandStatus(cmd));
 
     util.execute("create table hawqregister(i int) with (appendonly=true, orientation=parquet);");


Mime
View raw message