From b2adb8f05831ea3659924851d77902047a047a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 23 Aug 2019 17:21:01 +0200 Subject: [PATCH] Use substituteDummyTokens --- lib/cartodb/utils/query-utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cartodb/utils/query-utils.js b/lib/cartodb/utils/query-utils.js index b6e6d6bc..a5bb4482 100644 --- a/lib/cartodb/utils/query-utils.js +++ b/lib/cartodb/utils/query-utils.js @@ -156,7 +156,7 @@ module.exports.getMaxMinColumnQuery = function (query, column = 'cartodb_id') { min(${column}) AS min_id, max(${column}) AS max_id, (max(${column}) - min(${column})) AS id_span - FROM (${query}) _cdb_metadata_max_min; + FROM (${substituteDummyTokens(query)}) _cdb_metadata_max_min; `; }; @@ -164,7 +164,7 @@ module.exports.getSampleFromIdsQuery = function (query, ids, columns, column = ' return ` SELECT ${columnSelector(columns)} - FROM (${query}) _cdb_metadata_sample + FROM (${substituteDummyTokens(query)}) _cdb_metadata_sample WHERE ${column} IN (${ids.join(',')}) `; };