Fixed #17158 -- Used a non-ambiguous representation of SQL queries

when a correct representation cannot be obtained.