| Bug #103463 | ALTER TABLE produces a duplicate table | ||
|---|---|---|---|
| Submitted: | 24 Apr 2021 19:30 | Modified: | 29 Apr 2021 1:30 |
| Reporter: | Michael Grauman | Email Updates: | |
| Status: | Unsupported | Impact on me: | |
| Category: | MySQL Server: DDL | Severity: | S2 (Serious) |
| Version: | 5.7.32-log | OS: | Windows (Azure cloud instance) |
| Assigned to: | CPU Architecture: | Any (Unknown) | |
| Tags: | ALTER TABLE DUPLICATE | ||
[24 Apr 2021 19:30]
Michael Grauman
[24 Apr 2021 22:42]
MySQL Verification Team
Thank you for the bug report. I couldn't repeat with current release of 5.7:
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.34-log MySQL Community Server (GPL)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE DATABASE r;
Query OK, 1 row affected (0.00 sec)
mysql> USE r
Database changed
mysql> CREATE TABLE `test` (
-> `ID` int(11) NOT NULL,
-> `testcol1` varchar(45) DEFAULT NULL,
-> PRIMARY KEY (`ID`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.07 sec)
mysql> ALTER TABLE `test` ADD COLUMN `testcol2` VARCHAR(45) NULL AFTER `testcol1`;
Query OK, 0 rows affected (0.10 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> SHOW TABLES;
+-------------+
| Tables_in_r |
+-------------+
| test |
+-------------+
1 row in set (0.00 sec)
mysql> SHOW CREATE TABLE test\G
*************************** 1. row ***************************
Table: test
Create Table: CREATE TABLE `test` (
`ID` int(11) NOT NULL,
`testcol1` varchar(45) DEFAULT NULL,
`testcol2` varchar(45) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> ALTER TABLE `test` ADD COLUMN `testcol3` VARCHAR(45) NULL AFTER `testcol2`;
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> SHOW CREATE TABLE test\G
*************************** 1. row ***************************
Table: test
Create Table: CREATE TABLE `test` (
`ID` int(11) NOT NULL,
`testcol1` varchar(45) DEFAULT NULL,
`testcol2` varchar(45) DEFAULT NULL,
`testcol3` varchar(45) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> SHOW TABLES;
+-------------+
| Tables_in_r |
+-------------+
| test |
+-------------+
1 row in set (0.00 sec)
mysql>
If I misunderstand what you meant with duplicate table please print here your results. Thanks.
[29 Apr 2021 0:08]
Michael Grauman
I don't believe you misunderstood, but through more online searches, I have found other people who are experiencing this. It seems to be isolated to Azure MySQL cloud servers. A reboot of the server clears the problem. I am not sure what causes it to start happening, but if I determine that I will post further comments.
[29 Apr 2021 1:29]
MySQL Verification Team
We don't support Azure Cloud server you need to contact their support.
