• unknown's avatar
    Bug#17371: Unable to dump a schema with invalid views · 443de045
    unknown authored
    'show create' works even on views that are short of a base-table (this
    throw a warning though, like you would expect). Unfortunately, this is
    not what mysqldump uses; it creates stand-in tables and hence requests
    'show fields' on the view which fails with missing base-tables.  The
    --force option prevents the dump from stopping at this point; furthermore
    this patch dumps a comment showing create for the offending view for
    better diagnostics. This solution was confirmed by submitter as solving
    their/clients' problem. Problem might become non-issue once mysqldump no
    longer creates stand-in tables.
    
    
    client/mysqldump.c:
      Dump a comment showing create for a view if we can't show fields for it for
      better diagnostics.
    mysql-test/r/mysqldump.result:
      add test for #17371 - be defensive. if we can't do a full dump on a view
      (incl. 'show fields' for a stand-in table), at least create a comment with
      the 'show create' info when --force is given.
    mysql-test/t/mysqldump.test:
      add test for #17371 - be defensive. if we can't do a full dump on a view
      (incl. 'show fields' for a stand-in table), at least create a comment with
      the 'show create' info when --force is given.
    443de045
mysqldump.c 107 KB