1. 22 Jul, 2024 1 commit
    • Galina Shalygina's avatar
      MDEV-29363: Constant subquery causing a crash in pushdown optimization · 9dff6c30
      Galina Shalygina authored
      The crash is caused by the attempt to refix the constant subquery during
      pushdown from HAVING into WHERE optimization.
      
      Every condition that is going to be pushed into WHERE clause is first
      cleaned up, then refixed. Constant subqueries are not cleaned or refixed
      because they will remain the same after refixing, so this complicated
      procedure can be omitted for them (introduced in MDEV-21184).
      Constant subqueries are marked with flag IMMUTABLE_FL, that helps to miss
      the cleanup stage for them. Also they are marked as fixed, so refixing is
      also not done for them.
      Because of the multiple equality propagation several references to the same
      constant subquery can exist in the condition that is going to be pushed
      into WHERE. Before this patch, the problem appeared in the following way.
      After the first reference to the constant subquery is processed, the flag
      IMMUTABLE_FL for the constant subquery is disabled.
      So, when the second reference to this constant subquery is processed, the
      flag is already disabled and the subquery goes through the procedure of
      cleaning and refixing. That causes a crash.
      
      To solve this problem, IMMUTABLE_FL should be disabled only after all
      references to the constant subquery are processed, so after the whole
      condition that is going to be pushed is cleaned up and refixed.
      
      Approved by Igor Babaev <igor@maridb.com>
      9dff6c30
  2. 18 Jul, 2024 1 commit
  3. 17 Jul, 2024 1 commit
    • Yuchen Pei's avatar
      MDEV-30408 Reset explicit_limit in exists2in · 0f3a76d7
      Yuchen Pei authored
      Item_exists_subselect::fix_length_and_dec() sets explicit_limit to 1.
      In the exists2in transformation it resets select_limit to NULL. For
      consistency we should reset explicity_limit too.
      
      This fixes a bug where spider table returns wrong results for queries
      that gets through exists2in transformation when semijoin is off.
      0f3a76d7
  4. 11 Jul, 2024 8 commits
  5. 08 Jul, 2024 1 commit
  6. 27 Jun, 2024 28 commits