• Pavan Naik's avatar
    BUG#25147154 : MTR TRIES TO COPY CONTENTS FROM /TMP/DATA · 6786caed
    Pavan Naik authored
    Description :
    =============
    When a MTR test run is started, it initializes the server and creates
    the datadir under '$MYSQL_TEST_DIR/var'('/tmp/var' or '/dev/shm/var'
    if --mem option is used) location and then copies it to the datadir
    location of server(s).
    
    If $parallel == 1, datadir location of the server is
    '$MYSQL_TEST_DIR/var/data'. If $parallel > 1, datadir location of any
    server is '$MYSQL_TEST_DIR/var/<thread_num>/data'.
    
    This is the reason MTR searches for the initialized datadir in 2
    locations('$opt_vardir' and '$opt_vardir/..') from the current vardir
    location..
    
    But this can cause few problems. If a directory with the name 'data'
    already exists under '$MYSQL_TEST_DIR' and if the MTR run is started
    with parallel value 1, then
    
    1. copytree($install_db, '$opt_vardir/..') command will fail if the
    user doesn't have the access permission to '$MYSQL_TEST_DIR/data'
    directory.
    2. Unnecessary contents from '$MYSQL_TEST_DIR/data' directory will be
    copied to server datadir location and this might affect the server
    startup.
    
    Fix :
    =====
    Depending on the $parallel value decide whether the path for the
    initialize datadir is "$opt_vardir"(i.e $parallel = 1) or
    "$opt_vardir/.."(i.e $parallel > 1).
    Reviewed-by: default avatarDeepa Dixit <deepa.dixit@oracle.com>
    Reviewed-by: default avatarSrikanth B R <srikanth.b.r@oracle.com>
    RB: 14773
    6786caed
mysql-test-run.pl 178 KB