From ce1669af121f705f85c64daf8e40bf0eac9f7887 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Thu, 13 Dec 2018 00:26:54 +0530 Subject: [PATCH] Fix compile error when building without the partition engine --- sql/sql_statistics.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 0c359a29431..2a90269e532 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3931,9 +3931,8 @@ bool is_stat_table(const char *db, const char *table) bool is_eits_usable(Field *field) { - partition_info *part_info= NULL; #ifdef WITH_PARTITION_STORAGE_ENGINE - part_info= field->table->part_info; + partition_info *part_info= field->table->part_info; #endif /* (1): checks if we have EITS statistics for a particular column @@ -3944,8 +3943,11 @@ bool is_eits_usable(Field *field) */ Column_statistics* col_stats= field->read_stats; if (col_stats && !col_stats->no_stat_values_provided() && //(1) - field->type() != MYSQL_TYPE_GEOMETRY && //(2) - (!part_info || !part_info->field_in_partition_expr(field))) //(3) + field->type() != MYSQL_TYPE_GEOMETRY //(2) + #ifdef WITH_PARTITION_STORAGE_ENGINE + && (!part_info || !part_info->field_in_partition_expr(field)) //(3) + #endif + ) return TRUE; return FALSE; }