提问人:HARISH 提问时间:3/7/2023 最后编辑:HARISH 更新时间:3/7/2023 访问量:57
MySQL 版本 8.0.28 的 ForeignKeyFailedException 中未显示外键名称
Foreign key name is not showing in ForeignKeyFailedException in MySQL version 8.0.28
问:
我的代码抛出外键异常。 MySQL 8.0.12显示完整的异常消息(带有外键名称),但是当我升级到MySQL到8.0.28时,它没有显示完整的异常消息。
MySQL 8.0.12 中的异常:
Exceptions.ForeignKeyFailedException: Upsert failed as some referenced entity doesnt exist. ---> MySql.Data.MySqlClient.MySqlException: Cannot add or update a child row: a foreign key constraint fails (`SchemaName`.`table name`, CONSTRAINT `foreign key name` FOREIGN KEY (`column`) REFERENCES `table name` (`column`) ON UPDATE CASCADE)
MySQL 8.0.28 中的异常:
Exceptions.ForeignKeyFailedException: Upsert failed as some referenced entity doesnt exist. ---> MySql.Data.MySqlClient.MySqlException: Cannot add or update a child row: a foreign key constraint fails
如何在 MySQL 8.0.28 或更高版本中显示完整的异常消息?
答: 暂无答案
评论