[1.7.x] Fixed #21630 -- Simplified management command discovery

Thanks Aymeric Augustin for the report end the review.
Backport of fe53bc524 from master.
[1.7.x] Fixed #22715: Corrected sql for defaults of BinaryField on Oracle with Python3

While at it, fixed a problem in returning empty values
(still with BinaryField/Oracle/Python3).

Backport of fd427f1 from master
[1.7.x] Set straight the sense of 'uppercases_column_names' feature flag