Skip to content

When dropping a function and a dependent table in the same transaction, error may or may not occurs. #8021

@hvlad

Description

@hvlad
  1. create metadata and disconnect
set autoddl off;
set term ^;

create function f(x int)
  returns int
as
begin
  return x;
end
^
create table t_fn (x int, fx computed by (f(x)))
^
commit
^
set term ;^
exit;
  1. connect and try to drop objects
set autoddl off;
drop function f;
drop table t_fn;
commit;

Error raised:

SQL> set autoddl off;
SQL> drop function f;
SQL> drop table t_fn;
Statement failed, SQLSTATE = 39000
unsuccessful metadata update
-DROP TABLE T_FN failed
-invalid request BLR at offset 2
-function F is not defined
SQL> commit;
Statement failed, SQLSTATE = 38000
unsuccessful metadata update
-cannot delete
-Function F
-there are 1 dependencies
SQL> rollback;
  1. connect, use function and then try to drop objects - no error happens
set autoddl off;
select f(1) from rdb$database;
commit;
drop function f;
drop table t_fn;
commit;

The behaviour should be consistent and not dependent on previous state of metadata cache.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions