Bug #30833 mysqldump does not create views when "information_schema" passed to --databases
Submitted: 5 Sep 2007 14:41 Modified: 5 Sep 2007 15:07
Reporter: Vivek Dasmohapatra Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:Ver 10.10 Distrib 5.0.27 OS:Any
Assigned to: CPU Architecture:Any

[5 Sep 2007 14:41] Vivek Dasmohapatra
Description:
The following commands work as expected, creating stub tables and then dropping
them for views later:

mysqldump --quick --disable-keys --lock-tables --triggers --routines --tz-utc -f --create-options --extended-insert --add-drop-table --allow-keywords --add-locks --set-charset --all-databases 

mysqldump --quick --disable-keys --lock-tables --triggers --routines --tz-utc -f --create-options --extended-insert --add-drop-table --allow-keywords --add-locks --set-charset --databases a_single_database

This command does not: The stub tables are created but the views are never created:

mysqldump --quick --disable-keys --lock-tables --triggers --routines --tz-utc -f --create-options --extended-insert --add-drop-table --allow-keywords --add-locks --set-charset --databases information_schema a_single_database

This came about because the list of databases to dump was being generated with show databases with some databases excluded: information_schema was not specifically excluded and so made it into the list. 

I should also not here that if a typo'd database name gets into the --databases list, similar behaviour is seen: No error is generated, mysqldump completes, but the views are never created, only the stub tables.

How to repeat:
mysqldump --quick --disable-keys --lock-tables --triggers --routines --tz-utc -f --create-options --extended-insert --add-drop-table --allow-keywords --add-locks --set-charset --databases information_schema a_database_with_views_in_it

or

mysqldump --quick --disable-keys --lock-tables --triggers --routines --tz-utc -f --create-options --extended-insert --add-drop-table --allow-keywords --add-locks --set-charset --databases a_bogus_database_name a_database_with_views_in_it
[5 Sep 2007 15:07] MySQL Verification Team
Thank you for the bug report. I can't repeat with today source server,
your version is quite older could you please upgrade and try again.
Thanks in advance.