Author: hashutosh
Date: Thu Apr 28 00:39:53 2011
New Revision: 1097298

URL: http://svn.apache.org/viewvc?rev=1097298&view=rev
Log:
HCATALOG-6 Unit test TestPermsInheritance fails

Modified:
    incubator/hcatalog/trunk/hive/   (props changed)
    
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateDatabaseHook.java
    
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateTableHook.java
    
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java

Propchange: incubator/hcatalog/trunk/hive/
------------------------------------------------------------------------------
--- svn:externals (original)
+++ svn:externals Thu Apr 28 00:39:53 2011
@@ -1 +1 @@
--r 1071529 http://svn.apache.org/repos/asf/hive/branches/branch-0.7/ external
+-r 1085590 http://svn.apache.org/repos/asf/hive/tags/release-0.7.0 external

Modified: 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateDatabaseHook.java
URL: 
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateDatabaseHook.java?rev=1097298&r1=1097297&r2=1097298&view=diff
==============================================================================
--- 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateDatabaseHook.java
 (original)
+++ 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateDatabaseHook.java
 Thu Apr 28 00:39:53 2011
@@ -49,7 +49,7 @@ final class CreateDatabaseHook  extends 
     // Analyze and create tbl properties object
     int numCh = ast.getChildCount();
 
-    databaseName = 
BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText());
+    databaseName = 
BaseSemanticAnalyzer.getUnescapedName((ASTNode)ast.getChild(0));
 
     for (int num = 1; num < numCh; num++) {
       ASTNode child = (ASTNode) ast.getChild(num);

Modified: 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateTableHook.java
URL: 
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateTableHook.java?rev=1097298&r1=1097297&r2=1097298&view=diff
==============================================================================
--- 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateTableHook.java
 (original)
+++ 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/CreateTableHook.java
 Thu Apr 28 00:39:53 2011
@@ -66,7 +66,7 @@ final class CreateTableHook  extends Abs
     int numCh = ast.getChildCount();
 
     String inputFormat = null, outputFormat = null;
-    tableName = 
BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText());
+    tableName = 
BaseSemanticAnalyzer.getUnescapedName((ASTNode)ast.getChild(0));
 
     for (int num = 1; num < numCh; num++) {
       ASTNode child = (ASTNode) ast.getChild(num);
@@ -90,7 +90,7 @@ final class CreateTableHook  extends Abs
       case HiveParser.TOK_LIKETABLE:
 
         String likeTableName;
-        if (child.getChildCount() > 0 && (likeTableName = 
BaseSemanticAnalyzer.unescapeIdentifier(child.getChild(0).getText())) != null) {
+        if (child.getChildCount() > 0 && (likeTableName = 
BaseSemanticAnalyzer.getUnescapedName((ASTNode)ast.getChild(0))) != null) {
 
           throw new SemanticException("Operation not supported. CREATE TABLE 
LIKE is not supported.");
 //          Map<String, String> tblProps;

Modified: 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
URL: 
http://svn.apache.org/viewvc/incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java?rev=1097298&r1=1097297&r2=1097298&view=diff
==============================================================================
--- 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 (original)
+++ 
incubator/hcatalog/trunk/src/java/org/apache/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 Thu Apr 28 00:39:53 2011
@@ -111,7 +111,7 @@ public class HCatSemanticAnalyzer extend
         break;
 
       case HiveParser.TOK_SHOWPARTITIONS:
-        
authorize(BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText()), 
context, FsAction.READ, false);
+        
authorize(BaseSemanticAnalyzer.getUnescapedName((ASTNode)ast.getChild(0)), 
context, FsAction.READ, false);
         break;
 
       case HiveParser.TOK_ALTERTABLE_ADDPARTS:
@@ -122,7 +122,7 @@ public class HCatSemanticAnalyzer extend
       case HiveParser.TOK_ALTERTABLE_PROPERTIES:
       case HiveParser.TOK_ALTERTABLE_SERIALIZER:
       case HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES:
-        
authorize(BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText()), 
context, FsAction.WRITE, false);
+        
authorize(BaseSemanticAnalyzer.getUnescapedName((ASTNode)ast.getChild(0)), 
context, FsAction.WRITE, false);
         break;
 
       case HiveParser.TOK_ALTERTABLE_PARTITION:
@@ -130,11 +130,11 @@ public class HCatSemanticAnalyzer extend
         break;
 
       case HiveParser.TOK_SWITCHDATABASE:
-        
authorize(BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText()), 
context, FsAction.READ, true);
+        
authorize(BaseSemanticAnalyzer.getUnescapedName((ASTNode)ast.getChild(0)), 
context, FsAction.READ, true);
         break;
 
       case HiveParser.TOK_DROPDATABASE:
-        
authorize(BaseSemanticAnalyzer.unescapeIdentifier(ast.getChild(0).getText()), 
context, FsAction.WRITE, true);
+        
authorize(BaseSemanticAnalyzer.getUnescapedName((ASTNode)ast.getChild(0)), 
context, FsAction.WRITE, true);
         break;
 
       case HiveParser.TOK_CREATEDATABASE:


Reply via email to