• Igor Babaev's avatar
    MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view · 2e789108
    Igor Babaev authored
    This bug could manifest itself after pushing a where condition over a
    mergeable derived table / view / CTE DT into a grouping view / derived
    table / CTE V whose item list contained set functions with constant
    arguments such as MIN(2), SUM(1) etc. In such cases the field references
    used in the condition pushed into the view V that correspond set functions
    are wrapped into Item_direct_view_ref wrappers. Due to a wrong implementation
    of the virtual method const_item() for the class Item_direct_view_ref the
    wrapped set functions with constant arguments could be erroneously taken
    for constant items. This could lead to a wrong result set returned by the
    main select query in 10.2. In 10.4 where a possibility of pushing condition
    from HAVING into WHERE had been added this could cause a crash.
    
    Approved by Sergey Petrunya <sergey.petrunya@mariadb.com>
    2e789108
item.h 202 KB