bug report: get "DROP TABLE..." when export view

mouth posted 4 years ago in Import/Export
right click DB
-> Export database as SQL
-> Database=Create, Table=Create, Data=INSERT, Output=Single .sql file, Filename=...
-> Export
The DDL of view in .sql file is:
"DROP TABLE IF EXISTS `v_order_part`;..."
The correct should be:
"DROP VIEW IF EXISTS `v_order_part`;..."
ansgar posted 4 years ago
Views have to be created as tables first in an SQL export, then, when all tables have been created, the "view-table" has to be dropped and the real view is created. This is all due to dependencies between views and tables. When a view references a not yet exported table, you would get a "table xyz does not exist" when creating the view earlier as the referenced table. So, there is a DROP TABLE found, but there should also be a DROP VIEW, isn't it?
mouth posted 4 years ago
Got it, Thanks.

Please login to leave a reply, or register at first.