Incorrect usage of spatial/fulltext/hash index and

2019-07-28 07:22发布

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条回答
姐就是有狂的资本
2楼-- · 2019-07-28 07:52

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

MySQL Workbench

Thank you.

Update1

MySQL Workbench 8.0.11 fixed.

查看更多
登录 后发表回答