• Yuchen Pei's avatar
    MDEV-29447 MDEV-26285 MDEV-31338 Refactor spider_db_mbase_util::open_item_func · 3a1d6d4b
    Yuchen Pei authored
    spider_db_mbase_util::open_item_func() is a monster function.
    It is difficult to maintain while it is expected that we need to
    modify it when a new SQL function or a new func_type is added.
    
    We split the function into two distinct functions: one handles the
    case of str != NULL and the other handles the case of str == NULL.
    
    This refactoring was done in a conservative way because we do not
    have comprehensive tests on the function.
    
    It also fixes MDEV-29447 and MDEV-31338 where field items that are
    arguments of a func item may be used before created / initialised.
    
    Note this commit is adapted from a patch by Nayuta for MDEV-26285.
    3a1d6d4b
spd_db_mysql.h 36.2 KB