• Ramil Kalimullin's avatar
    Fix for bug #39021: SELECT REGEXP BINARY NULL never returns · 788be2ae
    Ramil Kalimullin authored
    Problem: SELECT ... REGEXP BINARY NULL may lead to server crash/hang.
    
    Fix: properly handle NULL regular expressions.
    
    
    mysql-test/r/func_regexp.result:
      Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
        - test result.
    mysql-test/t/func_regexp.test:
      Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
        - test case.
    sql/item_cmpfunc.cc:
      Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
        - checking regular expressions' null_value
      we tested it without a val_xxx() call before, which is wrong.
      Now Item_func_regex::regcomp() returns -1 in the case
      and allows to handle NULL expessions properly.
    sql/item_cmpfunc.h:
      Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
        - checking regular expressions' null_value
      we tested it without a val_xxx() call before, which is wrong.
      Now Item_func_regex::regcomp() returns -1 in the case
      and allows to handle NULL expessions properly.
    788be2ae
func_regexp.result 3.81 KB