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

Can't alter field after dropping all dependent triggers (all in one transaction) [CORE3458] #3819

Open
firebird-automations opened this issue Apr 30, 2011 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Nick (nick)

Is duplicated by CORE5763

test:
CREATE TABLE T (F INTEGER);

CREATE TRIGGER T_BI FOR T ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
NEW.F = 0;
END

COMMIT;

DROP TRIGGER T_BI;
ALTER TABLE T ALTER F TO FF -- exception here
COMMIT;

Exception text:
unsuccessful metadata update
Column F from table T is referenced in T_BI
This operation is not defined for system tables.
Error Code: 31
-------
Tested on FB 2.5.1.26266

@firebird-automations
Copy link
Collaborator Author

Commented by: Nick (nick)

still exists in 3.0.1

@firebird-automations
Copy link
Collaborator Author

Modified by: Nick (nick)

Version: 3.0.1 [ 10730 ]

Version: 2.5.1 [ 10333 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

I see that you omit 'set term' and semicolon(s). Can you repeat following script in ISQL rather than in IDE ?
(of course, replace 'c:\temp', DB name and user/password with your settings)

set bail on;
set echo on;
shell if exist c:\temp\e30.fdb del /q /f c:\temp\e30.fdb;
create database 'localhost:c:\temp\e30.fdb' user sysdba password 'masterkey';
show version;

create table t (f integer);

set term ^;
create trigger t_bi for t active before insert position 0 as
begin
new.f = 0;
end
^
set term ;^

commit;

drop trigger t_bi;
alter table t alter f to ff;
commit;

drop database;

// Checked on WI-V3.0.1.32609 (release 3.0.1) and on fresh 3.0.2 snapshot: no errors.

@firebird-automations
Copy link
Collaborator Author

Commented by: Nick (nick)

With turning ddl autocommit off (set autoddl off) I have:

Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-ALTER TABLE T failed
-Column F from table T is referenced in T_BI
After line 20 in file script.sql

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE5763 [ CORE5763 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

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

2 participants