mysqldump generates incorrect create view queries
When dumping / pumping MySQL databases, the output script generates this as a temporary structure first, and later below at the end of the script, it drops this and create the actual view itself, something like this:

...DROP VIEW IF EXISTS myview ...  

If you end up with the final view still selecting 1s, it would be probably because database name mismatch, when you use --databases option in the mysqldump , the script will output

USE database_name

in multiple places (not only at the top of the script), and specifically there is one before the DROP and Recreating the actual view.

This happened to me when exporting and importing databases with different name.