This is a slightly thorny problem—when I was working on some tests with DBD::Mock, I tried to come up with a good general solution for this issue and the possibility of failure during a prepare call, and ran out of time to do it. I did come up with an adequate hack for this part, though: