[1.7.x] Fixed #23426 -- Don't require double percent sign in RunSQL without parameters

Backport of b9a670b227 from master