You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/03/23 07:59:21 UTC

[32/50] [abbrv] kylin git commit: KYLIN-1472 special character cause export query result failed, fixed by @nichunen

KYLIN-1472 special character cause export query result failed, fixed by @nichunen


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/53e72968
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/53e72968
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/53e72968

Branch: refs/heads/KYLIN-1122-B1
Commit: 53e729688cddb1d9e7b60d7176918ef60d44f7e7
Parents: 57ac149
Author: Jason <ji...@163.com>
Authored: Thu Mar 10 10:09:15 2016 +0800
Committer: Xiaoyu Wang <wa...@apache.org>
Committed: Mon Mar 21 19:57:35 2016 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/query.js          | 4 +++-
 webapp/app/partials/query/query_detail.html | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/53e72968/webapp/app/js/controllers/query.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/query.js b/webapp/app/js/controllers/query.js
index 785d07e..cc6612e 100644
--- a/webapp/app/js/controllers/query.js
+++ b/webapp/app/js/controllers/query.js
@@ -26,6 +26,7 @@ KylinApp
     $scope.queryString = "";
     $scope.queries = [];
     $scope.curQuery = null;
+    $scope.exportSql = null;
     $scope.dateTypes = [91, 92, 93];
     $scope.stringTypes = [-1, 1, 12];
     $scope.numberTypes = [-7, -6, -5, 3, 4, 5, 6, 7, 8];
@@ -240,7 +241,7 @@ KylinApp
     }
 
     $scope.sanitate = function (sql) {
-      return sql.replace(/\n/g, " ");
+      return encodeURIComponent(sql.replace(/\n/g, " "));
     }
 
     $scope.query = function (query) {
@@ -278,6 +279,7 @@ KylinApp
       $scope.curQuery = newQuery;
       $scope.query($scope.curQuery);
       $scope.cacheQuery($scope.curQuery);
+      $scope.exportSql = $scope.sanitate(sql);
     }
 
     $scope.reset = function (query) {

http://git-wip-us.apache.org/repos/asf/kylin/blob/53e72968/webapp/app/partials/query/query_detail.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/query/query_detail.html b/webapp/app/partials/query/query_detail.html
index 42f8dbb..c76b407 100644
--- a/webapp/app/partials/query/query_detail.html
+++ b/webapp/app/partials/query/query_detail.html
@@ -88,7 +88,7 @@
             <span ng-if="curQuery.graph.show"><i class="fa fa-list-ul"></i> Grid</span>
         </button>
         <a class="btn btn-default btn-xs"
-           href="{{config.service.url}}query/format/csv?sql={{sanitate(curQuery.sql)}}&project={{curQuery.project}}" target="_blank"><i
+           href="{{config.service.url}}query/format/csv?sql={{exportSql}}&project={{curQuery.project}}" target="_blank"><i
                 class="fa fa-cloud-download"></i> Export</a>
         <a class="btn btn-default btn-xs"
            ng-click="refreshUi();"><i