hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1531706 - /hive/trunk/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
Date Sun, 13 Oct 2013 16:24:24 GMT
Author: hashutosh
Date: Sun Oct 13 16:24:23 2013
New Revision: 1531706

URL: http://svn.apache.org/r1531706
Log:
HIVE-5496 : hcat -e drop database if exists fails on authorizing non-existent null db (Sushanth
Sowmyan via Ashutosh Chauhan)

Modified:
    hive/trunk/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java

Modified: hive/trunk/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java?rev=1531706&r1=1531705&r2=1531706&view=diff
==============================================================================
--- hive/trunk/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
(original)
+++ hive/trunk/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
Sun Oct 13 16:24:23 2013
@@ -271,7 +271,11 @@ public class HCatSemanticAnalyzer extend
     DropDatabaseDesc dropDb = work.getDropDatabaseDesc();
     if (dropDb != null) {
       Database db = cntxt.getHive().getDatabase(dropDb.getDatabaseName());
-      authorize(db, Privilege.DROP);
+      if (db != null){
+        // if above returned a null, then the db does not exist - probably a
+        // "drop database if exists" clause - don't try to authorize then.
+        authorize(db, Privilege.DROP);
+      }
     }
 
     DescDatabaseDesc descDb = work.getDescDatabaseDesc();



Mime
View raw message