• Yuchen Pei's avatar
    MDEV-29447 WIP Refactor spider_db_mbase_util::open_item_func · d6220164
    Yuchen Pei authored
    WIP: incorporating comments from
    https://lists.launchpad.net/maria-developers/msg13283.html
    
    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>
    d6220164
spd_db_mysql.cc 474 KB