Skip to content

Creation of expression index does not release its statement correctly #7062

@asfernandes

Description

@asfernandes

Test case with index created:

SQL> create table t1 (n integer);
SQL> create table t2 (n integer);
SQL> create index t1_expr on t1 computed by ((select n from t2));
SQL> drop table t1;
SQL> commit;
SQL> drop table t2;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-object TABLE "T2" is in use

Test case with failed index creation:

SQL> create table t1 (n integer);
SQL> create table t2 (n integer);
SQL> insert into t1 values (0);
SQL> commit;
SQL> create index t1_expr on t1 computed by (1 / 0 + (select 1 from t2));
Statement failed, SQLSTATE = 22012
Expression evaluation error for index "***unknown***" on table "T1"
-arithmetic exception, numeric overflow, or string truncation
-Integer divide by zero.  The code attempted to divide an integer value by an integer divisor of zero.
SQL> drop table t1;
SQL> commit;
SQL> drop table t2;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-object TABLE "T2" is in use

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions