Needed to swap out one of my SQL queries because I'd failed to test an important edge case. The new query has its own potential failure mode that I need to test for and correct if my intuition is right about that, but the thing I've written for now lets me carry on with the work I need to get done today.
This is one of the things I like about writing my own software. When I run into a problem I can just fix it. Based on what I was seeing I had a very good guess at where the problem was, verified the root cause, developed enough of a fix to do what I was trying to do, and carried on with the work.