[MDEV-19528] Client warning and log error about FK inconsistency are logically mixed up Created: 2019-05-20 Updated: 2021-04-26 Resolved: 2021-04-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 5.5, 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Consider the following scenario:
The first SELECT when FOREIGN_KEY_CHECKS=ON, fails:
And at the same time produces the warning in the error log:
It should be the other way round: the message explaining the nature of the problem and suggesting the solution should be the error shown to the user, especially since it only requires a session-level change; while the error about table not existing in the engine is a fairly low-level product which doesn't anyhow help the user, it should go to the error log (if anywhere at all). |
| Comments |
| Comment by Marko Mäkelä [ 2021-04-26 ] |
|
elenst, do you have an up-to-date example of this, or can we close this as a duplicate of
I believe that serg is against adding any storage engine specific error codes and messages. InnoDB probably is the only storage engine that supports foreign keys. Furthermore, my understanding is that most ha_innobase member functions are not even allowed to invoke my_error(). |
| Comment by Elena Stepanova [ 2021-04-26 ] |
|
I'm fine with closing it as a duplicate. Things regarding foreign_keys check change frequently, I don't think there is any point in searching similarities in the current behavior with a 2-year-old bug. If I have similar complaints later, I'll resurrect it or will file a new one. |