Bug #35145 mysqldump export views as table
Submitted: 7 Mar 2008 12:45 Modified: 15 Oct 2011 16:05
Reporter: Glauco Furlaneto Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S2 (Serious)
Version:mysqldump Ver 10.11 Distrib 5.0.41 OS:Linux
Assigned to: CPU Architecture:Any
Tags: dump, mysqldump, table, VIEW

[7 Mar 2008 12:45] Glauco Furlaneto
Description:
The ‘mysqldump’ utility has exporting views as tables.

How to repeat:
Create one or more views in your database and they export it using ‘mysqldump’.

Command:

mysqldump -h <your_host> -u <your_user> -p<your_password> --opt <your_database> > <your_sql_file>

Example:

mysqldump -h localhost -u root -p123456 --opt dbName > file.sql

Suggested fix:
It can be using based on the query
SHOW CREATE VIEW `view_name`
[7 Mar 2008 18:46] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.51a, and inform about the results.
[7 Apr 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[14 Apr 2008 17:21] Susanne Ebrecht
Glauco,

we still need to know if you will have this issue when you use the newest version.
[14 May 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[11 Aug 2011 17:59] Richard Murri
This still exists with 5.5.15-1.
[11 Aug 2011 18:13] Richard Murri
Looks like the dump has the views.  However it doesn't recreate the views properly.  Instead of 'CREATE VIEW' it just says 'VIEW'.
[11 Aug 2011 18:16] Valeriy Kravchuk
Please, upload some small dump created by 5.5.15 that demonstrates the problem.
[12 Aug 2011 22:06] Richard Murri
Hmmm... I can't reproduce it anymore.

I think what fixed it was doing a mysqldump with -d, importing it, then doing a full export.  Now whenever I do a full export it works.

Makes me think maybe I didn't do a mysql_upgrade or something.
[15 Oct 2011 16:05] Valeriy Kravchuk
Not repeatable with properly installed current versions.