• unknown's avatar
    Bug #27694: mysqlhotcopy & p5-DBD-mysql51-4.003 · 539d58a3
    unknown authored
    Use "SHOW TABLES FROM `db`" instead of $dbh->tables() in the
    get_list_of_tables() routine.
    
    The symptom is that, when used with recent versions of DBD::mysql,
    mysqlhotcopy uses a double-qualified table name, for example:
    
    Invalid db.table name 'test.test`.`x' at /usr/bin/mysqlhotcopy line 855.
    
    This is caused by a change in DBD::mysql.  See this diff:
    
    http://svn.perl.org/viewcvs/modules/DBD-mysql/trunk/lib/DBD/mysql.pm?r1=9183&r2=9188
    
    Basically, older DBD::mysql implemented a limited ->table_info method;
    now the full method is implemented, and as a result DBI's ->tables()
    method has access to the schema value, so it uses it.
    
    
    scripts/mysqlhotcopy.sh:
      Use "SHOW TABLES FROM `db`" instead of $dbh->tables() in
      get_list_of_tables().  DBI's ->tables() method calls
      "SHOW TABLES" under the hood, and then quotes the
      names and (depending on DBD::mysql version) adds the schema
      name, too.  mysqlhotcopy doesn't want the schema name
      or the quotes, so it's all around better to just call
      "SHOW TABLES" itself.
    539d58a3
mysqlhotcopy.sh 31.8 KB