[MDEV-25712] Foreign key error 1761 not caught by stored routine exception handler Created: 2021-05-18 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Stored routines |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.1.48, 10.2.38, 10.3.29, 10.4.19, 10.5.10, 10.6.0, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
Error code 1761 "Foreign key constraint ... would lead to a duplicate entry" can't be caught within a stored routines exception handler. How to reproduce:
Expected result, due to the error handler kicking in:
Actual result:
|
| Comments |
| Comment by Marko Mäkelä [ 2021-05-20 ] |
|
As far as I can tell, the unexpected error is being reported by the SQL layer, in response to a HA_ERR_FOREIGN_DUPLICATE_KEY return value that InnoDB mapped its original DB_FOREIGN_DUPLICATE_KEY into. Maybe handler::print_error() should invoke the exception handler? |