diff options
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 93e37d732d4..f2696683124 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -14049,6 +14049,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) else if (join->conds && join->conds->used_tables() & OUTER_REF_TABLE_BIT) // Cannot execute with correlated conditions. cause= "correlated conditions"; + else if (table->stat_records() == 0) + cause= "Empty table"; // Exit now, records=0 messes up cost computations if (cause) { |