Skip to content

Commit

Permalink
[CBRD-24435] When renaming a view, even if there is a not null constr…
Browse files Browse the repository at this point in the history
…aint, change it so that no error occurs. (#3744) (#3863)

http://jira.cubrid.org/browse/CBRD-24435

backport #3744
  • Loading branch information
youngjinj authored Oct 13, 2022
1 parent 526157f commit a81f913
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/query/execute_schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -8932,9 +8932,14 @@ do_recreate_renamed_class_indexes (const PARSER_CONTEXT * parser, const char *co
return NO_ERROR;
}

/* We can come here by renaming a view. In general, views have no constraints. If there are no constraints,
* NO_ERROR is returned before. However, views can have shared columns with a not null constraint.
* Renaming does not affect the not null constraint. So, even if the view has a not null constraint,
* change it so that an error does not occur here. I do not think there is a view with a constraint
* other than a not null constraint. Change the return value from ER_OBJ_NOT_A_CLASS to NO_ERROR. (In CBRD-24435) */
if (class_->class_type != SM_CLASS_CT)
{
return ER_OBJ_NOT_A_CLASS;
return NO_ERROR;
}

for (c = class_->constraints; c; c = c->next)
Expand Down

0 comments on commit a81f913

Please sign in to comment.