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

Percona SQL "SHOW CREATE TABLE" parsed (in)correctly, yielding wrong ALTER TABLE syntax #1160

Open
lserni opened this issue Sep 20, 2020 · 3 comments

Comments

@lserni
Copy link

lserni commented Sep 20, 2020

An INTEGER column gets reported by MySQL SHOW CREATE TABLE like

`antani` INT(11) DEFAULT NULL

But Percona 8.0 ("8.0.20-11 Percona Server (GPL), Release '11', Revision '5b5a5d2'") reports instead:

`antani` int DEFAULT NULL

NOTICE: I do not know whether this is correct SQL behaviour. The error might well be on Percona's side.

As a result, internally the column receives width 10, precision 0. Any changes to this column that do not affect the width/precision will then generate an ALTER TABLE containing the inferred, wrong, values:

ALTER TABLE `sbiriguda`
CHANGE COLUMN `antani` `antani` INT(10,0) NULL AFTER `tarapia`;

And this, of course, will be rejected by Percona:

   You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',0) NULL AFTER...

WORKAROUND: re-write, every single time, all modified INTEGER columns' width from 10.0 to 11.

To Reproduce
Connect to a Percona 8.0 server and open any table definition that holds an INTEGER column (or create one).
The column will be reported with width 10, precision 0.

Expected behavior
The column is reported with width information only, usually 11.

Environment:

  • HeidiSQL 11.0.0.5919
  • 8.0.20-11 Percona Server (GPL), Release '11', Revision '5b5a5d2'
@Nitroxid
Copy link

I have the same issue.

When trying to change the name of any integer column I get the error mentioned above, unless I also change the length in the table-view as well.

Environment

  • HeidiSQL 11.0.0.5919
  • MySQL 8.0.22-0ubuntu0.20.04.2

@ansgarbecker
Copy link
Collaborator

Could you please update to the latest build, at least release v11.1 and retry.

@Nitroxid
Copy link

Just did, and it works. Sorry for not checking for the new version first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants