• Vladislav Vaintroub's avatar
    Bug #47423 mtr connects to wrong database · 2f075a1e
    Vladislav Vaintroub authored
    The reason for the bug is that mysqtest as well as other client tools
    running in test suite (mysqlbinlog, mysqldump) will first try to connect 
    whatever database has created shared memory with default base name 
    "MySQL" and use this. (Same effect could be seen on Unix if mtr would
    not care to calculate "port" and "socket" parameter).
          
    The fix ensures that all client tools and  running in mtr use unique  
    per-database shared memory base parameters, so there is no possibility
    to clash with already installed one. We use socket name for shared memory 
    base (it's known to be unique). This shared-memory-base is written to the
    MTR config file to the [client] and [mysqld] sections. Fix made also made 
    sure all client tools understand and correctly handle --shared-memory-base.
    Prior to this patch  it was not the case for  mysqltest, mysqlbinlog and 
    mysql_client_test.
          
    All new connections done from mtr scripts via connect() will by default 
    set shared-memory-base. And finally, there is a possibility to force 
    shared memory or pipe connection and overwrite shared memory/pipe base name
    from within mtr scripts via optional PIPE or SHM modifier. This functionality
    was manually backported from 6.0
    (original patch  http://lists.mysql.com/commits/74749)
    2f075a1e
mysql_client_test.c 495 KB