This issue is related with #7371 but added separately because can happen in various other cases.
In a case of almost any exception when attaching database newly half-created attachment should be destroyed, but during that another exception may happen. Certainly, this is sooner of all a sign of something going seriously wrong, but currently engine makes the second attempt of full attachment release due to decrement of attachment's reference counter. This second try almost for sure cause segfault, which is not good way to inform user about problems with engine.
This issue is related with #7371 but added separately because can happen in various other cases.
In a case of almost any exception when attaching database newly half-created attachment should be destroyed, but during that another exception may happen. Certainly, this is sooner of all a sign of something going seriously wrong, but currently engine makes the second attempt of full attachment release due to decrement of attachment's reference counter. This second try almost for sure cause segfault, which is not good way to inform user about problems with engine.