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

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

Closed
asfernandes opened this issue Dec 8, 2021 · 0 comments
Closed

Comments

@asfernandes
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment