• Yuchen Pei's avatar
    MDEV-29447 MDEV-26285 Refactor spider_db_mbase_util::open_item_func · 3ea2f6a5
    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 a problem (MDEV-29447) where field items that are
    arguments of a func item may be used before created / initialised.
    
    Note this commit is a port of
    3836098c (MDEV-26285) to current
    versions 10.3+.
    Signed-off-by: default avatarYuchen Pei <yuchen.pei@mariadb.com>
    3ea2f6a5
spd_db_mysql.cc 474 KB