Issue Details (XML | Word | Printable)

Key: CORE-4453
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Pavel Zotov
Votes: 0
Watchers: 1

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

Regression: NOT NULL constraint, declared in domain, does not work

Created: 07/Jun/14 12:16 PM   Updated: 23/Sep/15 11:25 AM
Component/s: None
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

QA Status: Done successfully
Test Details:
See also tests that manipulates with NULL fields/domains and check results:
CORE-1518 Adding a non-null restricted column to a populated table renders the table inconsistent;
CORE-4453 (Regression: NOT NULL constraint, declared in domain, does not work);
CORE-4725 (Inconsistencies with ALTER DOMAIN and ALTER TABLE with DROP NOT NULL and PRIMARY KEYs);
CORE-4733 (Command "Alter table <T> alter TYPE <C> <DOMAIN_WITH_NOT_NULL" does not verifies data in column <C> and makes incorrect assignments in <C> to ZERO / JULIAN_DATE / ASCII(0) for types INT, TIMESTAMP and VARCHAR);

 Description  « Hide

SQL> create domain dm_01 varchar(20) not null; --- ::: NB ::: "NOT null" clause here
SQL> commit;
SQL> create table t_01(s dm_01, x int); commit;
SQL> insert into t_01(x) values(100); -- PASSED!! Why ?
SQL> commit;
SQL> select * from t_01 where s is null;

==================== ============

PS-1. No such error in 2.5.

PS-2. No such error in case when not null clause is included in field declaration rather than in domain, i.e.:

SQL> create domain dm_02 varchar(20); commit; -- this domain is declared WITHOUT not-null clause...
SQL> create table t_02(s dm_02 not null, x int); commit; -- ... but field 'S' *does* contain explicit "not null" declaration
SQL> insert into t_02(x) values(100);
Statement failed, SQLSTATE = 23000
validation error for column "T_02"."S", value "*** null ***"

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.