• Yuchen Pei's avatar
    MDEV-22979 MDEV-27233 MDEV-28218 Fixing spider init bugs · d8f5d2be
    Yuchen Pei authored
    Fix spider init bugs (MDEV-22979, MDEV-27233, MDEV-28218) while
    preventing regression on old ones (MDEV-30370, MDEV-29904)
    
    Two things are changed:
    
    First, Spider initialisation is made fully synchronous, i.e. it no
    longer happens in a background thread. Adapted from the original fix
    by nayuta for MDEV-27233. This change itself would cause failure when
    spider is initialised early, by plugin-load-add, due to dependency on
    Aria and udf function creation, which are fixed in the second and
    third parts below. Requires SQL Service, thus porting earlier versions
    requires MDEV-27595
    
    Second, if spider is initialised before udf_init(), create udf by
    inserting into `mysql.func`, otherwise do it by `CREATE FUNCTION` as
    usual. This change may be generalised in MDEV-31401.
    
    Also factor out some clean-up queries from deinit_spider.inc for use
    of spider init tests.
    
    A minor caveat is that early spider initialisation will fail if the
    server is bootstrapped for the first time, due to missing `mysql`
    database which needs to be created by the bootstrap script.
    d8f5d2be
spd_init_query.h 23.2 KB