Interesting, is the original query as typed into the editor supposed to show when you go to edit the view in HeidiSQL? For me, the MySQLDump view definition is what shows in the editor, there is no way to edit the originally-typed query without saving it as an .sql file somewhere.
I'm using Percona Server 5.6.27, perhaps that stores the definition differently to regular MySQL?
I am using MariaDB 10.1.19.
Yes, this is one of the merits using HeidiSQL to backup the MySQL database rather than using mysqldump. You get the original query used to create the view. Though I cannot find a way to automate this step. It would be great if HeidiSQL can support command-line parameters just to back-up the database as mysqldump is not good at performing its intended task.
HeidiSQL users wanted the original query in the VIEW definition, so I am reading that with a quite special query:
SELECT LOAD_FILE(CONCAT(IFNULL(@@GLOBAL.datadir, CONCAT(@@GLOBAL.basedir, 'data/')), 'yourdatabase/yourtable.frm'));
So you are doing additional steps to recreate the original statement to create the view. This is great. Thanks for sharing. I do hope if you have some spare time, you could add some support for command-line switch backup operation to alleviate the mysqldump limitation when it comes to exporting views.