Fixed #22738 -- made finer distinctions for when Boolean is not detected on Oracle

This is first served as a PR for two purposes:

1) To let interested parties review it
2) To verify by Jenkins that the fix indeed works.
the lambdas were missing a `self` argument, other than that I like them better for a constant method like this. Flake8 said nothing :)