This seems worthwhile in its own right, but also works around an Oracle
bug (in versions 10 -- 11.1) where the use of Unicode would reset the
date/time formats, causing ORA-01843 errors.
Thanks Trac users CarstenF for the report, jtiai for the initial patch,
and everyone who contributed to the discussion on the ticket.
Backport of 6983201 from master.
Previously, when createcachetable and flush operated on non-default
databases, they weren't atomic.
Also avoided transactional DDL and transactional truncates on databases
that don't support them (refs #22308).
Backport of 753a22a635, 0757e0f30d, and 6877a9d415 from master