• Michael Widenius's avatar
    Fixed MDEV-5724 "Server crashes on SQL select containing more group by and... · 599eb0dc
    Michael Widenius authored
    Fixed MDEV-5724 "Server crashes on SQL select containing more group by and left join statements using innodb tables"
      
    The problem was that a big record was allocated on the stack, which casued stack to run out.
      
    Fixed by using my_safe_alloca() instead of my_alloca() when allocating records.
    Now only records <= 16384 are allocated on the stack.
    
    mysql-test/r/stack-crash.result:
      Added test case
    mysql-test/t/stack-crash.test:
      Added test case
    storage/maria/ma_blockrec.c:
      Use my_safe_alloca() instead of my_alloca()
    storage/maria/ma_dynrec.c:
      Use my_safe_alloca() instead of my_alloca()
    storage/maria/maria_def.h:
      Added MARIA_MAX_RECORD_ON_STACK
    storage/maria/maria_pack.c:
      Use my_safe_alloca() instead of my_alloca()
    599eb0dc
maria_pack.c 102 KB