Use substituteDummyTokens

This commit is contained in:
Daniel García Aubert 2019-08-23 17:21:01 +02:00
parent 780cb80c8c
commit b2adb8f058

View File

@ -156,7 +156,7 @@ module.exports.getMaxMinColumnQuery = function (query, column = 'cartodb_id') {
min(${column}) AS min_id, min(${column}) AS min_id,
max(${column}) AS max_id, max(${column}) AS max_id,
(max(${column}) - min(${column})) AS id_span (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 ` return `
SELECT SELECT
${columnSelector(columns)} ${columnSelector(columns)}
FROM (${query}) _cdb_metadata_sample FROM (${substituteDummyTokens(query)}) _cdb_metadata_sample
WHERE ${column} IN (${ids.join(',')}) WHERE ${column} IN (${ids.join(',')})
`; `;
}; };