【发布时间】:2021-03-16 19:51:53
【问题描述】:
为什么 phpMyAdmin 在从仅以小写(和下划线)命名且 确实 具有(单列)主键的表中选择时给我这个警告,并且缺少功能?我在看到this后检查了这些元素
具体我的查询是
SELECT su.* FROM `r8u2d_comps_testsubitem` su
JOIN `r8u2d_comps_testitem` ti ON ti.id=su.testitemid
JOIN `r8u2d_comps_test` t ON ti.testid=t.id
WHERE t.id=241
ORDER BY ti.ordering
别名为“su”的表有一个列“id”(int(11),autoincrement)和一个仅使用该字段的主键。在我看来,这个查询避免了listed in this answer 的所有限制,那么问题是什么?是 phpMyAdmin(我的托管公司有 4.7.9,但我在本地使用 5.0.4 遇到了同样的问题)还是 MySQL(主机有 5.7.29-0ubuntu0.16.04.1 -(Ubuntu),我有 10.4.17-MariaDB - MariaDB 服务器,我想不能严格比较)。
表结构
`id` INT NOT NULL AUTO_INCREMENT,
`testitemid` INT NOT NULL
`marker` CHAR(20) NULL
`text` TEXT NOT NULL,
`ordering` TINYINT NOT NULL,
PRIMARY KEY (`id`),
KEY `testitemid` (`testitemid`),
KEY `ordering` (`ordering`),
CONSTRAINT `subelementToElement`
FOREIGN KEY (`testitemid`) REFERENCES `#__comps_testitem`(`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION
【问题讨论】:
-
请与我们分享您的表格结构。还有一点很重要:MySQL 与 MariaDB 并不完全相同!!!
-
结构已添加。在这方面,MySQL 和 MariaDB 似乎(就我的问题而言足够)是相同的,因为我在两个平台上都分别收到了这个错误
标签: mysql phpmyadmin