mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -862,6 +862,11 @@ public:
|
||||
uint select_n_where_fields;
|
||||
/* reserved for exists 2 in */
|
||||
uint select_n_reserved;
|
||||
/*
|
||||
it counts the number of bit fields in the SELECT list. These are used when DISTINCT is
|
||||
converted to a GROUP BY involving BIT fields.
|
||||
*/
|
||||
uint hidden_bit_fields;
|
||||
enum_parsing_place parsing_place; /* where we are parsing expression */
|
||||
enum_parsing_place context_analysis_place; /* where we are in prepare */
|
||||
bool with_sum_func; /* sum function indicator */
|
||||
|
Reference in New Issue
Block a user