[1.4.x] Fixed #20907 - Test failure on Oracle

Backport of the Oracle-specific part of commit a18e43c5bb8cb7c82
from master. This commit made get_indexes more consistent across
backends.

Thanks Tim Graham for pointer to the commit, akaariai and ikelly
for the original commit.