Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
None
Description
I've discovered this when investigating MDEV-23809.
There is code get_best_combination that computes the number of aggregate tables:
/* |
Additional plan nodes for postjoin tmp tables:
|
1? + // For GROUP BY
|
1? + // For DISTINCT
|
1? + // For aggregation functions aggregated in outer query
|
// when used with distinct
|
1? + // For ORDER BY
|
1? // buffer result
|
Up to 2 tmp tables are actually used, but it's hard to tell exact number
|
at this stage.
|
*/
|
uint aggr_tables= (group_list ? 1 : 0) +
|
(select_distinct ?
|
(tmp_table_param.using_outer_summary_function ? 2 : 1) : 0) +
|
(order ? 1 : 0) +
|
(select_options & (SELECT_BIG_RESULT | OPTION_BUFFER_RESULT) ? 1 : 0) ;
|
We don't have specific examples yet, but we suspect it might be incorrect.
One thing that was discovered is that tmp_table_param.using_outer_summary_function is set after this piece of code is executed.
Attachments
Issue Links
- relates to
-
MDEV-23809 Server crash in JOIN_CACHE::free or in copy_fields, ASAN use-after-poison in JOIN::make_aggr_tables_info
- Closed