Issue #21376:use same metasql as display