[MDEV-22602] WITHOUT OVERLAPS constraint is ignored when update is performed via foreign key cascade Created: 2020-05-17 Updated: 2023-11-05 Resolved: 2020-06-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.5 |
| Fix Version/s: | 10.5.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Aleksey Midenkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Description |
|
So, now we have a non-unique key with an overlap. Traditional PK would prevent the update by throwing ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO. |
| Comments |
| Comment by Nikita Malyavin [ 2020-06-04 ] | ||||||||||
|
It turns out that any sql-side constraints don't work, as well as any triggers: see | ||||||||||
| Comment by Elena Stepanova [ 2020-06-04 ] | ||||||||||
|
Unique constraint works, for example:
CHECK constraints don't work. Not sure if it's a limitation or a bug, both are hard to find in documentation/JIRA. I'll try to search and will file a bug if I don't find an existing one. Given that WITHOUT OVERLAPS behaves as a unique key rather than check constraint in other aspects, such as error handling, I'd expect it to do the same here. However, I don't have strict objections to declaring it a limitation, if serg is okay with it. | ||||||||||
| Comment by Nikita Malyavin [ 2020-06-04 ] | ||||||||||
|
That unfortunately is a limitation. It will work like UNIQUE(a, e, s) due to how it is implemented | ||||||||||
| Comment by Sergei Golubchik [ 2020-06-07 ] | ||||||||||
|
I agree we cannot fix it properly now. Shouldn't the server disallow cascading FK constraints that might modify columns in long-uniques, without overlap, or check constraints? Until MDEV-16417 is done, that is? | ||||||||||
| Comment by Oleksandr Byelkin [ 2020-06-08 ] | ||||||||||
|
I have fixed to 10.5 to have "disallowing" mentioned above be in 10.5 | ||||||||||
| Comment by Oleksandr Byelkin [ 2020-06-12 ] | ||||||||||
|
fix the goto and OK to push |