A query that had data-independent scalar functions with an arithmetic operator was crashing the server when it was run for the second time. The following is an example of the type of query:
SELECT 1 from syscalctable where SYSTIME>SYSTIME-1800000;
The logic has been updated to properly handle this situation.