为什么 Sequel Pro 对于 table 的键值显示的结果与命令行上的 MySQL 不同?
Why does Sequel Pro show a different result for a table's key values than MySQL on the command line?
这是 Sequel 中特定 table 的结构 Pro:
这与在命令行中查看的 table 结构相同:
这是 SHOW CREATE TABLE field_data_field_checklist_status
的输出:
| field_data_field_checklist_status |
CREATE TABLE `field_data_field_checklist_status` (
`entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
`bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
`entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
`revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
`language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
`delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
`field_checklist_status_value` varchar(255) DEFAULT NULL,
PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
KEY `entity_type` (`entity_type`),
KEY `bundle` (`bundle`),
KEY `deleted` (`deleted`),
KEY `entity_id` (`entity_id`),
KEY `revision_id` (`revision_id`),
KEY `language` (`language`),
KEY `field_checklist_status_value` (`field_checklist_status_value`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 7 (field_checklist_status)' |
我相当有信心 MySQL 命令行 table 结构是准确的。这是一个 Drupal 字段 table.
有谁知道为什么会有差异?
会不会同时存在以 entity_type
作为列的主键和以 entity_type
作为列的多键?那么Key
的值就会有歧义,也就解释了不一致的地方。
在 MySQL 中检查密钥的最佳方法是 运行
SHOW CREATE TABLE field_data_field_checklist_status;
它将向您显示实际的键,以及其中的列顺序。
这是 Sequel 中特定 table 的结构 Pro:
这与在命令行中查看的 table 结构相同:
这是 SHOW CREATE TABLE field_data_field_checklist_status
的输出:
| field_data_field_checklist_status |
CREATE TABLE `field_data_field_checklist_status` (
`entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
`bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
`entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
`revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
`language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
`delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
`field_checklist_status_value` varchar(255) DEFAULT NULL,
PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
KEY `entity_type` (`entity_type`),
KEY `bundle` (`bundle`),
KEY `deleted` (`deleted`),
KEY `entity_id` (`entity_id`),
KEY `revision_id` (`revision_id`),
KEY `language` (`language`),
KEY `field_checklist_status_value` (`field_checklist_status_value`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Data storage for field 7 (field_checklist_status)' |
我相当有信心 MySQL 命令行 table 结构是准确的。这是一个 Drupal 字段 table.
有谁知道为什么会有差异?
会不会同时存在以 entity_type
作为列的主键和以 entity_type
作为列的多键?那么Key
的值就会有歧义,也就解释了不一致的地方。
在 MySQL 中检查密钥的最佳方法是 运行
SHOW CREATE TABLE field_data_field_checklist_status;
它将向您显示实际的键,以及其中的列顺序。