asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject asterixdb git commit: return an error if not statement is provided
Date Wed, 31 Aug 2016 03:57:34 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master ee3ec00c9 -> 8e4198bbb


return an error if not statement is provided

Change-Id: I5e453ef1f13744281c1316c849b043f02cdd13e0
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1129
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/8e4198bb
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/8e4198bb
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/8e4198bb

Branch: refs/heads/master
Commit: 8e4198bbb7066973b8ce077a9efadf9831303f52
Parents: ee3ec00
Author: Till Westmann <tillw@apache.org>
Authored: Tue Aug 30 17:16:38 2016 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Tue Aug 30 20:57:02 2016 -0700

----------------------------------------------------------------------
 .../apache/asterix/api/http/servlet/QueryServiceServlet.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/8e4198bb/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
index 015044c..b4097d1 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
@@ -49,8 +49,8 @@ import org.apache.asterix.lang.common.base.IParser;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.metadata.MetadataManager;
 import org.apache.asterix.translator.IStatementExecutor;
-import org.apache.asterix.translator.IStatementExecutor.Stats;
 import org.apache.asterix.translator.IStatementExecutorFactory;
+import org.apache.asterix.translator.IStatementExecutor.Stats;
 import org.apache.commons.io.IOUtils;
 import org.apache.hyracks.algebricks.core.algebra.prettyprint.AlgebricksAppendable;
 import org.apache.hyracks.api.client.IHyracksClientConnection;
@@ -390,7 +390,6 @@ public class QueryServiceServlet extends HttpServlet {
     private void handleRequest(HttpServletRequest request, HttpServletResponse response,
String query)
             throws IOException {
         long elapsedStart = System.nanoTime();
-
         final StringWriter stringWriter = new StringWriter();
         final PrintWriter resultWriter = new PrintWriter(stringWriter);
 
@@ -408,6 +407,9 @@ public class QueryServiceServlet extends HttpServlet {
         printSignature(resultWriter);
         printType(resultWriter, sessionConfig);
         try {
+            if (query == null || query.isEmpty()) {
+                throw new AsterixException("Empty request, no statement provided");
+            }
             IHyracksClientConnection hcc;
             IHyracksDataset hds;
             ServletContext context = getServletContext();


Mime
View raw message