mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge 10.3 into 10.4, except for MDEV-20265
The MDEV-20265 commit e746f451d5
introduces DBUG_ASSERT(right_op == r_tbl) in
st_select_lex::add_cross_joined_table(), and that assertion would
fail in several tests that exercise joins. That commit was skipped
in this merge, and a separate fix of MDEV-20265 will be necessary in 10.4.
This commit is contained in:
@ -1820,16 +1820,13 @@ public:
|
||||
bool is_partial_fields_present;
|
||||
|
||||
Index_prefix_calc(THD *thd, TABLE *table, KEY *key_info)
|
||||
: index_table(table), index_info(key_info)
|
||||
: index_table(table), index_info(key_info), prefixes(0), empty(true),
|
||||
calc_state(NULL), is_single_comp_pk(false), is_partial_fields_present(false)
|
||||
{
|
||||
uint i;
|
||||
Prefix_calc_state *state;
|
||||
uint key_parts= table->actual_n_key_parts(key_info);
|
||||
empty= TRUE;
|
||||
prefixes= 0;
|
||||
LINT_INIT_STRUCT(calc_state);
|
||||
|
||||
is_partial_fields_present= is_single_comp_pk= FALSE;
|
||||
uint pk= table->s->primary_key;
|
||||
if ((uint) (table->key_info - key_info) == pk &&
|
||||
table->key_info[pk].user_defined_key_parts == 1)
|
||||
@ -2129,7 +2126,12 @@ int alloc_statistics_for_table(THD* thd, TABLE *table)
|
||||
Histogram_type hist_type= (Histogram_type) (thd->variables.histogram_type);
|
||||
uchar *histogram= NULL;
|
||||
if (hist_size > 0)
|
||||
histogram= (uchar *) alloc_root(&table->mem_root, hist_size * columns);
|
||||
{
|
||||
if ((histogram= (uchar *) alloc_root(&table->mem_root,
|
||||
hist_size * columns)))
|
||||
bzero(histogram, hist_size * columns);
|
||||
|
||||
}
|
||||
|
||||
if (!table_stats || !column_stats || !index_stats || !idx_avg_frequency ||
|
||||
(hist_size && !histogram))
|
||||
|
Reference in New Issue
Block a user