• Alexander Barkov's avatar
    Bug#59149 valgrind warnings with "like .. escape .." function · 1c9515f6
    Alexander Barkov authored
          
    Problem: when processing a query like:
      SELECT '' LIKE '1' ESCAPE COUNT(1);
    escape_item->val_str() was never executed and the "escape" class member
    stayed initialized, which led to valgrind uninitialized memory error.
          
    Note, a query with some tables in "FROM" clause
    returns ER_WRONG_ARGUMENTS in the same situation:
    
       SELECT '' LIKE '1' ESCAPE COUNT(1) FROM t1;
       ERROR 1210 (HY000): Incorrect arguments to ESCAPE
    
    Fix: disallowing using aggregate functions in ESCAPE clause,
    even if there are no tables used. There is no much use of that anyway.
    1c9515f6
item_sum.h 42.1 KB