From 2d76aa51f2bae6ae5a773f365971798d7b4d8f3b Mon Sep 17 00:00:00 2001 From: nichunen Date: Mon, 7 Mar 2016 16:03:16 +0800 Subject: [PATCH] KYLIN-1472 Export csv get error when there is a plus sign in the sql --- webapp/app/js/controllers/query.js | 4 +++- webapp/app/partials/query/query_detail.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/app/js/controllers/query.js b/webapp/app/js/controllers/query.js index 785d07e..fe64d3b 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) { 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 @@ Grid Export