summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2022-01-19 18:35:27 +0300
committerSergei Petrunia <psergey@askmonty.org>2022-01-19 18:35:27 +0300
commitda78030ec87e30d2218a0de182ffb87fc541da97 (patch)
tree7f7ce9bb818d56679eaf034b52f05738b8d83da1 /sql/opt_range.cc
parente222e44d1bfc995870430bb90d8ac97e91f66cb4 (diff)
parentce4956f3229a8b2c26a4913fdbc190b5c822cb8e (diff)
downloadmariadb-git-preview-10.8-MDEV-26519-json-histograms.tar.gz
Merge MDEV-26519: JSON_HB histograms into 10.8preview-10.8-MDEV-26519-json-histograms
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 06063cb9ae1..37cf054dfb0 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -3277,7 +3277,10 @@ double records_in_column_ranges(PARAM *param, uint idx,
break;
}
total_rows += rows;
- }
+ }
+ if (total_rows == 0)
+ total_rows= MY_MIN(1, rows2double(param->table->stat_records()));
+
return total_rows;
}