Added regression test for custom SQL containing percents

Refs #3485.