[1.7.x] Fixed #24051 -- Made schema infrastructure honor tablespaces

Partial backport of 30cbd5d36. Thanks Douglas J. Reynolds for the
report and initial patch.