Issue Details (XML | Word | Printable)

Key: CORE-1518
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Dmitry D
Votes: 1
Watchers: 1

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

Adding a non-null restricted column to a populated table renders the table inconsistent

Created: 17/Oct/07 03:45 AM   Updated: 17/Nov/15 10:57 AM
Component/s: Engine
Affects Version/s: 2.0.1
Fix Version/s: 3.0 Alpha 1

Environment: Windows XP Prof SP2
Issue Links:

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
Consider the following sequence:

create table dyd(c1 integer)
insert into dyd(c1) values (1)
alter table dyd add c2 integer not null
update dyd set c1 = 2 where c1 = 1

All the statements succeed but the last one which yields [The insert failed because a column definition includes validation constraints.validation error for column C2, value "*** null ***".].

I think the third commit should have failed as committing the change puts the table into an inconsistent state where further updates would fail.

The problem is easily solved by updating the c2 column to a non-null value but the real issue is an application developer would add a column and pass the DB to an end user being reasonably sure the DB is consistent since commit succeeded (which is not true).

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 25/Sep/15 12:19 PM
Test created.