mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-16386: Wrong result when pushdown into the HAVING clause of the
materialized derived table/view that uses aliases is done The problem appears when a column alias inside the materialized derived table/view t1 definition coincides with the column name used in the GROUP BY clause of t1. If the condition that can be pushed into t1 uses that ambiguous column name this column is determined as a column that is used in the GROUP BY clause instead of the alias used in the projection list of t1. That causes wrong result. To prevent it resolve_ref_in_select_and_group() was changed.
This commit is contained in:
@ -887,6 +887,11 @@ public:
|
||||
bool braces; /* SELECT ... UNION (SELECT ... ) <- this braces */
|
||||
/* TRUE when having fix field called in processing of this SELECT */
|
||||
bool having_fix_field;
|
||||
/*
|
||||
TRUE when fix field is called for a new condition pushed into the
|
||||
HAVING clause of this SELECT
|
||||
*/
|
||||
bool having_fix_field_for_pushed_cond;
|
||||
/* List of references to fields referenced from inner selects */
|
||||
List<Item_outer_ref> inner_refs_list;
|
||||
/* Number of Item_sum-derived objects in this SELECT */
|
||||
|
Reference in New Issue
Block a user