Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default values not inherited by views [CORE2043] #2479

Open
firebird-automations opened this issue Aug 15, 2008 · 0 comments
Open

Default values not inherited by views [CORE2043] #2479

firebird-automations opened this issue Aug 15, 2008 · 0 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alexander Tyutik (tut)

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant