TestBox-96 Fixed query comparison bug

tested on Railo 4.2, CF9, CF10, and CF11.  I added the code in the ticket to the test suite. https://ortussolutions.atlassian.net/browse/TESTBOX-96