• Yuchen Pei's avatar
    MDEV-31524 Fixing spider table param / variable overriding · e1d31a10
    Yuchen Pei authored
    The existing (incorrect) overriding mechanism is:
    
    Non-minus-one var value overrides table param overrides default value.
    
    Before MDEV-27169, unspecified var value is -1. So if the user sets
    both the var to be a value other than -1 and the table param, the var
    value will prevail, which is incorrect.
    
    After MDEV-27169, unspecified var value is default value. So if the
    user does not set the var but sets the table param, the default value
    will prevail, which is even more incorrect.
    
    This patch fixes it so that table param, if specified, always
    overrides var value, and the latter if not specified or set to -1,
    falls back to the default value
    
    We achieve this by replacing all such overriding in spd_param.cc with
    macros that override in the correct way, and removing all the
    "overriding -1" lines involving table params in
    spider_set_connect_info_default() except for those table params not
    defined as sysvar/thdvar in spd_params.cc
    
    We also introduced macros for non-overriding sysvar and thdvar, so
    that the code is cleaner and less error-prone
    
    In server versions where MDEV-27169 has not been applied, we also
    backport the patch, that is, replacing -1 default values with real
    default values
    
    In server versions where MDEV-28006 has not been applied, we do the
    same for udf params
    e1d31a10
spd_db_conn.cc 405 KB