Skip to content

Export fails to recognize descending index option #296

@ncolgrove

Description

@ncolgrove

MySQL 8.0 supports Descending Indexes, export doesn't recognize the optional "DESC" key_part during parsing. DESC option creates invalid export. "DESC" flag is parsed as the column name in output. ADD KEY `entries__ug` (`DESC`);

Index can be created with the following:

ALTER TABLE `entries` 
ADD INDEX `entries__ug` (`fk_ug_id` DESC);

MySQL CLI export creates:

CREATE TABLE `entries` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `fk_ug_id` int(11) DEFAULT NULL,
 `amount` decimal(10,2) DEFAULT NULL,
 PRIMARY KEY (`id`),
 KEY `entries__ug` (`fk_ug_id` DESC)
) /*!50100 TABLESPACE `innodb_system` */ ENGINE=InnoDB AUTO_INCREMENT=4465 DEFAULT CHARSET=utf8

Export from phpMyAdmin results in the following, which is invalid:

--
-- Indexes for table `entries`
--
ALTER TABLE `entries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `entries__ug` (`DESC`);

Statement should look like:

--
-- Indexes for table `entries`
--
ALTER TABLE `entries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `entries__ug` (`fk_ug_id` DESC);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions