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.