Skip to content

Possible NULL in NOT NULL-Field [CORE6416] #6654

Open
@firebird-automations

Description

@firebird-automations

Submitted by: Maxim Kuzmin (cybermax)

Steps for reproduce:
1. Create tables.
CREATE TABLE TEST_TABLE (
ID INTEGER NOT NULL,
NEW_FIELD INTEGER
);

CREATE TABLE TEST_TABLE_2 (
ID INTEGER NOT NULL
);

SET TERM ^ ;

CREATE OR ALTER TRIGGER TEST_TABLE_2_AI0 FOR TEST_TABLE_2
ACTIVE AFTER INSERT POSITION 0
AS
BEGIN
INSERT INTO TEST_TABLE(id) values(http://new.id);
END
^

SET TERM ; ^

2. Execute insert record, but rollback the transaction.
INSERT INTO TEST_TABLE_2(ID) VALUES (1)

3. Set NEW_FIELD as NOT NULL:
ALTER TABLE TEST_TABLE ALTER NEW_FIELD SET NOT NULL

4. Execute insert record and commit the transaction.
INSERT INTO TEST_TABLE_2(ID) VALUES (1)

5. Check values:
SELECT * FROM TEST_TABLE:
ID NEW_FIELD
1 <NULL>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions