SQLite

View Ticket
Login
Ticket Hash: 4d01eda8115b10d1227b62352c750655a279d310
Title: IS TRUE operator malfunctions with COLLATE and REAL value
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-06-12 13:50:44
Version Found In:
User Comments:
mrigger added on 2019-06-12 12:41:11:

It seems that using IS TRUE together with a COLLATE operator that is part of the right side of the expression results in an incorrect result:

SELECT 0.5 IS TRUE COLLATE NOCASE; -- expected: 1, actual: 0
SELECT 0.5 IS TRUE COLLATE RTRIM; -- expected: 1, actual: 0
SELECT 0.5 IS TRUE COLLATE BINARY; -- expected: 1, actual: 0

Without the COLLATE, or if the COLLATE is on the left side, the result is as expected:

SELECT 0.5 IS TRUE; -- 1
SELECT 0.5 COLLATE NOCASE IS TRUE; -- 1

The IS FALSE operator does not seem to be affected:

SELECT 0.5 IS FALSE COLLATE NOCASE; -- 0
SELECT 0.5 IS FALSE COLLATE RTRIM; -- 0
SELECT 0.5 IS FALSE COLLATE BINARY; -- 0


dan added on 2019-06-12 13:50:44:

Fixed by [5c6146b56a75a94f].