The following bug has been logged online:
Bug reference: 1591
Logged by: Michael Williamson
Email address: michael.williamson@caseware.com
PostgreSQL version: 8.0.1
Operating system: Windows 2000
Description: BETWEEN NULL AND NULL causes crash
Details:
Hello,
I have the following query:
SELECT * FROM Entities
WHERE NULL IS NULL OR (EntityNo BETWEEN NULL AND COALESCE(NULL,NULL))
This causes one of two results: postmaster crashes or goes into an infinite
loop. The reason I have such a strange query is because values are filled
in from a dialog. It looks more like:
SELECT * FROM Entities
WHERE %p1 IS NULL OR (EntityNo BETWEEN %p1 AND COALESCE(%p2,%p1))
This query executes ok on other dbs (mssql, mysql) and returns the correct
result (all records). I can fix it for postgre by doing:
SELECT * FROM Entities
WHERE NULL IS NULL OR (EntityNo BETWEEN NULL AND COALESCE(NULL,NULL,''))
But none the less nothing should make it loop infinitely or crash.
Thanks