Some RDBMSs allow you to escape single quotes by doubling them.... 'hello mr. o''brian', TheSQL parser will turn this into 'hello mr. o' 'brian'.  This commit fixes that.
Merge branch '4.0_QuerySingleQuoteParsingEndlessLoop' into 4.0