Issue Details (XML | Word | Printable)

Key: CORE-2039
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Domain-level CHECK constraints wrongly process NULL values

Created: 12/Aug/08 04:05 AM   Updated: 26/Jan/09 08:28 AM
Component/s: Engine
Affects Version/s: 2.5 Alpha 1, 2.1.1
Fix Version/s: 2.1.2, 2.5 Beta 1

Time Tracking:
Not Specified

Issue Links:
Duplicate
 
Relate
 

Planning Status: Unspecified


 Description  « Hide
Test case:

CREATE DOMAIN D_DATE AS DATE
CHECK (VALUE BETWEEN DATE '01.01.1900' AND DATE '01.01.2050');

CREATE PROCEDURE TMP (PDATE D_DATE)
AS BEGIN END;

COMMIT;

EXECUTE PROCEDURE TMP (NULL);

/* ERROR:
The insert failed because a column definition includes validation constraints.
validation error for variable PDATE, value "1858-11-17".
At procedure 'TMP'.
*/

As we can see, the NULL value is treated as a zero-valued date by the check constraint.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.