gpt4 book ai didi

用于 View 的 MySQL 替代结构。它是什么?

转载 作者:可可西里 更新时间:2023-11-01 07:05:17 24 4
gpt4 key购买 nike

我们一直在使用 phpmyadmin 4 导出数据库。数据库包含一些 View ,并且在通常的 CREATE VIEW 命令之前有一个带有注释“ View viewName 的替代结构”的 CREATE TABLE 命令。

为什么要使用这种替代结构?

注意:除非移除替代结构,否则从导出文件导入失败。

最佳答案

“替代”或“替代”结构是从 View 创建的表,它具有与 View 相同的结构。它用于确保在导出多个相互依赖的 View 时满足依赖关系。

我不确定为什么存在替代结构时导出会失败(拥有这些结构的含义实际上是相反的),但过程中可能存在错误。我必须查看导出文件的相关部分才能真正分辨。

phpmyadmin sourceforge 站点在错误 #3846 ( http://sourceforge.net/p/phpmyadmin/bugs/3846/ ) 中提到了替代结构的使用:

When exporting, phpMyAdmin creates a stand-in structure for the view (with CREATE TABLE), then later it drops this table and uses CREATE VIEW.

在 github (https://github.com/phpmyadmin/phpmyadmin/commit/2f2b505) 上的 phpmyadmin 错误 #11711 的评论中还有另一个引用:

View A may depend on another view B that is defined below, so the view A creation would fail if we did not use stand-in. Dependencies may be more complex that that, so instead of computing all dependencies we use stand-ins.

关于用于 View 的 MySQL 替代结构。它是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21573720/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com