我有MySQL服务器5.7.25版。
创建表格时,指定主键名称,例如:
CREATE TABLE IF NOT EXISTS `test` (
`test`.`id` BIGINT NOT NULL AUTO_INCREMENT ,
`test`.`name` VARCHAR(100) NOT NULL ,
PRIMARY KEY `pk_test` (`id`)
);
所以当我打电话时:
SELECT constraint_name FROM information_schema.table_constraints WHERE table_name = 'test'
我希望该值为pk_test
,但是,该值为PRIMARY
。
为什么MySQL将提供的主键名称设置为PRIMARY
?