在MySQL 8.0.11上不正确使用空间/全文/哈希索引和显式索引顺序 [英] Incorrect usage of spatial/fulltext/hash index and explicit index order on MySQL 8.0.11
本文介绍了在MySQL 8.0.11上不正确使用空间/全文/哈希索引和显式索引顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在MySQL Workbench 6.3.10上运行sakila_full.mwb的正向工程师. MySQL Server版本是8.0.11.
I run Forward Engineer of sakila_full.mwb on MySQL Workbench 6.3.10. MySQL Server version is 8.0.11.
-- -----------------------------------------------------
-- Table `sakila`.`film_text`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `sakila`.`film_text` (
`film_id` SMALLINT UNSIGNED NOT NULL,
`title` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
PRIMARY KEY (`film_id`),
FULLTEXT INDEX `idx_title_description` (`title` ASC, `description` ASC))
ENGINE = InnoDB
我遇到以下错误.
ERROR: Error 1221: Incorrect usage of spatial/fulltext/hash index and explicit index order
为什么?
更新1
我尝试了仅针对TEXT类型列的全文索引.
I tried a fulltext index is only for TEXT type columns.following this.
-- -----------------------------------------------------
-- Table `sakila`.`film_text`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `sakila`.`film_text` (
`film_id` SMALLINT UNSIGNED NOT NULL,
`title` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
PRIMARY KEY (`film_id`),
FULLTEXT INDEX `idx_title_description` (`description` ASC))
ENGINE = InnoDB
但是我遇到了同样的错误.
But i got same error.
Error Code: 1221. Incorrect usage of spatial/fulltext/hash index and explicit index order
推荐答案
该问题已经自行解决. 我删除了ASC.
That's already been self-settled. I removed ASC.
-- -----------------------------------------------------
-- Table `sakila`.`film_text`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `sakila`.`film_text` (
`film_id` SMALLINT UNSIGNED NOT NULL,
`title` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
PRIMARY KEY (`film_id`),
FULLTEXT INDEX `idx_title_description` (`title`, `description`))
ENGINE = InnoDB
谢谢.
更新1
MySQL Workbench 8.0.11已修复.
MySQL Workbench 8.0.11 fixed.
这篇关于在MySQL 8.0.11上不正确使用空间/全文/哈希索引和显式索引顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文