[MDEV-20723] Self referencing foreign key fails with table does not exist in engine Created: 2019-10-02 Updated: 2020-09-28 Resolved: 2019-10-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.4.6 |
| Fix Version/s: | 10.2.27, 10.3.18, 10.4.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Anders Karlsson | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux CentOS 7.6 |
||
| Issue Links: |
|
||||||||
| Description |
|
A self-referencing foreign key for some reason is only accepted with an extra supporting key. With that in place, a self referencing can be created and then the extra key can be created. Once the MariaDB is restarted though the table is reported as not existing. STurning off foreign key checks makes it appear again, and then all is well, even if FK cjecls are reenabled, until a new restart of MariaDB. The MariaDB Error log reports: To reproduce, first run the following script
Then restart MariaDB and enter again the mysql commandline:
Following this, every restart of MariaDB has the same issue, |
| Comments |
| Comment by Marko Mäkelä [ 2019-10-02 ] | |||||||
|
Isn’t this a duplicate of | |||||||
| Comment by Anders Karlsson [ 2019-10-02 ] | |||||||
|
The looks like a duplicate and I don't see the issue in 10.4.8. But the /Karlsson – | |||||||
| Comment by Elena Stepanova [ 2019-10-06 ] | |||||||
|
Be it the exact same problem or not, I can confirm that it disappeared from 10.2 tree after the same commit
marko, I'm assigning it to you in case there is anything else you want to do with this report (e.g. add a test case, or whatever). Otherwise, please close. |