From d937ce498293798ef26f2f62aab261583e41c571 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Thu, 5 Jul 2018 11:56:26 +0200 Subject: [PATCH] Fix the min >= start and max <= end case (WIP) This fixes the 'should get bins with min >= start and max <= end' test case but probably breaks a number of other cases (those with no start and/or no end). --- lib/cartodb/models/dataview/histograms/numeric-histogram.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cartodb/models/dataview/histograms/numeric-histogram.js b/lib/cartodb/models/dataview/histograms/numeric-histogram.js index d3eedad9..11dbdf2b 100644 --- a/lib/cartodb/models/dataview/histograms/numeric-histogram.js +++ b/lib/cartodb/models/dataview/histograms/numeric-histogram.js @@ -135,7 +135,7 @@ SELECT END AS bin FROM ( - ${ctx.query} + SELECT * FROM (${ctx.query}) __ctx_query WHERE ${ctx.column} >= ${ctx.start} AND ${ctx.column} <= ${ctx.end} ) __cdb_filtered_source_query${extra_tables} GROUP BY 10${extra_groupby} ORDER BY 10;`;