[MDEV-8960] Can't refer the same column twice in one ALTER TABLE Created: 2015-10-18 Updated: 2020-08-25 Resolved: 2017-08-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | 10.0.21 |
| Fix Version/s: | 5.5.58, 10.0.33, 10.1.27, 10.2.9, 10.3.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Denis Malinovskiy | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | upstream | ||
| Environment: |
Linux |
||
| Description |
|
I have a simple table with the following structure:
When I'm trying to run following statement:
I've got an error:
However when I'm splitting these changes into two separate ALTER TABLE, it works:
|
| Comments |
| Comment by Elena Stepanova [ 2015-10-20 ] |
|
Thanks for the report. It's an upstream issue present in all MySQL versions from 5.1 to 5.7 (I didn't check 5.0 and earlier), and correspondingly in all MariaDB versions from 5.1 to 10.1. I imagine it must be either a known bug, or a feature, but I failed to find it either in documentation or in MySQL bug base. dmalinovsky, our normal routine is to also report upstream problems at bugs.mysql.com, are you willing to do it, or do we need to report it on your behalf? |
| Comment by Denis Malinovskiy [ 2015-10-20 ] |
|
elenst, if you can report it on my behalf, please go for it—I'm not sure my report will be as detailed and correct. Спасибо! |
| Comment by Elena Stepanova [ 2015-10-20 ] |
|
Actually, your report already had all details, but no problem, filed as http://bugs.mysql.com/bug.php?id=78891. |
| Comment by Jan Lindström (Inactive) [ 2017-07-27 ] |
|
https://github.com/mariadb/server/commit/4c26b71c77d58fbeb3192e2142ef66efe5f122dd |
| Comment by Oleksandr Byelkin [ 2017-08-04 ] |
|
OK to push! |
| Comment by Jan Lindström (Inactive) [ 2017-08-18 ] |
|
commit ce6c0e584e35b516297f2afdaea5b31e508b7570 Problem was that if column was created in alter table when mysql_prepare_alter_table: |