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

System triggers on view with check option are not removed [CORE2685] #3088

Closed
firebird-automations opened this issue Oct 15, 2009 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alex Bekhtin (afgm)

Is related to QA419

CREATE TABLE TEST_TABLE (
ID INTEGER,
CAPTION VARCHAR(10)
);

CREATE OR ALTER VIEW VW_TEST_VIEW(
ID,
CAPTION)
AS
select ID
,CAPTION
from test_table
where ID > 0;

COMMIT;

select rdb$dependent_name from rdb$dependencies where RDB$DEPENDED_ON_NAME = 'VW_TEST_VIEW';

CREATE OR ALTER VIEW VW_TEST_VIEW(
ID,
CAPTION)
AS
select ID
,CAPTION
from test_table
where ID > 0
WITH CHECK OPTION;

COMMIT;

select rdb$dependent_name from rdb$dependencies where RDB$DEPENDED_ON_NAME = 'VW_TEST_VIEW';

RDB$DEPENDENT_NAME

CHECK_1
CHECK_1
CHECK_2

-- repeat 3 times
-- 1
CREATE OR ALTER VIEW VW_TEST_VIEW(
ID,
CAPTION)
AS
select ID
,CAPTION
from test_table
where ID > 0

-- 2
WITH CHECK OPTION;
CREATE OR ALTER VIEW VW_TEST_VIEW(
ID,
CAPTION)
AS
select ID
,CAPTION
from test_table
where ID > 0
WITH CHECK OPTION;

-- 3
CREATE OR ALTER VIEW VW_TEST_VIEW(
ID,
CAPTION)
AS
select ID
,CAPTION
from test_table
where ID > 0
WITH CHECK OPTION;

COMMIT;

-- more checks
select rdb$dependent_name from rdb$dependencies where RDB$DEPENDED_ON_NAME = 'VW_TEST_VIEW';

RDB$DEPENDENT_NAME

CHECK_1
CHECK_1
CHECK_3
CHECK_2
CHECK_3
CHECK_4
CHECK_5
CHECK_5
CHECK_6
CHECK_7
CHECK_7
CHECK_8

CREATE OR ALTER VIEW VW_TEST_VIEW(
ID,
CAPTION)
AS
select ID
,CAPTION
from test_table
where ID > 0
--WITH CHECK OPTION
;

-- ERROR vvv
CREATE OR ALTER VIEW VW_TEST_VIEW(
ID
--,CAPTION
)
AS
select ID
--,CAPTION
from test_table
where ID > 0;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-cannot delete
-COLUMN VW_TEST_VIEW.CAPTION
-there are 4 dependencies

Commits: d5f1cac 69fe7de 6abdc46 e108800

====== Test Details ======

Updated code: made STDOUT independent of Firebird version
Note about SIMILAR TO: one need here to specify backslash TWICE inside escape clause,
e.g: ... escape '\\' (fbt_run feature ?)

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC2 [ 10372 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 2.5 RC1 [ 10362 ]

summary: does not remove the system triggers on view with check option => System triggers on view with check option are not removed

Fix Version: 2.5 RC2 [ 10372 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA419 [ QA419 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Done successfully

Test Details: Updated code: made STDOUT independent of Firebird version
Note about SIMILAR TO: one need here to specify backslash TWICE inside escape clause,
e.g: ... escape '\\' (fbt_run feature ?)

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