-
Notifications
You must be signed in to change notification settings - Fork 126
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
[CBRD-24600] Problem with creating the same index with different names #4020
Conversation
{ | ||
if (filter_predicate) | ||
{ | ||
if (!cons->filter_predicate) | ||
{ | ||
continue; | ||
} | ||
if (i != len) | ||
{ | ||
continue; | ||
} | ||
|
||
if (!filter_predicate->pred_string || !cons->filter_predicate->pred_string) | ||
{ | ||
continue; | ||
} | ||
if (filter_predicate) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking cons->filter_predicate
seems to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the conditions added to the 4105 line,
If filter_predicate is not NULL, cons->filter_predicate is also determined to be NULL.
(filter_predicate && !cons->filter_predicate) || (!filter_predicate && cons->filter_predicate)
CUBRID#4020) http://jira.cubrid.org/browse/CBRD-24600 * fix classobj_check_index_compatibility() and classobj_find_constraint_by_attrs() * with function index
http://jira.cubrid.org/browse/CBRD-24600
The classobj_find_constraint_by_attrs() function is the role of checking whether an index with the same configuration already exists.
The cause of the problem was that the function did not include function index information in the check target of the same configuration.
classobj_check_index_compatibility() was checking if the function index information was the same.
For example, all three indexes below use column val.
create index idx_a on tbl(val);
create index idx_b on tbl(abs(val));
create index idx_c on tbl(val);
case1) If you attempt to create idx_c after creating it in the order of idx_a and idx_b
The classobj_find_constrain_by_attrs() function returns idx_a.
In classobj_check_index_compatibility(), idx_c and idx_a are determined to have the same configuration and do not generate idx_c.
case2) If you attempt to create idx_c after creating it in the order of idx_b and idx_a
The classobj_find_constrain_by_attrs() function returns idx_b.
In classobj_check_index_compatibility(), idx_c and idx_b are determined to have different configurations and will generate idx_c.
So, here's the correction: