Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting with ARCHIVE engine - index problem #12082

Closed
Volvoxpl opened this issue Mar 8, 2016 · 1 comment
Closed

Exporting with ARCHIVE engine - index problem #12082

Volvoxpl opened this issue Mar 8, 2016 · 1 comment
Assignees
Labels
Bug A problem or regression with an existing feature
Milestone

Comments

@Volvoxpl
Copy link

Volvoxpl commented Mar 8, 2016

Steps to reproduce

  1. Create table with ARCHIVE engine and INDEX:

    CREATE TABLE archive ( id INT NOT NULL AUTO_INCREMENT , name VARCHAR(50) NOT NULL , PRIMARY KEY (id)) ENGINE = ARCHIVE;

  2. Export table to file (ordinary SQL file)

  3. Try to import table from file

Expected behaviour

I should get this same table as it was before exporting (with INDEX / PRIMARY_KEY)

Actual behaviour

Exported file has creation of table and adding indexes as separate commands.

CREATE TABLE `archive` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;

ALTER TABLE `archive` ADD PRIMARY KEY (`id`);

This causes MYSQL to fail with error: #1030 - Got error -1 from storage engine. (and stops further import)

Server configuration

Operating system:
Linux Ubuntu 12.04, 14.04 (most likely system independent)
Web server:
Apache2, PHP5 (most likely web server independent)
Database:
MySQL 5.3 and 5.6 (probably anything below 5.6 and maybe even 5.7)
PHP version:
5.3, 5.6, 7.0 (most likely independent)
phpMyAdmin version:
4.5.3.1 (I have this issue for few versions now). In older versions PMA created SQL files similar to MySQL native export (indexes in table creation queries)

@madhuracj madhuracj added the Bug A problem or regression with an existing feature label Mar 9, 2016
@devenbansod
Copy link
Member

The link [0] states that :
"The ARCHIVE engine supports the AUTO_INCREMENT column attribute. The AUTO_INCREMENT column can have either a unique or nonunique index. Attempting to create an index on any other column results in an error."

The problem is that we export Primary keys before Auto increments in the footer so it tries to add a primary key to a column which is not an auto increment one (until then) and fails.

[0] : http://dev.mysql.com/doc/refman/5.7/en/archive-storage-engine.html

@nijel nijel added this to the 4.6.2 milestone May 23, 2016
@nijel nijel self-assigned this May 23, 2016
@nijel nijel closed this as completed in 3b37423 May 23, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants