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

Export MySQL Table (only structure) AUTOINCREMENT error #14066

Closed
slarian opened this Issue Mar 8, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@slarian

slarian commented Mar 8, 2018

Steps to reproduce

1.Have a MySQL Database with a Table with a int primary key with autoincrement
2.Have Data in your table
3.Select the Database from the left database menu (tree)
4.Click on Export from the top menu.
5.Check "Custom - display all possible options"
6.Uncheck the "data" from the export options (export only structure)

Expected behaviour

ALTER TABLE bank_account_statements
MODIFY id_bank_account_statement int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

Actual behaviour

-- See that AUTO_INCREMENT = 4 should not be there. Since I want to export a table with no data.

ALTER TABLE bank_account_statements
MODIFY id_bank_account_statement int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;

Server configuration

Operating system:
Localhost via UNIX socket

Web server:
5.6.38 - MySQL Community Server (GPL)
PHP version:
5.6.34

Database:
MySQL

phpMyAdmin version:
4.7.7

Client configuration

Browser:
Google Chrome

Operating system:
Windows 10

@ibennetch

This comment has been minimized.

Member

ibennetch commented Mar 10, 2018

This only affects database-level exports, table-level exports seem to be fine.

@ibennetch ibennetch added the bug label Mar 10, 2018

@ibennetch

This comment has been minimized.

Member

ibennetch commented Mar 10, 2018

Also, both QA_4_7 and master are currently affected.

@meteorlxy

This comment has been minimized.

Contributor

meteorlxy commented Mar 24, 2018

In table-level exports, when selecting structure only, the AUTO_INCREMENT value will be auto disabled (so does in server-level exports).

In database-level exports, the structure or data options of tables could be diverse, and the single AUTO_INCREMENT value will not work for all the tables for sure (enable by default). That's what causes this bug. I'll try to fix it.

meteorlxy added a commit to meteorlxy/phpmyadmin that referenced this issue Mar 24, 2018

fix: AUTO_INCREMENT error when only exporting table structure in data…
…base-level exports; issue phpmyadmin#14066

Signed-off-by: Xinyu Liu <meteor.lxy@foxmail.com>

meteorlxy added a commit to meteorlxy/phpmyadmin that referenced this issue Mar 24, 2018

fix: AUTO_INCREMENT error when only exporting table structure in data…
…base-level exports; issue phpmyadmin#14066

Signed-off-by: Xinyu Liu <meteor.lxy@foxmail.com>

mauriciofauth added a commit that referenced this issue May 16, 2018

Merge pull request #14119 from meteorlxy/patch-tmp
fix: AUTO_INCREMENT error when only exporting table structure in database-level exports; issue #14066

@mauriciofauth mauriciofauth self-assigned this May 16, 2018

@mauriciofauth mauriciofauth added this to the 4.8.1 milestone May 16, 2018

mauriciofauth added a commit that referenced this issue May 16, 2018

fix: AUTO_INCREMENT error when only exporting table structure in data…
…base-level exports; issue #14066

Signed-off-by: Xinyu Liu <meteor.lxy@foxmail.com>
(cherry picked from commit f1fa924)
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>

mauriciofauth added a commit that referenced this issue May 16, 2018

Add ChangeLog entry for #14066
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment