[MDEV-24520] Creating multiple indexes impossible Created: 2021-01-04  Updated: 2021-01-04  Resolved: 2021-01-04

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table
Affects Version/s: 10.3.25
Fix Version/s: N/A

Type: Bug Priority: Blocker
Reporter: peacecop kalmer: Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: UNIQUE, create, index, table
Environment:

Server version: 10.3.25-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04



 Description   

In MySQL Workbench, I created a data model. That model has a table where I set two columns to take unique values. The script part is the following:

bq. CREATE TABLE IF NOT EXISTS `tennisMath`.`Court` (
bq.   `idCourt` INT NOT NULL AUTO_INCREMENT,
bq.   `letterNumber` CHAR(2) NOT NULL,
bq.   `surface` ENUM('grass', 'clay') NOT NULL,
bq.   PRIMARY KEY (`idCourt`),
bq.   UNIQUE INDEX `idCourt_UNIQUE` (`idCourt` ASC) VISIBLE,
bq.   UNIQUE INDEX `letterNumber_UNIQUE` (`letterNumber` ASC) VISIBLE)
bq. ENGINE = InnoDB;

Once I forward-engineer the script, I get the following error message:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '

UNIQUE INDEX `letterNumber_UNIQUE` (`letterNumber` ASC) VISIBLE)



 Comments   
Comment by Ian Gilfillan [ 2021-01-04 ]

This is not a bug. The VISIBLE attribute does not exist in MariaDB 10.3. You can either use MariaDB 10.5, or, in MySQL Workbench, go to "Preferences" and change the "Target MySQL version" to 5.7.

Generated at Thu Feb 08 09:30:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.