A piece of sql code from the database dump:

-- -- Temporary table structure for view `payments` -- DROP TABLE IF EXISTS `payments`; /*!50001 DROP VIEW IF EXISTS `payments`*/; /*!50001 CREATE TABLE `payments` ( `id` int(9) unsigned zerofill, ... `allow` tinyint(1), `receipt` blob ) */; 

What does this even mean, "temporary table structure for presentation"?

    1 answer 1

    mysqldump saves views in two steps:

    1. First, temporary tables are created with the same structures as the views.
    2. after that, the temporary tables are destroyed and the views themselves are created directly.

    This approach is necessary because the views can depend on each other. In this case, they need to be recreated in a specific order. mysqldump cannot determine such dependencies, so it first creates temporary tables to display the entire structure, and this in turn ensures the correct creation of views regardless of the order.

    • and when creating a dump in SQLyog is also used mysqldump? - Ksenia
    • and one more question: if you delete this temporary table structure for the view, but leave the creation of the view itself, the view will not be created? - Ksenia
    • About SQLyog I do not know, I usually do dumps using the console. Your piece of code from the dump is exactly the same as with mysqldump, so I thought that was a question about it. If you delete the creation of a temporary table, the view should still be created (just checked) - mexes_s