allow nonzero setting to work when dimensions are set; fixes #1514
Costa Tsaousis (ktsaou) committed
Jan 8, 2017 at 21:35 UTC
7ec44b1c874bd4ee3e984b040e66b29ae6e3cc2f
1 file changed
+9
-5
src/rrd2json.c
+9
-5
@@ -624,17 +624,21 @@ void rrdr_buffer_print_format(BUFFER *wb, uint32_t format)
624
625
uint32_t rrdr_check_options(RRDR *r, uint32_t options, const char *dims)
626
{
627
+ (void)dims;
628
+
629
if(options & RRDR_OPTION_NONZERO) {
630
long i;
631
630
- if(dims && *dims) {
632
+ // commented due to #1514
633
+
634
+ //if(dims && *dims) {
635
// the caller wants specific dimensions
636
// disable NONZERO option
637
// to make sure we don't accidentally prevent
638
// the specific dimensions from being returned
635
- i = 0;
636
- }
637
- else {
639
+ // i = 0;
640
+ //}
641
+ //else {
642
// find how many dimensions are not zero
643
long c;
644
RRDDIM *rd;
@@ -643,7 +647,7 @@ uint32_t rrdr_check_options(RRDR *r, uint32_t options, const char *dims)
647
if(unlikely(!(r->od[c] & RRDR_NONZERO))) continue;
648
i++;
649
}
646
- }
650
+ //}
651
652
// if with nonzero we get i = 0 (no dimensions will be returned)
653
// disable nonzero to show all dimensions