You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2015/09/10 03:39:54 UTC

hive git commit: HIVE-11746: Connect command should not to be allowed from user[beeline-cli branch] (Ferdinand Xu, reviewed by Xuefu Zhang)

Repository: hive
Updated Branches:
  refs/heads/beeline-cli fc53e5d7e -> 5c39d0772


HIVE-11746: Connect command should not to be allowed from user[beeline-cli branch] (Ferdinand Xu, reviewed by Xuefu Zhang)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/5c39d077
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/5c39d077
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/5c39d077

Branch: refs/heads/beeline-cli
Commit: 5c39d0772da89eb3692cfb012831f2884d811f6f
Parents: fc53e5d
Author: Ferdinand Xu <ch...@intel.com>
Authored: Wed Sep 9 21:38:16 2015 -0400
Committer: Ferdinand Xu <ch...@intel.com>
Committed: Wed Sep 9 21:38:16 2015 -0400

----------------------------------------------------------------------
 beeline/src/java/org/apache/hive/beeline/BeeLine.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/5c39d077/beeline/src/java/org/apache/hive/beeline/BeeLine.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
index 6bc2451..5db1bf7 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
@@ -881,7 +881,7 @@ public class BeeLine implements Closeable {
   }
 
   private int embeddedConnect() {
-    if (!dispatch("!connect " + Utils.URL_PREFIX + " '' ''")) {
+    if (!execCommandWithPrefix("!connect " + Utils.URL_PREFIX + " '' ''")) {
       return ERRNO_OTHER;
     } else {
       return ERRNO_OK;
@@ -1135,11 +1135,7 @@ public class BeeLine implements Closeable {
         return commands.sql(line, getOpts().getEntireLineAsCommand());
       }
     } else {
-      if (line.toLowerCase().startsWith("!connect")) {
-        return execCommandWithPrefix(line);
-      } else {
-        return commands.sql(line, getOpts().getEntireLineAsCommand());
-      }
+      return commands.sql(line, getOpts().getEntireLineAsCommand());
     }
   }