Attempting to run the following statement fails as the selection range becomes invalid

CREATE MASK mask_ccnum
ON customers
FOR COLUMN cc_number
RETURN
CASE
WHEN cc_number IS NULL THEN NULL
ELSE
'XXXX-XXXX-XXXX-' || SUBSTR(cc_number, CHAR_LENGTH(cc_number) - 3, 4)
END
ENABLE;
Attempting to run the following statement fails as the selection range becomes invalid
