tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject git commit: TAJO-174: SQL error handler sometimes occurred NPE. (jinho)
Date Tue, 10 Sep 2013 01:44:06 GMT
Updated Branches:
  refs/heads/master 74c369ee2 -> 2a26edffe


TAJO-174: SQL error handler sometimes occurred NPE. (jinho)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tajo/commit/2a26edff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/2a26edff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/2a26edff

Branch: refs/heads/master
Commit: 2a26edffed8a309ab53f6d253b813e07fa53c245
Parents: 74c369e
Author: jinossy <jinossy@gmail.com>
Authored: Tue Sep 10 10:43:18 2013 +0900
Committer: jinossy <jinossy@gmail.com>
Committed: Tue Sep 10 10:43:18 2013 +0900

----------------------------------------------------------------------
 CHANGES.txt                                                    | 2 ++
 .../org/apache/tajo/engine/query/exception/SQLParseError.java  | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/2a26edff/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index bfd30a2..7186074 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -133,6 +133,8 @@ Release 0.2.0 - unreleased
 
   BUG FIXES
 
+    TAJO-174: SQL error handler sometimes occurred NPE. (jinho)
+
     TAJO-170: mvn compile error when building tar file. (jaehwa)
 
     TAJO-154: Query calculates wrong progress in multiple step queries.

http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/2a26edff/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/query/exception/SQLParseError.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/query/exception/SQLParseError.java
b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/query/exception/SQLParseError.java
index 34b639b..625981b 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/query/exception/SQLParseError.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/query/exception/SQLParseError.java
@@ -91,10 +91,12 @@ public class SQLParseError extends RuntimeException {
       } else if (errorLine.length() - (locationString.length() + padding) <= 0) {
         startPos = errorLine.length() - displayLimit - 1;
         sb.append(ellipsis).append(errorLine.substring(startPos)).append("\n");
-        sb.append(prefixPadding).append(locationString.substring(startPos - ellipsis.length()));
+        sb.append(prefixPadding).append(StringUtils.repeat(" ", ellipsis.length()))
+            .append(locationString.substring(startPos));
       } else {
         sb.append(ellipsis).append(errorLine.substring(startPos, startPos + displayLimit)).append(ellipsis).append("\n");
-        sb.append(prefixPadding).append(locationString.substring(startPos - ellipsis.length()));
+        sb.append(prefixPadding).append(StringUtils.repeat(" ", ellipsis.length()))
+            .append(locationString.substring(startPos));
       }
     } else {
       sb.append(errorLine).append("\n");


Mime
View raw message