When I do a mysqldump in MySql the views are not being dumped correctly.
When I do :
mysqldump --opt --user=root --routines --max_allowed_packet=1024M my_database > my_file.sql
I get this in my my_file.sql:
CREATE VIEW my_view AS
SELECT
1 AS id,
1 AS full_name
In my MySql server the original create view statement looks like this :
CREATE VIEW my_view AS
SELECT
t1.id AS id,
CONCAT(t2.name,' ',t1.name) AS full_name
FROM t1
LEFT JOIN t2 ON t1.t2_id = t2.id
ORDER BY
t1.name,
t2.name
I've tried all the differenet options for mysqldump but nithing makes it create the views properly in the dumped sql file.