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

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

Open
hvlad opened this issue Feb 27, 2024 · 0 comments

Comments

@hvlad
Copy link
Member

hvlad commented Feb 27, 2024

  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.

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