Incorrect usage of spatial/fulltext/hash index and explicit index order on MySQL 8.0.11

Deadly 提交于 2019-12-24 11:24:18

问题


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

I got following error.

ERROR: Error 1221: Incorrect usage of spatial/fulltext/hash index and explicit index order

Why?

Update1

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

回答1:


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

Thank you.

Update1

MySQL Workbench 8.0.11 fixed.



来源:https://stackoverflow.com/questions/49945561/incorrect-usage-of-spatial-fulltext-hash-index-and-explicit-index-order-on-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!