• Alexander Barkov's avatar
    Bug#59149 valgrind warnings with "like .. escape .." function · a2850a2f
    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.
    a2850a2f
func_like.result 4.41 KB