Issue Details (XML | Word | Printable)

Key: CORE-2043
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Alexander Tyutik
Votes: 0
Watchers: 0
Operations

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

Default values not inherited by views

Created: 15/Aug/08 10:05 AM   Updated: 15/Aug/08 10:05 AM
Component/s: None
Affects Version/s: 2.1.0
Fix Version/s: None


 Description  « Hide
I don't know what standart tels about this, but i think this is incorrect behavior.

Here is an example:

CREATE TABLE TEST_TABLE (
    FIELD1 INTEGER DEFAULT 1,
    FIELD2 INTEGER DEFAULT 2
);

CREATE OR ALTER TRIGGER TEST_TABLE_BI0 FOR TEST_TABLE
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  EXCEPTION ERROR COALESCE(NEW.FIELD2, '<null>');
END;

CREATE VIEW TEST_VIEW AS SELECT * FROM TEST_TABLE;

CREATE TRIGGER TEST_VIEW_BI0 FOR TEST_VIEW
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  EXCEPTION ERROR COALESCE(NEW.FIELD2, '<null>');
END;

Now test queries:

1) INSERT INTO TEST_TABLE (FIELD1) VALUES (3)

------------
ERROR.
2.
At trigger 'TEST_TABLE_BI0' line: 5, col: 3.


2) INSERT INTO TEST_TABLE (FIELD1) VALUES (3)

------------
ERROR.
<null>.
At trigger 'TEST_VIEW_BI0' line: 5, col: 3.

I think that NEW.FIELD2 must contain value "2" for table and for view...

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