[1.7.x] Fixed #22653 -- Added some database feature flags to tests.

Thanks Rahul Priyadarshi.

Backport of 99f5ea9cc8 from master