asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: return an error if not statement is provided
Date Wed, 31 Aug 2016 00:17:09 GMT
Till Westmann has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1129

Change subject: return an error if not statement is provided
......................................................................

return an error if not statement is provided

Change-Id: I5e453ef1f13744281c1316c849b043f02cdd13e0
---
M asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/servlet/QueryServiceServlet.java
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/29/1129/1

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.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 @@
     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 @@
         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();

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1129
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e453ef1f13744281c1316c849b043f02cdd13e0
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <tillw@apache.org>

Mime
View raw message