diff options
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/item.cc | 3 | ||||
| -rw-r--r-- | sql/sql_statistics.cc | 20 |
2 files changed, 12 insertions, 11 deletions
diff --git a/sql/item.cc b/sql/item.cc index f86a27d587a..6657d6cb7cb 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -10436,6 +10436,9 @@ const char *dbug_print_unit(SELECT_LEX_UNIT *un) return "Couldn't fit into buffer"; } +const char *dbug_print(Item *x) { return dbug_print_item(x); } +const char *dbug_print(SELECT_LEX *x) { return dbug_print_select(x); } +const char *dbug_print(SELECT_LEX_UNIT *x) { return dbug_print_unit(x); } #endif /*DBUG_OFF*/ diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 44a14cd4d10..6f4474860a9 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3749,10 +3749,10 @@ void set_statistics_for_table(THD *thd, TABLE *table) Ideally, EITS should provide per-partition statistics but this is not implemented currently. */ - #ifdef WITH_PARTITION_STORAGE_ENGINE +#ifdef WITH_PARTITION_STORAGE_ENGINE if (table->part_info) table->used_stat_records= table->file->stats.records; - #endif +#endif KEY *key_info, *key_info_end; for (key_info= table->key_info, key_info_end= key_info+table->s->keys; @@ -4082,10 +4082,6 @@ bool is_stat_table(const LEX_CSTRING *db, LEX_CSTRING *table) bool is_eits_usable(Field *field) { - partition_info *part_info= NULL; - #ifdef WITH_PARTITION_STORAGE_ENGINE - part_info= field->table->part_info; - #endif /* (1): checks if we have EITS statistics for a particular column (2): Don't use EITS for GEOMETRY columns @@ -4094,9 +4090,11 @@ bool is_eits_usable(Field *field) such columns would be handled during partition pruning. */ 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) - return TRUE; - return FALSE; + return col_stats && !col_stats->no_stat_values_provided() && //(1) + field->type() != MYSQL_TYPE_GEOMETRY && //(2) +#ifdef WITH_PARTITION_STORAGE_ENGINE + (!field->table->part_info || + !field->table->part_info->field_in_partition_expr(field)) && //(3) +#endif + true; } |
