diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-23 17:35:29 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-09-23 17:35:29 +0300 |
commit | 5a92ccbaea1bb3973e23846a741f5694a1e687bd (patch) | |
tree | aafc504552502b48b79cadcb06b2b5c7eba4f374 /sql/sql_statistics.cc | |
parent | c997af7d1f432dfca922958453f0e2313287f1eb (diff) | |
parent | c016ea660ede8b7ff75f8ca65f73e2958262263a (diff) | |
download | mariadb-git-5a92ccbaea1bb3973e23846a741f5694a1e687bd.tar.gz |
Merge 10.3 into 10.4
Disable MDEV-20576 assertions until MDEV-20595 has been fixed.
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r-- | sql/sql_statistics.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 438a9248a31..1222d0e0d5f 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1,4 +1,5 @@ /* Copyright (C) 2009 MySQL AB + Copyright (c) 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1023,7 +1024,9 @@ public: { char buff[MAX_FIELD_WIDTH]; String val(buff, sizeof(buff), &my_charset_bin); + my_bitmap_map *old_map; + old_map= dbug_tmp_use_all_columns(stat_table, stat_table->read_set); for (uint i= COLUMN_STAT_MIN_VALUE; i <= COLUMN_STAT_HISTOGRAM; i++) { Field *stat_field= stat_table->field[i]; @@ -1081,6 +1084,7 @@ public: } } } + dbug_tmp_restore_column_map(stat_table->read_set, old_map); } @@ -1132,12 +1136,18 @@ public: case COLUMN_STAT_MIN_VALUE: table_field->read_stats->min_value->set_notnull(); stat_field->val_str(&val); +#if 0 /* MDEV-20589 FIXME: This fails! */ + DBUG_ASSERT(table_field->read_stats->min_value->is_stat_field); +#endif table_field->read_stats->min_value->store(val.ptr(), val.length(), &my_charset_bin); break; case COLUMN_STAT_MAX_VALUE: table_field->read_stats->max_value->set_notnull(); stat_field->val_str(&val); +#if 0 /* MDEV-20589 FIXME: This fails! */ + DBUG_ASSERT(table_field->read_stats->min_value->is_stat_field); +#endif table_field->read_stats->max_value->store(val.ptr(), val.length(), &my_charset_bin); break; @@ -1985,7 +1995,7 @@ void create_min_max_statistical_fields_for_table(TABLE *table) my_ptrdiff_t diff= record-table->record[0]; if (!bitmap_is_set(table->read_set, table_field->field_index)) continue; - if (!(fld= table_field->clone(&table->mem_root, table, diff, TRUE))) + if (!(fld= table_field->clone(&table->mem_root, table, diff))) continue; if (i == 0) table_field->collected_stats->min_value= fld; @@ -2052,7 +2062,7 @@ void create_min_max_statistical_fields_for_table_share(THD *thd, Field *fld; Field *table_field= *field_ptr; my_ptrdiff_t diff= record - table_share->default_values; - if (!(fld= table_field->clone(&stats_cb->mem_root, diff))) + if (!(fld= table_field->clone(&stats_cb->mem_root, NULL, diff))) continue; if (i == 0) table_field->read_stats->min_value= fld; @@ -3046,9 +3056,12 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables) KEY *key_info, *key_info_end; TABLE_SHARE *table_share= table->s; Table_statistics *read_stats= table_share->stats_cb.table_stats; - + enum_check_fields old_check_level= thd->count_cuted_fields; DBUG_ENTER("read_statistics_for_table"); + /* Don't write warnings for internal field conversions */ + thd->count_cuted_fields= CHECK_FIELD_IGNORE; + /* Read statistics from the statistical table table_stats */ stat_table= stat_tables[TABLE_STAT].table; Table_stat table_stat(stat_table, table); @@ -3129,6 +3142,7 @@ int read_statistics_for_table(THD *thd, TABLE *table, TABLE_LIST *stat_tables) } table->stats_is_read= TRUE; + thd->count_cuted_fields= old_check_level; DBUG_RETURN(0); } |