diff options
author | Varun Gupta <varunraiko1803@gmail.com> | 2018-05-15 01:44:03 +0530 |
---|---|---|
committer | Varun Gupta <varunraiko1803@gmail.com> | 2018-05-16 11:40:11 +0530 |
commit | 6f4534e6220d9224dbd3226aba310c4ca58f6da3 (patch) | |
tree | 83894b9d53d23b4e720d9f3332624a2e2f17c77d /sql/sql_base.h | |
parent | d9f9cd1a102f17a1a23086585588d119ffff2578 (diff) | |
download | mariadb-git-6f4534e6220d9224dbd3226aba310c4ca58f6da3.tar.gz |
MDEV-14695: Assertion `n < m_size' failed in Bounds_checked_array<Element_type>::operator
In this issue we hit the assert because we are adding addition fields to the field JOIN::all_fields list. This
is done because HEAP tables can't index BIT fields so we need to use an additional hidden field for grouping because later it will be
converted to a LONG field. Original field will remain of the BIT type and will be returned. This happens when we convert DISTINCT to
GROUP BY.
The solution is to take into account the number of such hidden fields that would be added to the field
JOIN::all_fields list while calculating the size of the ref_pointer_array.
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r-- | sql/sql_base.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h index d6063f1b771..c59a24e4272 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -154,11 +154,12 @@ bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, enum trg_event_type event); bool insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, const char *table_name, - List_iterator<Item> *it, bool any_privileges); + List_iterator<Item> *it, bool any_privileges, + uint *hidden_bit_fields); void make_leaves_list(THD *thd, List<TABLE_LIST> &list, TABLE_LIST *tables, bool full_table_list, TABLE_LIST *boundary); int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, - List<Item> *sum_func_list, uint wild_num); + List<Item> *sum_func_list, uint wild_num, uint * hidden_bit_fields); bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array, List<Item> &item, enum_mark_columns mark_used_columns, List<Item> *sum_func_list, List<Item> *pre_fix, |