Issue Details (XML | Word | Printable)

Key: CORE-3458
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Nick
Votes: 0
Watchers: 4
Operations

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

Can't alter field after dropping all dependent triggers (all in one transaction)

Created: 30/Apr/11 03:30 PM   Updated: 03/Mar/18 08:34 AM
Component/s: Engine
Affects Version/s: 3.0.1
Fix Version/s: None

Issue Links:
Duplicate
 


 Description  « Hide
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

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Nick added a comment - 17/Feb/17 02:07 PM
still exists in 3.0.1

Pavel Zotov added a comment - 18/Feb/17 06:15 AM
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.

Nick added a comment - 18/Feb/17 09:41 AM
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