• Lorna Luo's avatar
    Make 'move_file' command more reliable in mysqltest · da73db23
    Lorna Luo authored
    The tests innodb.import_tablespace_race, innodn.restart, and innodb.innodb-wl5522 move
    the tablespace file between the data directory and the tmp directory specified by
    global environment variables. However this is risky because it's not unusual that the
    set tmp directory (often under /tmp) is mounted on another disk partition or device,
    and 'move_file' command may fail with "Errcode: 18 'Invalid cross-device link.'"
    
    To stabilize mysqltest in the described scenario, and prevent such
    behavior in the future, let make_file() check both from file path and to
    file path and make sure they are either both under MYSQLTEST_VARDIR or
    MYSQL_TMP_DIR.
    
    All new code of the whole pull request, including one or several files that
    are either new files or modified ones, are contributed under the BSD-new license.
    I am contributing on behalf of my employer Amazon Web Services, Inc.
    da73db23
mysqltest.cc 311 KB