mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.3 into 10.4
Disable MDEV-20576 assertions until MDEV-20595 has been fixed.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user